Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba1328311c | ||
|
|
9e6b9396bc | ||
|
|
2e40db5fe5 | ||
|
|
720bf8697f | ||
|
|
1893d1a130 | ||
|
|
8472baf031 | ||
|
|
6cab618706 | ||
|
|
ebf3b362f7 | ||
|
|
2dd303f53c | ||
|
|
df69fb0b07 | ||
|
|
a0d9771fa6 | ||
|
|
a71c46bb98 | ||
|
|
995f317b4f | ||
|
|
6ef2de2923 | ||
|
|
37c4e86566 | ||
|
|
11071b279b | ||
|
|
5ab7463f35 | ||
|
|
74c9238e3a | ||
|
|
e874e46304 | ||
|
|
b32df6ac15 | ||
|
|
b76dd3561f | ||
|
|
60bfbdcabd | ||
|
|
c128d0851b | ||
|
|
2f3b7762e4 | ||
|
|
0e594f5098 | ||
|
|
14151d4dda | ||
|
|
94ab21fb15 | ||
|
|
1acac3d6c6 | ||
|
|
95ec2dc9d2 | ||
|
|
6b93eb6c1e | ||
|
|
838578a042 | ||
|
|
2f689f0438 | ||
|
|
022025ded6 | ||
|
|
320a7a6aba | ||
|
|
fa82870883 | ||
|
|
a094d4f9da | ||
|
|
bb028af694 | ||
|
|
aeb225ec7c | ||
|
|
06a632459e | ||
|
|
221efbddb4 | ||
|
|
e81a88938a | ||
|
|
65e257077c | ||
|
|
95659d5b7a | ||
|
|
ff57270286 | ||
|
|
4fc61ba99a | ||
|
|
3cd22081f4 | ||
|
|
d20ee95e67 | ||
|
|
cd47f6b123 | ||
|
|
53a2d0a65e | ||
|
|
13318243e4 | ||
|
|
acc457436a | ||
|
|
8d80151889 | ||
|
|
8b0ade5b9f | ||
|
|
9f033e4654 | ||
|
|
1a2b8571d0 | ||
|
|
9ab20be294 | ||
|
|
a34cbfdd55 | ||
|
|
94f5b781cc | ||
|
|
f83e7c3b4e | ||
|
|
607dc89be5 | ||
|
|
47758c4aeb | ||
|
|
26414d4925 | ||
|
|
7ad92e7f5d | ||
|
|
e775cef5bd | ||
|
|
ac9ce144a0 | ||
|
|
f181c06f89 | ||
|
|
9fae4692e3 | ||
|
|
97f0d6441a | ||
|
|
2ea6cb6304 | ||
|
|
5bed68a963 | ||
|
|
be9862d0b0 | ||
|
|
f5a811f0f8 | ||
|
|
dc9d343115 | ||
|
|
c92aa435e5 | ||
|
|
1f425e6bac | ||
|
|
0854544a47 | ||
|
|
52a7922e98 | ||
|
|
558583b16f | ||
|
|
993d065368 | ||
|
|
d7376fa8ef | ||
|
|
2b175b13c4 | ||
|
|
da0445489e | ||
|
|
e4eaa760b9 | ||
|
|
de4017f385 | ||
|
|
f2119aa0f7 | ||
|
|
bb81f3f874 | ||
|
|
fae15eecb1 | ||
|
|
6edcc2125b | ||
|
|
d26909a1d6 | ||
|
|
3be6b842c4 | ||
|
|
e10dc700c3 | ||
|
|
e8e21f949c | ||
|
|
e68a7d72f2 | ||
|
|
fd26db8e8a | ||
|
|
396f1290e7 | ||
|
|
5bc7dd8692 | ||
|
|
b5b68ad51f | ||
|
|
e49ceed40c | ||
|
|
598aec7f52 | ||
|
|
f25d2627cd | ||
|
|
3e6f1bace3 | ||
|
|
fb851ff3f0 | ||
|
|
92bf8f5de8 | ||
|
|
8f318892c2 | ||
|
|
28a62ed39a | ||
|
|
4c08927ed9 | ||
|
|
a93da39711 | ||
|
|
557f4b80b6 | ||
|
|
c657a2aac6 | ||
|
|
af99748441 | ||
|
|
db87427e7c | ||
|
|
c9b82034f0 | ||
|
|
96aef2c1be | ||
|
|
a3958a6437 | ||
|
|
485aca2e6c | ||
|
|
88d588bb44 | ||
|
|
9cc98c7c31 | ||
|
|
69acc1f74a | ||
|
|
d8be718a30 | ||
|
|
efd3a0add3 | ||
|
|
55ecdfcf1f | ||
|
|
fab8d28802 | ||
|
|
72992729f9 | ||
|
|
7c5d843c61 | ||
|
|
19a66fdba4 | ||
|
|
5c88f43083 | ||
|
|
6ef01a83a8 | ||
|
|
cd2e5396a0 | ||
|
|
7e590d6e69 | ||
|
|
92e360feed | ||
|
|
5015b9e4da | ||
|
|
1131084e2f | ||
|
|
8fab3e8183 | ||
|
|
6f4df9e3b1 | ||
|
|
7223b3bc26 | ||
|
|
48a02da11d | ||
|
|
68acd49234 | ||
|
|
6728a71210 | ||
|
|
d6cfbfcedf | ||
|
|
8644a65e58 | ||
|
|
9306b31c12 | ||
|
|
ff911ee73d | ||
|
|
df89623f06 | ||
|
|
3329257c46 | ||
|
|
e853efbf94 | ||
|
|
4fae216a29 | ||
|
|
99b0a0dc17 | ||
|
|
ecc619e5fe | ||
|
|
17de71e59c | ||
|
|
34621ebabc | ||
|
|
98dae5cff8 | ||
|
|
5b174bab35 | ||
|
|
dbb51bdb41 | ||
|
|
91330111fa | ||
|
|
242ba3dc9f | ||
|
|
aae9568b72 | ||
|
|
9d002de65a | ||
|
|
48ce2421a4 | ||
|
|
2d095063a3 | ||
|
|
dbacc3d352 | ||
|
|
49489bda89 | ||
|
|
5260df4e2d | ||
|
|
a2efb1abd8 | ||
|
|
006b5a7f58 | ||
|
|
5720b56dea | ||
|
|
e0f10db484 | ||
|
|
25b14c9c21 | ||
|
|
e069c33633 | ||
|
|
7dafb0f32a |
No files matched your search
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: Bug report/Support request
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Please generate a diagnostics report and upload the "diagnostics.log".
|
||||||
|
|
||||||
|
https://github.com/erew123/alltalk_tts/tree/main?#-how-to-make-a-diagnostics-report-file
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behaviour:
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Text/logs**
|
||||||
|
If applicable, copy/paste in your logs here from the console.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
AllTalk was updated: [approx. date]
|
||||||
|
Custom Python environment: [yes/no give details if yes]
|
||||||
|
Text-generation-webUI was updated: [approx. date]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
+8
-160
@@ -1,160 +1,8 @@
|
|||||||
# Byte-compiled / optimized / DLL files
|
voices/*.*
|
||||||
__pycache__/
|
models/*.*
|
||||||
*.py[cod]
|
outputs/*.*
|
||||||
*$py.class
|
finetune/*.*
|
||||||
|
config.json
|
||||||
# C extensions
|
confignew.json
|
||||||
*.so
|
models.json
|
||||||
|
diagnostics.log
|
||||||
# Distribution / packaging
|
|
||||||
.Python
|
|
||||||
build/
|
|
||||||
develop-eggs/
|
|
||||||
dist/
|
|
||||||
downloads/
|
|
||||||
eggs/
|
|
||||||
.eggs/
|
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
parts/
|
|
||||||
sdist/
|
|
||||||
var/
|
|
||||||
wheels/
|
|
||||||
share/python-wheels/
|
|
||||||
*.egg-info/
|
|
||||||
.installed.cfg
|
|
||||||
*.egg
|
|
||||||
MANIFEST
|
|
||||||
|
|
||||||
# PyInstaller
|
|
||||||
# Usually these files are written by a python script from a template
|
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
||||||
*.manifest
|
|
||||||
*.spec
|
|
||||||
|
|
||||||
# Installer logs
|
|
||||||
pip-log.txt
|
|
||||||
pip-delete-this-directory.txt
|
|
||||||
|
|
||||||
# Unit test / coverage reports
|
|
||||||
htmlcov/
|
|
||||||
.tox/
|
|
||||||
.nox/
|
|
||||||
.coverage
|
|
||||||
.coverage.*
|
|
||||||
.cache
|
|
||||||
nosetests.xml
|
|
||||||
coverage.xml
|
|
||||||
*.cover
|
|
||||||
*.py,cover
|
|
||||||
.hypothesis/
|
|
||||||
.pytest_cache/
|
|
||||||
cover/
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
*.mo
|
|
||||||
*.pot
|
|
||||||
|
|
||||||
# Django stuff:
|
|
||||||
*.log
|
|
||||||
local_settings.py
|
|
||||||
db.sqlite3
|
|
||||||
db.sqlite3-journal
|
|
||||||
|
|
||||||
# Flask stuff:
|
|
||||||
instance/
|
|
||||||
.webassets-cache
|
|
||||||
|
|
||||||
# Scrapy stuff:
|
|
||||||
.scrapy
|
|
||||||
|
|
||||||
# Sphinx documentation
|
|
||||||
docs/_build/
|
|
||||||
|
|
||||||
# PyBuilder
|
|
||||||
.pybuilder/
|
|
||||||
target/
|
|
||||||
|
|
||||||
# Jupyter Notebook
|
|
||||||
.ipynb_checkpoints
|
|
||||||
|
|
||||||
# IPython
|
|
||||||
profile_default/
|
|
||||||
ipython_config.py
|
|
||||||
|
|
||||||
# pyenv
|
|
||||||
# For a library or package, you might want to ignore these files since the code is
|
|
||||||
# intended to run in multiple environments; otherwise, check them in:
|
|
||||||
# .python-version
|
|
||||||
|
|
||||||
# pipenv
|
|
||||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
||||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
||||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
||||||
# install all needed dependencies.
|
|
||||||
#Pipfile.lock
|
|
||||||
|
|
||||||
# poetry
|
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
||||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
||||||
# commonly ignored for libraries.
|
|
||||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
||||||
#poetry.lock
|
|
||||||
|
|
||||||
# pdm
|
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
||||||
#pdm.lock
|
|
||||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
||||||
# in version control.
|
|
||||||
# https://pdm.fming.dev/#use-with-ide
|
|
||||||
.pdm.toml
|
|
||||||
|
|
||||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
||||||
__pypackages__/
|
|
||||||
|
|
||||||
# Celery stuff
|
|
||||||
celerybeat-schedule
|
|
||||||
celerybeat.pid
|
|
||||||
|
|
||||||
# SageMath parsed files
|
|
||||||
*.sage.py
|
|
||||||
|
|
||||||
# Environments
|
|
||||||
.env
|
|
||||||
.venv
|
|
||||||
env/
|
|
||||||
venv/
|
|
||||||
ENV/
|
|
||||||
env.bak/
|
|
||||||
venv.bak/
|
|
||||||
|
|
||||||
# Spyder project settings
|
|
||||||
.spyderproject
|
|
||||||
.spyproject
|
|
||||||
|
|
||||||
# Rope project settings
|
|
||||||
.ropeproject
|
|
||||||
|
|
||||||
# mkdocs documentation
|
|
||||||
/site
|
|
||||||
|
|
||||||
# mypy
|
|
||||||
.mypy_cache/
|
|
||||||
.dmypy.json
|
|
||||||
dmypy.json
|
|
||||||
|
|
||||||
# Pyre type checker
|
|
||||||
.pyre/
|
|
||||||
|
|
||||||
# pytype static type analyzer
|
|
||||||
.pytype/
|
|
||||||
|
|
||||||
# Cython debug symbols
|
|
||||||
cython_debug/
|
|
||||||
|
|
||||||
# PyCharm
|
|
||||||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
||||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
||||||
#.idea/
|
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"*.html": "jinja-html"
|
||||||
|
},
|
||||||
|
"emmet.includeLanguages": {
|
||||||
|
"jinja-html": "html",
|
||||||
|
"jinja2": "html"
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,661 @@
|
|||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
@@ -2,146 +2,443 @@
|
|||||||
AllTalk is an updated version of the Coqui_tts extension for Text Generation web UI. Features include:
|
AllTalk is an updated version of the Coqui_tts extension for Text Generation web UI. Features include:
|
||||||
|
|
||||||
- **Custom Start-up Settings:** Adjust your default start-up settings. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
- **Custom Start-up Settings:** Adjust your default start-up settings. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
||||||
- **Narrarator:** Use different voices for main character and narration. [Example Narration](https://vocaroo.com/18fYWVxiQpk1)
|
- **Narrarator:** Use different voices for main character and narration. [Example Narration](https://vocaroo.com/18nrv7FR6wuA)
|
||||||
- **Low VRAM mode:** Improve generation performance if your VRAM is filled by your LLM. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
- **Low VRAM mode:** Great for people with small GPU memory or if your VRAM is filled by your LLM. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
||||||
- **DeepSpeed:** A 3-4x performance boost generating TTS. [DeepSpeed Windows/Linux Instructions](https://github.com/erew123/alltalk_tts?tab=readme-ov-file#deepspeed-installation-options) [Screenshot](https://github.com/erew123/alltalk_tts/assets/35898566/548619c8-5f1b-47d0-a73d-54d2fee3f3db)
|
- **DeepSpeed:** A 3-4x performance boost generating TTS. [DeepSpeed Windows/Linux Instructions](https://github.com/erew123/alltalk_tts?tab=readme-ov-file#deepspeed-installation-options) [Screenshot](https://github.com/erew123/alltalk_tts/assets/35898566/548619c8-5f1b-47d0-a73d-54d2fee3f3db)
|
||||||
- **Local/Custom models:** Use any of the XTTSv2 models (API Local and XTTSv2 Local).
|
- **Local/Custom models:** Use any of the XTTSv2 models (API Local and XTTSv2 Local).
|
||||||
- **Optional wav file maintenance:** Configurable deletion of old output wav files. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
- **Optional wav file maintenance:** Configurable deletion of old output wav files. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
||||||
|
- **Finetuning** Train the model specifically on a voice of your choosing for better reproduction.
|
||||||
- **Documentation:** Fully documented with a built in webpage. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
- **Documentation:** Fully documented with a built in webpage. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
|
||||||
- **Console output** Clear command line output for any warnings or issues.
|
- **Console output** Clear command line output for any warnings or issues.
|
||||||
- **Standalone/3rd Party support via JSON calls** Can be used with 3rd party applications via JSON calls.
|
- **API Suite and 3rd Party support via JSON calls** Can be used with 3rd party applications via JSON calls.
|
||||||
|
- **Can be run as a standalone app** Not just inside of text-generation-webui.
|
||||||
|
|
||||||
#### Updates
|
## Index
|
||||||
The latest build (13 Dec 2023) has had the entire text filtering engine and narration engine rebuilt from scratch. It's highly complicated how its actually working, but the end result it a much clearer TTS output and much better control over the narrator option and how to handle text that isnt within quotes or asterisks. Its a highly recommened update, for the improved quality it gives to the TTS output, if nothing else.
|
|
||||||
|
|
||||||
Should you want the older version of the narrator engine+text filtering, I will leave this older copy [here](https://github.com/erew123/alltalk_tts/releases/tag/v1-old-narrator)
|
- 🟩 [Installation](https://github.com/erew123/alltalk_tts?#-installation-on-text-generation-web-ui)
|
||||||
|
- 🟪 [Updating & problems with updating](https://github.com/erew123/alltalk_tts?#-updating)
|
||||||
|
- 🟫 [Screenshots](https://github.com/erew123/alltalk_tts#-screenshots)
|
||||||
|
- 🟨 [Help with problems](https://github.com/erew123/alltalk_tts?#-help-with-problems)
|
||||||
|
- ⚫ [Finetuning a model](https://github.com/erew123/alltalk_tts?#-finetuning-a-model)
|
||||||
|
- 🔵🟢🟡 [DeepSpeed Installation (Windows & Linux)](https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options)
|
||||||
|
- 🟦 [Running AllTalk as a standalone app](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app)
|
||||||
|
- 🟠 [API Suite and JSON-CURL](https://github.com/erew123/alltalk_tts?#-api-suite-and-json-curl)
|
||||||
|
- 🔴 [Future to-do list & Upcoming updates](https://github.com/erew123/alltalk_tts?#-future-to-do-list)
|
||||||
|
|
||||||
DeepSpeed **v11.2** can be installed within the **default text-generation-webui Python 3.11 environment**. Instructions [here](https://github.com/erew123/alltalk_tts#deepspeed-112-for-windows--python-311) (or scroll down). Please note, this is **not** an official Microsoft method (currently) so they will not support you with this style installation. Officially, only DeepSpeed v8.3 is installing on Python 3.9.x.
|
## 🔄 Updates
|
||||||
|
Please check the below link to find a list of all recent updates and changes.
|
||||||
#### The one thing I cant easily work around
|
#### 🔄 **Updates list & bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
|
||||||
With a RP chat with your AI, **on your character card** `parameters menu` > `character tab` > `greeting` make sure that anything in there that is the **narrator is in asterisks** and anything **spoken is in double quotes**, then hit the `save` (disk) button. Greeting paragraphs/sentences are handled differently from how the AI sends text and so its difficut to account for them both.
|
|
||||||
|
|
||||||
I could force a delimeter in at this stage, but I know it would/may affect things further down the line in the chat and I need a good think about that before just making a change. This issue **only** affects the greeting card/start of conversation and the "example" card that comes with text-generation-webui suffers this issue (if you want to try it for yourself). So you would put double quotes around like this (from the example card):
|
|
||||||
|
|
||||||
`"`Hey! I'm so excited to finally meet you. I've heard so many great things about you and I'm eager to pick your brain about computers. I'm sure you have a wealth of knowledge that I can learn from.`"`
|
|
||||||
|
|
||||||
## 🟩 Installation on Text generation web UI
|
## 🟩 Installation on Text generation web UI
|
||||||
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, instructions [here](https://github.com/oobabooga/text-generation-webui#getting-updates)
|
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
|
||||||
|
|
||||||
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:
|
If you want to watch a video of how to do the below [link here](https://youtu.be/9BPKuwaav5w)
|
||||||
|
|
||||||
|
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:<br><br>
|
||||||
`cd text-generation-webui`
|
`cd text-generation-webui`
|
||||||
|
|
||||||
2) Start the Text generation webUI Python environment for your OS:
|
2) Start the Text generation webUI Python environment for your OS with whichever **one** of the below is correct for your OS:<br><br>
|
||||||
|
`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`<br><br> Loading Text-generation-webui's Python Environment is $\textcolor{red}{\textsf{VERY IMPORTANT}}$. If you are uncertain what a loaded Python environment looks like, image [here](https://github.com/erew123/alltalk_tts/issues/25#issuecomment-1869344442) and video [here](https://www.youtube.com/watch?v=9BPKuwaav5w)
|
||||||
`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`
|
|
||||||
|
|
||||||
3) Move into your extensions folder:
|
|
||||||
|
|
||||||
|
3) Move into your extensions folder:<br><br>
|
||||||
`cd extensions`
|
`cd extensions`
|
||||||
|
|
||||||
4) Once there git clone this repository:
|
4) Once there git clone this repository:<br><br>
|
||||||
|
|
||||||
`git clone https://github.com/erew123/alltalk_tts`
|
`git clone https://github.com/erew123/alltalk_tts`
|
||||||
|
|
||||||
5) Move into the **alltalk_tts** folder:
|
5) Move into the **alltalk_tts** folder:<br><br>
|
||||||
|
|
||||||
`cd alltalk_tts`
|
`cd alltalk_tts`
|
||||||
|
|
||||||
6) Install the requirements:
|
6) Install one of the two requirements files. Whichever one of the two is correct for your machine type:<br><br>
|
||||||
|
**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`<br><br>
|
||||||
|
**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`
|
||||||
|
|
||||||
*Nvidia graphics card machines* - `pip install -r requirements_nvidia.txt`
|
7) **(Optional DeepSpeed)** If you have an Nvidia Graphics card on a system running Linux or Windows and wish to use **DeepSpeed** please follow these instructions [here](https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options). **However**, I would highly reccommend before you install DeepSpeed, you start text-generation-webui up, confirm AllTalk starts correctly and everything is working, as DeepSpeed can add another layer of complications troubleshooting any potential start-up issues. If necessary you can `pip uninstall deepspeed`.
|
||||||
|
|
||||||
*Other machines (mac, amd etc)* - `pip install -r requirements_other.txt`
|
8) You can now start move back to the main Text generation webUI folder `cd ..` (a few times), start Text generation webUI with whichever **one** of the startup scripts is correct for your OS (`start_windows.bat`,`./start_linux.sh`, `start_macos.sh` or `start_wsl.bat`) and load the AllTalk extension in the Text generation webUI **session** tab.<br><br> Starting Text-generation-webui with its correct start-up script is $\textcolor{red}{\textsf{VERY IMPORTANT}}$.
|
||||||
|
|
||||||
7) You can now start move back to the main Text generation webUI folder `cd ..` (a few times), start Text generation webUI (`start_windows.bat`,`./start_linux.sh`, `start_macos.sh` or `start_wsl.bat`) and load the AllTalk extension in the Text generation webUI **session** tab.
|
|
||||||
|
|
||||||
8) Please read the note below about start-up times and also the note above about ensuring your character cards are set up [correctly](https://github.com/erew123/alltalk_tts#the-one-thing-i-cant-easily-work-around)
|
10) Please read the note below about start-up times and also the note about ensuring your character cards are set up [correctly](https://github.com/erew123/alltalk_tts#the-one-thing-i-cant-easily-work-around)
|
||||||
|
|
||||||
9) Some extra voices downloadable [here](https://drive.google.com/file/d/1bYdZdr3L69kmzUN3vSiqZmLRD7-A3M47/view?usp=drive_link)
|
11) Some extra voices downloadable [here](https://drive.google.com/file/d/1bYdZdr3L69kmzUN3vSiqZmLRD7-A3M47/view?usp=drive_link)
|
||||||
|
|
||||||
**Note: It can take a while to start up.** Check the command prompt/terminal window if you want to know what its doing. After it says "Model Loaded" the Text generation webUI is usually available on its IP address a few seconds later, for you to connect to in your browser.
|
#### 🟩 Other installation notes
|
||||||
|
On first startup, AllTalk will download the Coqui XTTSv2 2.0.2 model to its **models** folder (1.8GB space required). Check the command prompt/terminal window if you want to know what its doing. After it says "Model Loaded" the Text generation webUI is usually available on its IP address a few seconds later, for you to connect to in your browser.
|
||||||
**Documentation:** Click on the link when inside Text generation webUI as shown in the screenshot [here](https://github.com/erew123/alltalk_tts#screenshots)
|
|
||||||
|
|
||||||
**Where to find voices** https://aiartes.com/voiceai or https://commons.wikimedia.org/ or interviews on youtube etc. Instructions on how to cut down and prepare a voice sample are within the built in documentation.
|
|
||||||
|
|
||||||
### 🟩 Other installation notes
|
|
||||||
On first startup, AllTalk will download the Coqui XTTSv2 2.0.2 model to its **models** folder (1.8GB space required). You can customse your model or use the TTS latest model within the interface (details in documentation).
|
|
||||||
|
|
||||||
Once the extension is loaded, please find all documentation and settings on the link provided in the interface (as shown in the screenshot below).
|
Once the extension is loaded, please find all documentation and settings on the link provided in the interface (as shown in the screenshot below).
|
||||||
|
|
||||||
To start AllTalk every Text generation webUI loads, edit the Text generation webUI `CMD_FLAGS.txt` file in the main `text-generation-webui` folder and add `--extensions alltalk_tts`.
|
**Where to find voices** https://aiartes.com/voiceai or https://commons.wikimedia.org/ or interviews on youtube etc. Instructions on how to cut down and prepare a voice sample are within the built in documentation.
|
||||||
|
|
||||||
## Screenshots
|
#### 🟩 The one thing I cant easily work around
|
||||||
| |  |
|
Messages intended for the Narrator should be enclosed in asterisks `*` and those for the character inside quotation marks `"`. However, AI systems often deviate from these rules, resulting in text that is neither in quotes nor asterisks. Sometimes, text may appear with only a single asterisk, and AI models may vary their formatting mid-conversation. For example, they might use asterisks initially and then switch to unmarked text. A properly formatted line should look like this:
|
||||||
|
|
||||||
|
`"`Hey! I'm so excited to finally meet you. I've heard so many great things about you and I'm eager to pick your brain about computers.`"` `*`She walked across the room and picked up her cup of coffee`*`
|
||||||
|
|
||||||
|
Most narrator/character systems switch voices upon encountering an asterisk or quotation marks, which is somewhat effective. AllTalk has undergone several revisions in its sentence splitting and identification methods. While some irregularities and AI deviations in message formatting are inevitable, any line beginning or ending with an asterisk should now be recognized as Narrator dialogue. Lines enclosed in double quotes are identified as Character dialogue. For any other text, you can choose how AllTalk handles it: whether it should be interpreted as Character or Narrator dialogue (most AI systems tend to lean more towards one format when generating text not enclosed in quotes or asterisks).
|
||||||
|
|
||||||
|
With improvements to the splitter/processor, I'm confident it's functioning well. You can monitor what AllTalk identifies as Narrator lines on the command line and adjust its behavior if needed (Text Not Inside - Function).
|
||||||
|
|
||||||
|
## 🟪 Updating
|
||||||
|
This is pretty much a repeat of the installation process.
|
||||||
|
|
||||||
|
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:<br><br>
|
||||||
|
`cd text-generation-webui` and start the Python environment for your OS with whichever **one** of the below is correct for your OS:<br><br>
|
||||||
|
`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`<br>
|
||||||
|
|
||||||
|
2) Move into your extensions and alltalk_tts folder:<br><br>
|
||||||
|
`cd extensions` then `cd alltalk_tts`
|
||||||
|
|
||||||
|
3) At the command prompt/terminal, type:<br><br>
|
||||||
|
`git pull`
|
||||||
|
|
||||||
|
4) Install the correct requirements for your machine:<br><br>
|
||||||
|
**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`<br><br>
|
||||||
|
**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`
|
||||||
|
|
||||||
|
#### 🟪 Updating "git pull" error
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
I did leave a mistake in the `/extensions/alltalk_tts/.gitignore` file at one point. If your `git pull` doesnt work, you can either follow the Problems Updating section below, or edit the `.gitignore` file and **replace its entire contents** with the below, save the file, then re-try the `git pull`<br><br>
|
||||||
|
```
|
||||||
|
voices/*.*
|
||||||
|
models/*.*
|
||||||
|
outputs/*.*
|
||||||
|
finetune/*.*
|
||||||
|
config.json
|
||||||
|
confignew.json
|
||||||
|
models.json
|
||||||
|
diagnostics.log
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### 🟪 Updating other problems
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
If you do experience any problems, the simplest method to resolve this will be:
|
||||||
|
|
||||||
|
1) re-name the existing `alltalk_tts` folder to something like `alltalk_tts.old`
|
||||||
|
|
||||||
|
2) Start a console/terminal then:<br><br>
|
||||||
|
`cd text-generation-webui` and start your python environment `cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`
|
||||||
|
|
||||||
|
3) Move into the extensions folder, same as if you were doing a fresh installation:<br><br>
|
||||||
|
`cd extensions` then<br><br>
|
||||||
|
`git clone https://github.com/erew123/alltalk_tts`
|
||||||
|
|
||||||
|
This will download a fresh installation.
|
||||||
|
|
||||||
|
3) Move into the **alltalk_tts** folder:<br><br>
|
||||||
|
`cd alltalk_tts`
|
||||||
|
|
||||||
|
4) Install the correct requirements for your machine:<br><br>
|
||||||
|
**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`<br><br>
|
||||||
|
**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`
|
||||||
|
|
||||||
|
5) Before starting it up, copy/merge the `models`, `voices` and `outputs` folders over from the `alltalk_tts.old` folder to the newly created `alltalk_tts` folder. This will keep your voices history and also stop it re-downloading the model again.
|
||||||
|
|
||||||
|
You can now start text-generation-webui or AllTalk (standalone) and it should start up fine. You will need to re-set any saved configuration changes on the configuration page.
|
||||||
|
|
||||||
|
Assuming its all working fine and you are happy, you can delete the old alltalk_tts.old folder.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## 🟫 Screenshots
|
||||||
|
| |  |
|
||||||
|:---:|:---:|
|
|:---:|:---:|
|
||||||
| |  |
|
| |  |
|
||||||
|
| |  |
|
||||||
|
|
||||||
## DeepSpeed Installation Options
|
## 🟨 Help with problems
|
||||||
|
#### 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
|
||||||
|
|
||||||
### 🔵 For Linux
|
#### 🟨 How to make a diagnostics report file
|
||||||
Covered in the online/buit-in documentation, but a nice easy install.
|
<details>
|
||||||
|
<summary>Click to expand</summary>
|
||||||
|
|
||||||
|
1) Open a command prompt window, move into your **text-generation-webui** folder, you can now start the Python environment for text-generation-webui:<br><br>
|
||||||
|
`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`
|
||||||
|
|
||||||
### 🟢🟡 For Windows & Python 3.11
|
2) Move into the **alltalk_tts** folder:<br><br>
|
||||||
DeepSpeed v11.1 and v11.2 will work on the current text-generation-webui Python 3.11 environment! You have 2x options for how to setup DeepSpeed on Windows. A quick way (🟢Option 1) and a long way (🟡Option 2).
|
`cd extensions` and then `cd alltalk_tts`
|
||||||
|
|
||||||
|
3) Run the diagnostics and select the requirements file name you installed AllTalk with:<br><br>
|
||||||
|
`python diagnostics.py`
|
||||||
|
|
||||||
|
4) You will have an on screen output showing your environment setttings, file versions request vs whats installed and details of your graphics card (if Nvidia). This will also create a file called `diagnostics.log` in the `alltalk_tts` folder, that you can upload if you need to create a support ticket on here.<br><br>
|
||||||
|
|
||||||
|

|
||||||
|
<br><br></details>
|
||||||
|
|
||||||
|
|
||||||
|
#### 🟨 [AllTalk Startup] Warning TTS Subprocess has NOT started up yet, Will keep trying for 120 seconds maximum. Please wait. It times out after 120 seconds.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
When the subprocess is starting 2x things are occurring:<br><br>
|
||||||
|
|
||||||
|
**A)** Its trying to load the voice model into your graphics card VRAM (assuming you have a Nvidia Graphics card, otherwise its your system RAM)<br>
|
||||||
|
**B)** Its trying to start up the mini-webserver and send the "ready" signal back to the main process.
|
||||||
|
|
||||||
|
Before giving other possibilities a go, some people with **old machines** are finding their startup times are **very** slow 2-3 minutes. Ive extended the allowed time within the script from 1 minute to 2 minutes. **If you have an older machine** and wish to try extending this further, you can do so by editing `script.py` and changing line 251 `timeout = 120` changing the timeout to a larger value e.g `timeout = 240` (4 minutes).
|
||||||
|
|
||||||
|
**Note:** If you need to create a support ticket, please create a `diagnostics.log` report file to submit with a support request. Details on doing this are above.
|
||||||
|
|
||||||
|
Other possibilities for this issue are:
|
||||||
|
|
||||||
|
1) You are starting AllTalk in both your `CMD FLAG.txt` and `settings.yaml` file. The `CMD FLAG.txt` you would have manually edited and the `settings.yaml` is the one you change and save in the `session` tab of text-generation-webui and you can `Save UI defaults to settings.yaml`. Please only have one of those two starting up AllTalk.
|
||||||
|
|
||||||
|
2) You are not starting text-generation-webui with its normal Python environment. Please start it with start_{your OS version} as detailed [here](https://github.com/oobabooga/text-generation-webui#how-to-install) (`start_windows.bat`,`./start_linux.sh`, `start_macos.sh` or `start_wsl.bat`) OR (`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat` and then `python server.py`).
|
||||||
|
|
||||||
|
3) You have installed the wrong version of DeepSpeed on your system, for the wrong version of Python/Text-generation-webui. You can go to your text-generation-webui folder in a terminal/command prompt and run the correct cmd version for your OS e.g. (`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`) and then you can type `pip uninstall deepspeed` then try loading it again. If that works, please see here for the correct instructions for installing DeepSpeed [here](https://github.com/erew123/alltalk_tts#-deepspeed-installation-options).
|
||||||
|
|
||||||
|
4) You have an old version of text-generation-webui (pre Dec 2023) I have not tested on older versions of text-generation-webui, so cannot confirm viability on older versions. For instructions on updating the text-generation-webui, please look [here](https://github.com/oobabooga/text-generation-webui#how-to-install) (`update_linux.sh`, `update_windows.bat`, `update_macos.sh`, or `update_wsl.bat`).
|
||||||
|
|
||||||
|
5) You already have something running on port 7851 on your computer, so the mini-webserver cant start on that port. You can change this port number by editing the `confignew.json` file and changing `"port_number": "7851"` to `"port_number": "7602"` or any port number you wish that isn’t reserved. Only change the number and save the file, do not change the formatting of the document. This will at least discount that you have something else clashing on the same port number.
|
||||||
|
|
||||||
|
6) You have antivirus/firewalling that is blocking that port from being accessed. If you had to do something to allow text-generation-webui through your antivirus/firewall, you will have to do that for this too.
|
||||||
|
|
||||||
|
7) You have quite old graphics drivers and may need to update them.
|
||||||
|
|
||||||
|
8) Something within text-generation-webui is not playing nicely for some reason. You can go to your text-generation-webui folder in a terminal/command prompt and run the correct cmd version for your OS e.g. (`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`) and then you can type `python extensions\alltalk_tts\script.py` and see if AllTalk starts up correctly. If it does then something else is interfering.
|
||||||
|
|
||||||
|
9) Something else is already loaded into your VRAM or there is a crashed python process. Either check your task manager for erroneous Python processes or restart your machine and try again.
|
||||||
|
|
||||||
|
10) You are running DeepSpeed on a Linux machine and although you are starting with `./start_linux.sh` AllTalk is failing there on starting. This is because text-generation-webui will overwrite some environment variables when it loads its python environment. To see if this is the problem, from a terminal go into your text-generation-webui folder and `./cmd_linux.sh` then set your environment variable again e.g. `export CUDA_HOME=/usr/local/cuda` (this may vary depending on your OS, but this is the standard one for Linux, and assuming you have installed the CUDA toolkit), then `python server.py` and see if it starts up. If you want to edit the environment permanently you can do so, I have not managed to write full instructions yet, but here is the conda guide [here](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#set-env-vars).
|
||||||
|
|
||||||
|
11) You have built yourself a custom Python environment and something is funky with it. This is very hard to diagnose as its not a standard environment. You may want to updating text-generation-webui and re installing its requirements file (whichever one you use that comes down with text-generation-webui).
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### 🟨 I think AllTalks requirements file has installed something another extension doesn't like
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
Ive paid very close attention to **not** impact what Text-generation-webui is requesting on a factory install. This is one of the requirements of submitting an extension to Text-generation-webui. If you want to look at a comparison of a factory fresh text-generation-webui installed packages (with cuda 12.1, though AllTalk's requirements were set on cuda 11.8) you can find that comparison [here](https://github.com/erew123/alltalk_tts/issues/23). This comparison shows that AllTalk is requesting the same package version numbers as Text-generation-webui or even lower version numbers (meaning AllTalk will not update them to a later version). What other extensions do, I cant really account for that.
|
||||||
|
|
||||||
|
I will note that the TTS engine downgrades Pandas data validator to 1.5.3 though its unlikely to cause any issues. You can upgrade it back to text-generation-webui default (december 2023) with `pip install pandas==2.1.4` when inside of the python environment. I have noticed no ill effects from it being a lower or higher version, as far as AllTalk goes. This is also the same behaviour as the Coqui_tts extension that comes with Text-generation-webui.
|
||||||
|
|
||||||
|
Other people are reporting issues with extensions not starting with errors about Pydantic e.g. ```pydantic.errors.PydanticImportError: BaseSettings` has been moved to the pydantic-settings package. See https://docs.pydantic.dev/2.5/migration/#basesettings-has-moved-to-pydantic-settings for more details.```
|
||||||
|
|
||||||
|
Im not sure if the Pydantic version has been recently updated by the Text-generation-webui installer, but this is nothing to do with AllTalk. The other extension you are having an issue with, need to be updated to work with Pydantic 2.5.x. AllTalk was updated in mid december to work with 2.5.x. I am not specifically condoning doing this, as it may have other knock on effects, but within the text-gen Python environment, you can use `pip install pydantic==2.5.0` or `pip install pydantic==1.10.13` to change the version of Pydantic installed.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### 🟨 I activated DeepSpeed in the settings page, but I didnt install DeepSpeed yet and now I have issues starting up
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
You can either follow the [Problems Updating](https://github.com/erew123/alltalk_tts#-problems-updating) and fresh install your config. Or you can edit the `confignew.json` file within the `alltalk_tts` folder. You would look for '"deepspeed_activate": true,' and change the word true to false `"deepspeed_activate": false,' ,then save the file and try starting again.<br><br>
|
||||||
|
|
||||||
|
If you want to use DeepSpeed, you need an Nvidia Graphics card and to install DeepSpeed on your system. Instructions are [here](https://github.com/erew123/alltalk_tts#-deepspeed-installation-options)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### 🟨 I am having problems updating/some other issue where it wont start up/Im sure this is a bug
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
Please see [Problems Updating](https://github.com/erew123/alltalk_tts#-problems-updating). If that doesnt help you can raise an ticket [here](https://github.com/erew123/alltalk_tts/issues). It would be handy to have any log files from the console where your error is being shown. I can only losely support custom built Python environments and give general pointers. Please create a `diagnostics.log` report file to submit with a support request.<br><br>
|
||||||
|
|
||||||
|
Also, is your text-generation-webui up to date? [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### 🟨 I am having problems getting AllTalk to start after changing settings or making a custom setup/model setup.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
I would suggest following [Problems Updating](https://github.com/erew123/alltalk_tts#-problems-updating) and if you still have issues after that, you can raise an issue [here](https://github.com/erew123/alltalk_tts/issues)
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### 🟨 I see some red "asyncio" messages
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
As far as I am aware, these are to do with the chrome browser the gradio text-generation-webui in some way. I raised an issue about this on the text-generation-webui [here](https://github.com/oobabooga/text-generation-webui/issues/4788) where you can see that AllTalk is not loaded and the messages persist. Either way, this is more a warning than an actual issue, so shouldnt affect any functionality of either AllTalk or text-generation-webui, they are more just an annoyance.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### 🟨 I have multiple GPU's and I have problems running Finetuning
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand</summary><br>
|
||||||
|
|
||||||
|
Finetuning pulls in various other scripts and some of those scripts can have issues with multiple Nvidia GPU's being present. Until the people that created those other scripts fix up their code, there is a workaround to temporarily tell your system to only use the 1x of your Nvidia GPU's. To do this:
|
||||||
|
|
||||||
|
- **Windows** - You will start the script with `set CUDA_VISIBLE_DEVICES=0 && python finetune.py`<br>
|
||||||
|
After you have completed training, you can reset back with `set CUDA_VISIBLE_DEVICES=`<br>
|
||||||
|
|
||||||
|
- **Linux** - You will start the script with `CUDA_VISIBLE_DEVICES=0 python finetune.py`<br>
|
||||||
|
After you have completed training, you can reset back with `unset CUDA_VISIBLE_DEVICES`<br>
|
||||||
|
|
||||||
|
Rebooting your system will also unset this. The setting is only applied temporarily.
|
||||||
|
|
||||||
|
Depending on which of your Nvidia GPU's is the more powerful one, you can change the `0` to `1` or whichever of your GPU's is the most powerful.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## ⚫ Finetuning a model
|
||||||
|
If you have a voice that the model doesnt quite reproduce correctly, or indeed you just want to improve the reproduced voice, then finetuning is a way to train your "XTTSv2 local" model **(stored in `/alltalk_tts/models/xxxxx/`)** on a specific voice. For this you will need:
|
||||||
|
|
||||||
|
- An Nvidia graphics card. (Please see this [note](https://github.com/erew123/alltalk_tts#-i-have-multiple-gpus-and-i-have-problems-running-finetuning) if you have multiple Nvidia GPU's).
|
||||||
|
- To install a few portions of the Nvidia CUDA 11.8 Toolkit (this will not impact text-generation-webui's cuda setup.
|
||||||
|
- 18GB of disk space free (most of this is used temporarily)
|
||||||
|
- At least 2 minutes of good quality speech from your chosen speaker in mp3, wav or flacc format, in one or more files (have tested as far as 20 minutes worth of audio).
|
||||||
|
|
||||||
|
#### ⚫ How will this work/How complicated is it?
|
||||||
|
Everything has been done to make this as simple as possible. At its simplest, you can literally just download a large chunk of audio from an interview, and tell the finetuning to strip through it, find spoken parts and build your dataset. You can literally click 4 buttons, then copy a few files and you are done. At it's more complicated end you will clean up the audio a little beforehand, but its still only 4x buttons and copying a few files.
|
||||||
|
|
||||||
|
#### ⚫ The audio you will use
|
||||||
|
I would suggest that if its in an interview format, you cut out the interviewer speaking in audacity or your chosen audio editing package. You dont have to worry about being perfect with your cuts, the finetuning Step 1 will go and find spoken audio and cut it out for you. Is there is music over the spoken parts, for best quality you would cut out those parts, though its not 100% necessary. As always, try to avoid bad quality audio with noises in it (humming sounds, hiss etc). You can try something like [Audioenhancer](https://audioenhancer.ai/) to try clean up noisier audio. There is no need to down-sample any of the audio, all of that is handled for you. Just give the finetuning some good quality audio to work with.
|
||||||
|
|
||||||
|
#### ⚫ Important requirements CUDA 11.8
|
||||||
|
As mentioned you must have a small portion of the Nvidia CUDA Toolkit **11.8** installed. Not higher or lower versions. Specifically **11.8**. You do not have to uninstall any other versions, change any graphics drivers, reinstall torch or anything like that. To keep the download+install as small as possible, you will need to:
|
||||||
|
- Download the **xxx (network)** install of the Nvidia Cuda Toolkit 11.8 from [here](https://developer.nvidia.com/cuda-11-8-0-download-archive)
|
||||||
|
- Run the installer. At minimum, you need to [minimally] install the `nvcc` compiler and the `CUBLAS` development and runtime libraries:
|
||||||
|
- Select **Custom Advanced** as your installation type.
|
||||||
|
- Uncheck all the checkboxes in the list.
|
||||||
|
- Now check the following elements:
|
||||||
|
- `CUDA` > `Development` > `Compiler` > `nvcc`
|
||||||
|
- `CUDA` > `Development` > `Compiler` > `Libraries` > `CUBLAS`
|
||||||
|
- `CUDA` > `Runtime` > `Libraries` > `CUBLAS`
|
||||||
|
- You can now proceed through the install.
|
||||||
|
- When that has installed, open a terminal/command prompt and type `nvcc --version`. If it reports back `Cuda compilation tools, release 11.8.` you are good to go. **Specifically, 11.8**. If not continue to the next step.
|
||||||
|
- For both Windows and Linux, you need to ensure that `nvcc` and the 11.8 cuda library files are in your environments search path. You can undo the changes below after finetuning if you prefer:
|
||||||
|
- **Windows**: Edit the Windows `Path` environment variable and add `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin`
|
||||||
|
- **Linux**: The path may be different depending on what flavour of Linux you are running, so you may need to seek out specific instructions on the internet. Generic paths **may** be:
|
||||||
|
- `export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}` and
|
||||||
|
- `export LD_LIBRARY_PATH=/usr/local/cuda-11.8/bin`
|
||||||
|
- Add these to your '~/.bashrc' if you want this to be permanent and not something you have to set each time you open a new terminal.
|
||||||
|
- When you have made the changes, open a **new** terminal/command prompt (in order to load the new search paths) and `nvcc --version`. It should report back `Cuda compilation tools, release 11.8.` at which point, you are good to go.
|
||||||
|
- If it doesn't report that, check you have correctly set the search environment paths, dont have overlapping other versions of cuda paths etc.
|
||||||
|
|
||||||
|
#### ⚫ Starting Finetuning
|
||||||
|
**NOTE:** Please make sure you have started AllTalk at least once after updating, so that it downloads the additional files needed for finetuning.
|
||||||
|
|
||||||
|
1) Close all other applications that are using your GPU/VRAM and copy your audio samples into:<br><br>
|
||||||
|
`/alltalk_tts/finetune/put-voice-samples-in-here/`
|
||||||
|
3) In a command prompt/terminal window you need to move into your Text generation webUI folder:<br><br>
|
||||||
|
`cd text-generation-webui`
|
||||||
|
|
||||||
|
4) Start the Text generation webUI Python environment for your OS:<br><br>
|
||||||
|
`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`
|
||||||
|
|
||||||
|
5) You can double check your search path environment still works correctly with `nvcc --version`. It should report back 11.8:<br><br>
|
||||||
|
`Cuda compilation tools, release 11.8.`
|
||||||
|
|
||||||
|
7) Move into your extensions folder:<br><br>
|
||||||
|
`cd extensions`
|
||||||
|
|
||||||
|
8) Move into the **alltalk_tts** folder:<br><br>
|
||||||
|
`cd alltalk_tts`
|
||||||
|
|
||||||
|
9) Install the finetune requirements file: `pip install -r requirements_finetune.txt`
|
||||||
|
|
||||||
|
10) Type `python finetune.py` and it should start up.
|
||||||
|
11) Follow the on-screen instructions when the web interface starts up.
|
||||||
|
12) When you have finished finetuning, the final tab will tell you what to do with your files and how to move your newly trained model to the correct location on disk.
|
||||||
|
|
||||||
|
#### ⚫ Using a Finetuned model in Text-generation-webui
|
||||||
|
|
||||||
|
At the end of the finetune process, you will have an option to `Compact and move model to /trainedmodel/` this will compact the raw training file and move it to `/model/trainedmodel/`. When AllTalk starts up within Text-generation-webui, if it finds a model in this location a new loader will appear in the interface for `XTTSv2 FT` and you can use this to load your finetuned model. <br><br>**Be careful** not to train a new model from the base model, then overwrite your current `/model/trainedmodel/` **if** you want a seperately trained model. This is why there is an `OPTION B` to move your just trained model to `/models/lastfinetuned/`.
|
||||||
|
|
||||||
|
#### ⚫ Training one model with multiple voices
|
||||||
|
|
||||||
|
At the end of the finetune process, you will have an option to `Compact and move model to /trainedmodel/` this will compact the raw training file and move it to `/model/trainedmodel/`. This model will become available when you start up finetuning. You will have a choice to train the Base Model or the `Existing finetuned model` (which is the one in `/model/trainedmodel/`). So you can use this to keep further training this model with additional voices, then copying it back to `/model/trainedmodel/` at the end of training.
|
||||||
|
|
||||||
|
#### ⚫ Do I need to keep the raw training data/model?
|
||||||
|
|
||||||
|
If you've compacted and moved your model, its highly unlikely you would want to keep that data, however the choice is there to keep it if you wish. It will be between 5-10GB in size, so most people will want to delete it.
|
||||||
|
|
||||||
|
## 🔵🟢🟡 DeepSpeed Installation Options
|
||||||
|
**NOTE**: You **DO NOT** need to set Text-generation-webUI's **--deepspeed** setting for AllTalk to be able to use DeepSpeed. These are two completely separate things and incorrectly setting that on Text-generation-webUI may cause other complications.
|
||||||
|
|
||||||
|
#### 🔵 Linux Installation
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand: Linux DeepSpeed installation</summary>
|
||||||
|
|
||||||
|
➡️DeepSpeed requires an Nvidia Graphics card!⬅️
|
||||||
|
|
||||||
|
1) Preferably use your built in package manager to install CUDA tools. Alternatively download and install the Nvidia Cuda Toolkit for Linux [Nvidia Cuda Toolkit 11.8 or 12.1](https://developer.nvidia.com/cuda-toolkit-archive)<br><br>
|
||||||
|
2) Open a terminal console.<br><br>
|
||||||
|
3) Install libaio-dev (however your Linux version installs things) e.g. `sudo apt install libaio-dev`<br><br>
|
||||||
|
4) Move into your Text generation webUI folder e.g. `cd text-generation-webui`<br><br>
|
||||||
|
5) Start the Text generation webUI Python environment `./cmd_linux.sh`<br><br>
|
||||||
|
6) Text generation webUI **overwrites** the **CUDA_HOME** environment variable each time you `./cmd_linux.sh` or `./start_linux.sh`, so you will need to either permanently change within the python environment OR set CUDA_HOME it each time you `./cmd_linux.sh`. Details to change it each time are on the next step. Below is a link to Conda's manual and changing environment variables permanently though its possible changing it permanently could affect other extensions, you would have to test.<br> <br>
|
||||||
|
[Conda manual - Environment variables](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#set-env-vars)<br><br>
|
||||||
|
7) You can temporarily set the **CUDA_HOME** environment with (Standard paths on Ubuntu, but could vary on other Linux flavours):<br><br>
|
||||||
|
`export CUDA_HOME=/etc/alternatives/cuda`<br><br>
|
||||||
|
**every** time you run `./cmd_linux.sh`.<br> <br>
|
||||||
|
If you try to start DeepSpeed with the CUDA_HOME path set incorrectly, expect an error similar to `[Errno 2] No such file or directory: /home/yourname/text-generation-webui/installer_files/env/bin/nvcc`<br> <br>
|
||||||
|
9) Now install deepspeed with pip install deepspeed<br><br>
|
||||||
|
10) You can now start Text generation webUI `python server.py` ensuring to activate your extensions.<br><br>
|
||||||
|
Just to reiterate, starting Text-generation-webUI with `./start_linux.sh` will overwrite the CUDA_HOME variable unless you have permanently changed it, hence always starting it with `./cmd_linux.sh` **then** setting the environment variable manually (step 7) and **then** `python server.py`, which is how you would need to run it each time, unless you permanently set the environment variable for CUDA_HOME within Text-generation-webUI's standard Python environment.
|
||||||
|
<br><br>
|
||||||
|
**Removal** - If it became necessary to uninstall DeepSpeed, you can do so with `./cmd_linux.sh` and then `pip uninstall deepspeed`<br><br>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### 🟢🟡 Windows Installation
|
||||||
|
DeepSpeed v11.2 will work on the current default text-generation-webui Python 3.11 environment! You have 2x options for how to setup DeepSpeed on Windows. A quick way (🟢Option 1) and a long way (🟡Option 2).
|
||||||
|
|
||||||
Thanks to [@S95Sedan](https://github.com/S95Sedan) - They managed to get DeepSpeed 11.2 working on Windows via making some edits to the original Microsoft DeepSpeed v11.2 installation. The original post is [here](https://github.com/oobabooga/text-generation-webui/issues/4734#issuecomment-1843984142).
|
Thanks to [@S95Sedan](https://github.com/S95Sedan) - They managed to get DeepSpeed 11.2 working on Windows via making some edits to the original Microsoft DeepSpeed v11.2 installation. The original post is [here](https://github.com/oobabooga/text-generation-webui/issues/4734#issuecomment-1843984142).
|
||||||
|
|
||||||
#### 🟢 OPTION 1 - Quick and easy!
|
#### 🟢 OPTION 1 - Quick and easy!
|
||||||
#### Pre-Compiled Wheel Deepspeed v11.1 (for Windows and Python 3.11)
|
<details>
|
||||||
[@S95Sedan](https://github.com/S95Sedan) has kindly provided a pre-compiled DeepSpeed v11.1 wheel file, which you can download and use. To use this, you will need to:
|
<summary>Click to expand: Pre-Compiled Wheel Deepspeed v11.2 (Python 3.11 and 3.10)</summary>
|
||||||
|
➡️DeepSpeed requires an Nvidia Graphics card!⬅️<br>
|
||||||
|
|
||||||
**Note:** In my tests, with this method you will **not** need to install the Nvidia CUDA toolkit to make this work, but AllTalk may warn you when starting DeepSpeed that it doesnt see the CUDA Toolkit, however, it works fine for TTS purposes.
|
1) Download the correct wheel version for your Python/Cuda from [here](https://github.com/erew123/alltalk_tts/releases/tag/deepspeed) and save the file it inside your **text-generation-webui** folder.
|
||||||
|
|
||||||
1) Download the file [deepspeed-0.11.1+e9503fe-cp311-cp311-win_amd64.whl](https://drive.google.com/file/d/1PFsf6uSPY5Cb4o9VxiZ7DLv-j35L7Y41/view?usp=sharing) by going to the link and clicking the **download** icon at the top right of the screen and save the file it inside your **text-generation-webui** folder.
|
|
||||||
|
|
||||||
2) Open a command prompt window, move into your **text-generation-webui folder**, you can now start the Python environment for text-generation-webui:
|
|
||||||
|
|
||||||
|
2) Open a command prompt window, move into your **text-generation-webui folder**, you can now start the Python environment for text-generation-webui:<br><br>
|
||||||
`cmd_windows.bat`
|
`cmd_windows.bat`
|
||||||
|
|
||||||
3) With the file that you saved in the **text-generation-webui folder** you now type the following:
|
3) With the file that you saved in the **text-generation-webui folder** you now type the following, replacing YOUR-VERSION with the name of the file you have:<br><br>
|
||||||
|
`pip install "deepspeed-0.11.2+YOUR-VERSION-win_amd64.whl"`
|
||||||
`pip install "deepspeed-0.11.1+e9503fe-cp311-cp311-win_amd64.whl"`
|
|
||||||
|
|
||||||
4) This should install through cleanly and you should now have DeepSpeed v11.1 installed within the Python 3.11 environment of text-generation-webui.
|
5) This should install through cleanly and you should now have DeepSpeed v11.2 installed within the Python 3.11/3.10 environment of text-generation-webui.
|
||||||
|
|
||||||
5) When you start up text-generation-webui, and AllTalk starts, you should see **[AllTalk Startup] DeepSpeed Detected**
|
6) When you start up text-generation-webui, and AllTalk starts, you should see **[AllTalk Startup] DeepSpeed Detected**
|
||||||
|
|
||||||
6) Within AllTalk, you will now have a checkbox for **Activate DeepSpeed** though remember you can only change **1x setting every 15 or so seconds**, so dont try to activate DeepSpeed **and** LowVRAM/Change your model simultantiously. Do one of those, wait 15-20 seconds until the change is confirmed in the terminal/command prompt, then you can change the other. When you are happy it works, you can set the default start-up settings in the settings page.
|
7) Within AllTalk, you will now have a checkbox for **Activate DeepSpeed** though remember you can only change **1x setting every 15 or so seconds**, so dont try to activate DeepSpeed **and** LowVRAM/Change your model simultantiously. Do one of those, wait 15-20 seconds until the change is confirmed in the terminal/command prompt, then you can change the other. When you are happy it works, you can set the default start-up settings in the settings page.
|
||||||
|
<br><br>
|
||||||
|
**Removal** - If it became necessary to uninstall DeepSpeed, you can do so with `cmd_windows.bat` and then `pip uninstall deepspeed`<br><br>
|
||||||
|
</details>
|
||||||
|
|
||||||
#### 🟡 OPTION 2 - A bit more complicated!
|
#### 🟡 OPTION 2 - A bit more complicated!
|
||||||
|
<details>
|
||||||
|
<summary>Click to expand: Manual Build DeepSpeed v11.2 (Python 3.11 and 3.10)</summary>
|
||||||
|
➡️DeepSpeed requires an Nvidia Graphics card!⬅️<br><br>
|
||||||
|
|
||||||
#### Manual Build DeepSpeed v11.2 (for Windows and Python 3.11)
|
This will take about 1 hour to complete and about 6GB of disk space.<br>
|
||||||
DeepSpeed Version 11.2 with CUDA 12.1 - Installation Instructions:
|
|
||||||
|
|
||||||
1. Download the 11.2 release of [DeepSpeed](https://github.com/microsoft/DeepSpeed/releases/tag/v0.11.2) extract it to a folder.
|
1. Download the 11.2 release of [DeepSpeed](https://github.com/microsoft/DeepSpeed/releases/tag/v0.11.2) extract it to a folder.
|
||||||
2. Install Visual C++ build tools, such as [VS2019 C++ x64/x86](https://learn.microsoft.com/en-us/visualstudio/releases/2019/redistribution#vs2019-download) build tools.
|
2. Install Visual C++ build tools, such as [VS2019 C++ x64/x86](https://learn.microsoft.com/en-us/visualstudio/releases/2019/redistribution#vs2019-download) build tools.
|
||||||
3. Download and install the [Nvidia Cuda Toolkit 12.1](https://developer.nvidia.com/cuda-12-1-0-download-archive)
|
3. Download and install the [Nvidia Cuda Toolkit 11.8 or 12.1](https://developer.nvidia.com/cuda-toolkit-archive)
|
||||||
4. Edit your Windows environment variables to ensure that CUDA_HOME and CUDA_PATH are set to your Nvidia Cuda Toolkit path. (The folder above the bin folder that nvcc.exe is installed in). Examples are:<br>
|
4. **OPTIONAL** If you do not have an python environment already created and you are **not** going to use Text-generation-webui's environment, you can install [Miniconda](https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html), then at a command prompt, create and activate your environment with:<br><br>
|
||||||
```set CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1```<br>
|
|
||||||
```set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1```<br>
|
|
||||||
|
|
||||||
5. OPTIONAL If you do not have an python environment already created, you can install [Miniconda](https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html), then at a command prompt, create and activate your environment with:<br>
|
|
||||||
```conda create -n pythonenv python=3.11```<br>
|
```conda create -n pythonenv python=3.11```<br>
|
||||||
```activate pythonenv```<br>
|
```activate pythonenv```<br>
|
||||||
|
|
||||||
6. Launch the Command Prompt cmd with Administrator privilege as it requires admin to allow creating symlink folders.
|
5. Launch the Command Prompt cmd with Administrator privilege as it requires admin to allow creating symlink folders.
|
||||||
7. Install PyTorch, 2.1.0 with CUDA 12.1 into your Python 3.11 environment e.g:<br>
|
6. If you are using the **Text-generation-webui** python environment, then in the `text-generation-webui` folder you will run `cmd_windows.bat` to start the python evnironment.<br><br>
|
||||||
|
Otherwise Install PyTorch, 2.1.0 with CUDA 11.8 or 12.1 into your Python 3.1x.x environment e.g:<br><br>
|
||||||
```activate pythonenv``` (activate your python environment)<br>
|
```activate pythonenv``` (activate your python environment)<br>
|
||||||
```conda install pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=12.1 -c pytorch -c nvidia```
|
```conda install pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=12.1 -c pytorch -c nvidia```<br>
|
||||||
|
or<br>
|
||||||
|
```conda install pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=11.8 -c pytorch -c nvidia```<br>
|
||||||
|
|
||||||
8. In your python environment check that your CUDA_HOME and CUDA_PATH are still pointing to the correct location.<br>
|
9. Set your CUDA Windows environment variables in the command prompt to ensure that CUDA_HOME and CUDA_PATH are set to your Nvidia Cuda Toolkit path. (The folder above the bin folder that nvcc.exe is installed in). Examples are:<br><br>
|
||||||
```set``` (to list and check the windows environment variables. Refer to step 4 if not)
|
```set CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1```<br>
|
||||||
|
```set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1```<br>
|
||||||
|
or<br>
|
||||||
|
```set CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8```<br>
|
||||||
|
```set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8```<br>
|
||||||
|
|
||||||
9. Navigate to your deepspeed folder in the Command Prompt:<br>
|
10. Navigate to wherever you extracted the deepspeed folder in the Command Prompt:<br><br>
|
||||||
```cd c:\deepspeed``` (wherever you extracted it to)
|
```cd c:\DeepSpeed-0.11.2``` (wherever you extracted it to)
|
||||||
|
|
||||||
10. Modify the following files:<br>
|
11. Modify the following files:<br>
|
||||||
|
**(These modified files are included in the git-pull of AllTalk, in the DeepSpeed Windows folder and so can just be copied over the top of the exsting folders/files, but if you want to modify them yourself, please follow the below)**<br>
|
||||||
|
|
||||||
**(These modified files are included in the git-pull of AllTalk, but if you want to modify them yourself, please follow the below)**
|
deepspeed-0.11.2/build_win.bat - at the top of the file, add:<br><br>
|
||||||
|
|
||||||
deepspeed-0.11.2/build_win.bat** - at the top of the file, add:<br>
|
|
||||||
```set DS_BUILD_EVOFORMER_ATTN=0```
|
```set DS_BUILD_EVOFORMER_ATTN=0```
|
||||||
|
|
||||||
deepspeed-0.11.2/csrc/quantization/pt_binding.cpp - lines 244-250 - change to:
|
deepspeed-0.11.2/csrc/quantization/pt_binding.cpp - lines 244-250 - change to:
|
||||||
@@ -197,7 +494,215 @@ def get_shm_size():
|
|||||||
return "UNKNOWN", [f"Error getting shared memory size: {e}"]
|
return "UNKNOWN", [f"Error getting shared memory size: {e}"]
|
||||||
```
|
```
|
||||||
|
|
||||||
11. While still in your command line with python environment enabled run:<br>
|
10. While still in your command line with python environment enabled run:<br>
|
||||||
```build_win.bat```
|
```build_win.bat``` and wait 10-20 minutes.
|
||||||
|
|
||||||
12. Now cd dist to go into your dist folder and you can now pip install deepspeed-YOURFILENAME.whl (or whatever your WHL file is called).
|
11. Now `cd dist` to go into your dist folder and you can now `pip install deepspeed-YOURFILENAME.whl` (or whatever your WHL file is called).
|
||||||
|
<br><br>
|
||||||
|
**Removal** - If it became necessary to uninstall DeepSpeed, you can do so with `cmd_windows.bat` and then `pip uninstall deepspeed`<br><br>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## 🟦 Running AllTalk as a standalone app
|
||||||
|
AllTalk will run as a standalone app, as long as you install its requirements files into whatever Python environment you are using. You can follow the steps to install the AllTalk's requirements into whatever Python environment you wish. Because I dont know what Python environment you are wanting to use, I can only give you a loose set of installation instructions.
|
||||||
|
|
||||||
|
Please note, at time of writing, the TTS engine requires Python **3.9.x** to **3.11.x** [TTS Engine details here](https://pypi.org/project/TTS/). AllTalk and its requirements are tested on Python 3.11.x.
|
||||||
|
|
||||||
|
#### 🟦 (Option 1) I already have AllTalk installed as an extension of Text-generation-webui
|
||||||
|
If you already have AllTalk as a extension of Text-generation-webui, and wish to run it as standalone, load Text-generation-webui's Python environment `cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`, move into the AllTalk folder `cd extensions` > `cd alltalk_tts` and start AllTalk with `python script.py`. There is nothing beyond this you would need to do.
|
||||||
|
|
||||||
|
#### 🟦 (Option 2) I wish to do a custom install of AllTalk
|
||||||
|
1) In your chosen disk location git clone this repository:<br><br>
|
||||||
|
`git clone https://github.com/erew123/alltalk_tts`
|
||||||
|
|
||||||
|
2) Move into the **alltalk_tts** folder:<br><br>
|
||||||
|
`cd alltalk_tts`
|
||||||
|
|
||||||
|
3) If you have a custom Python environment, now is the time to load it!
|
||||||
|
|
||||||
|
4) Install one of the two requirements files. Whichever one of the two is correct for your machine type:<br><br>
|
||||||
|
**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`<br><br>
|
||||||
|
**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`
|
||||||
|
|
||||||
|
5) Start AllTalk with `python script.py`
|
||||||
|
|
||||||
|
Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
|
||||||
|
|
||||||
|
## 🟠 API Suite and JSON-CURL
|
||||||
|
### 🟠Overview
|
||||||
|
The Text-to-Speech (TTS) Generation API allows you to generate speech from text input using various configuration options. This API supports both character and narrator voices, providing flexibility for creating dynamic and engaging audio content.
|
||||||
|
|
||||||
|
#### 🟠 Ready Endpoint<br>
|
||||||
|
Check if the Text-to-Speech (TTS) service is ready to accept requests.
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/ready`<br> - Method: `GET`<br>
|
||||||
|
|
||||||
|
`curl -X GET "http://127.0.0.1:7851/api/ready"`
|
||||||
|
|
||||||
|
Response: `Ready`
|
||||||
|
|
||||||
|
#### 🟠 Voices List Endpoint<br>
|
||||||
|
Retrieve a list of available voices for generating speech.
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/voices`<br> - Method: `GET`<br>
|
||||||
|
|
||||||
|
`curl -X GET "http://127.0.0.1:7851/api/voices"`
|
||||||
|
|
||||||
|
JSON return: `{"voices": ["voice1.wav", "voice2.wav", "voice3.wav"]}`
|
||||||
|
|
||||||
|
#### 🟠 Preview Voice Endpoint
|
||||||
|
Generate a preview of a specified voice with hardcoded settings.
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/previewvoice/`<br> - Method: `POST`<br> - Content-Type: `application/x-www-form-urlencoded`<br>
|
||||||
|
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/previewvoice/" -F "voice=female_01.wav"`
|
||||||
|
|
||||||
|
Replace `female_01.wav` with the name of the voice sample you want to hear.
|
||||||
|
|
||||||
|
JSON return: `{"status": "generate-success", "output_file_path": "/path/to/outputs/api_preview_voice.wav", "output_file_url": "http://127.0.0.1:7851/audio/api_preview_voice.wav"}`
|
||||||
|
|
||||||
|
#### 🟠 Switching Model Endpoint<br>
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/reload`<br> - Method: `POST`<br><br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=API%20Local"`<br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=API%20TTS"`<br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=XTTSv2%20Local"`<br>
|
||||||
|
|
||||||
|
Switch between the 3 models respectively.
|
||||||
|
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/reload?tts_method=XTTSv2%20FT"`<br>
|
||||||
|
|
||||||
|
If you have a finetuned model in `/models/trainedmodel/` (will error otherwise)
|
||||||
|
|
||||||
|
JSON return `{"status": "model-success"}`
|
||||||
|
|
||||||
|
#### 🟠 Switch DeepSpeed Endpoint<br>
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/deepspeed`<br> - Method: `POST`<br><br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/deepspeed?new_deepspeed_value=True"`
|
||||||
|
|
||||||
|
Replace True with False to disable DeepSpeed mode.
|
||||||
|
|
||||||
|
JSON return `{"status": "deepspeed-success"}`
|
||||||
|
|
||||||
|
#### 🟠 Switching Low VRAM Endpoint<br>
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/lowvramsetting`<br> - Method: `POST`<br><br>
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/lowvramsetting?new_low_vram_value=True"`
|
||||||
|
|
||||||
|
Replace True with False to disable Low VRAM mode.
|
||||||
|
|
||||||
|
JSON return `{"status": "lowvram-success"}`
|
||||||
|
|
||||||
|
### 🟠 TTS Generation Endpoint
|
||||||
|
|
||||||
|
- URL: `http://127.0.0.1:7851/api/tts-generate`<br> - Method: `POST`<br> - Content-Type: `application/x-www-form-urlencoded`<br>
|
||||||
|
|
||||||
|
### 🟠 Example command lines
|
||||||
|
Standard TTS speech Example (standard text) generating a time-stamped file<br>
|
||||||
|
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/tts-generate" -d "text_input=All of this is text spoken by the character. This is text not inside quotes, though that doesnt matter in the slightest" -d "text_filtering=standard" -d "character_voice_gen=female_01.wav" -d "narrator_enabled=false" -d "narrator_voice_gen=male_01.wav" -d "text_not_inside=character" -d "language=en" -d "output_file_name=myoutputfile" -d "output_file_timestamp=true" -d "autoplay=true" -d "autoplay_volume=0.8"`<br>
|
||||||
|
|
||||||
|
Narrator Example (standard text) generating a time-stamped file
|
||||||
|
|
||||||
|
`curl -X POST "http://127.0.0.1:7851/api/tts-generate" -d "text_input=*This is text spoken by the narrator* \"This is text spoken by the character\". This is text not inside quotes." -d "text_filtering=standard" -d "character_voice_gen=female_01.wav" -d "narrator_enabled=true" -d "narrator_voice_gen=male_01.wav" -d "text_not_inside=character" -d "language=en" -d "output_file_name=myoutputfile" -d "output_file_timestamp=true" -d "autoplay=true" -d "autoplay_volume=0.8"`<br>
|
||||||
|
|
||||||
|
Note that if your text that needs to be generated contains double quotes you will need to escape them with `\"` (Please see the narrator example).
|
||||||
|
|
||||||
|
### 🟠 Request Parameters
|
||||||
|
🟠 **text_input**: The text you want the TTS engine to produce. Use escaped double quotes for character speech and asterisks for narrator speech if using the narrator function. Example:
|
||||||
|
|
||||||
|
`-d "text_input=*This is text spoken by the narrator* \"This is text spoken by the character\". This is text not inside quotes."`
|
||||||
|
|
||||||
|
🟠 **text_filtering**: Filter for text. Options:
|
||||||
|
|
||||||
|
- **none** No filtering. Whatever is sent will go over to the TTS engine as raw text, which may result in some odd sounds with some special characters.<br>
|
||||||
|
- **standard** Human-readable text and a basic level of filtering, just to clean up some special characters.<br>
|
||||||
|
- **html** HTML content. Where you are using HTML entity's like "<br>
|
||||||
|
|
||||||
|
`-d "text_filtering=none"`<br>
|
||||||
|
`-d "text_filtering=standard"`<br>
|
||||||
|
`-d "text_filtering=html"`<br>
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
- **Standard Example**: `*This is text spoken by the narrator* "This is text spoken by the character" This is text not inside quotes.`<br>
|
||||||
|
- **HTML Example**: `*This is text spoken by the narrator* "This is text spoken by the character" This is text not inside quotes.`<br>
|
||||||
|
- **None**: `Will just pass whatever characters/text you send at it.`<br>
|
||||||
|
|
||||||
|
🟠 **character_voice_gen**: The WAV file name for the character's voice.<br>
|
||||||
|
|
||||||
|
`-d "character_voice_gen=female_01.wav"`
|
||||||
|
|
||||||
|
🟠 **narrator_enabled**: Enable or disable the narrator function. If true, minimum text filtering is set to standard. Anything between double quotes is considered the character's speech, and anything between asterisks is considered the narrator's speech.
|
||||||
|
|
||||||
|
`-d "narrator_enabled=true"`<br>
|
||||||
|
`-d "narrator_enabled=false"`
|
||||||
|
|
||||||
|
🟠 **narrator_voice_gen**: The WAV file name for the narrator's voice.
|
||||||
|
|
||||||
|
`-d "narrator_voice_gen=male_01.wav"`
|
||||||
|
|
||||||
|
🟠 **text_not_inside**: Specify the handling of lines not inside double quotes or asterisks, for the narrator feature. Options:
|
||||||
|
|
||||||
|
- **character**: Treat as character speech.<br>
|
||||||
|
- **narrator**: Treat as narrator speech.<br>
|
||||||
|
|
||||||
|
`-d "text_not_inside=character"`<br>
|
||||||
|
`-d "text_not_inside=narrator"`
|
||||||
|
|
||||||
|
🟠 **language**: Choose the language for TTS. Options:
|
||||||
|
|
||||||
|
`ar` Arabic<br>
|
||||||
|
`zh-cn` Chinese (Simplified)<br>
|
||||||
|
`cs` Czech<br>
|
||||||
|
`nl` Dutch<br>
|
||||||
|
`en` English<br>
|
||||||
|
`fr` French<br>
|
||||||
|
`de` German<br>
|
||||||
|
`hu` Hungarian<br>
|
||||||
|
`it` Italian<br>
|
||||||
|
`ja` Japanese<br>
|
||||||
|
`ko` Korean<br>
|
||||||
|
`pl` Polish<br>
|
||||||
|
`pt` Portuguese<br>
|
||||||
|
`ru` Russian<br>
|
||||||
|
`es` Spanish<br>
|
||||||
|
`tr` Turkish<br>
|
||||||
|
|
||||||
|
`-d "language=en"`<br>
|
||||||
|
|
||||||
|
🟠 **output_file_name**: The name of the output file (excluding the .wav extension).
|
||||||
|
|
||||||
|
`-d "output_file_name=myoutputfile"`<br>
|
||||||
|
|
||||||
|
🟠 **output_file_timestamp**: Add a timestamp to the output file name. If true, each file will have a unique timestamp; otherwise, the same file name will be overwritten each time you generate TTS.
|
||||||
|
|
||||||
|
`-d "output_file_timestamp=true"`<br>
|
||||||
|
`-d "output_file_timestamp=false"`
|
||||||
|
|
||||||
|
🟠 **autoplay**: Enable or disable playing the generated TTS to your standard sound output device at time of TTS generation.
|
||||||
|
|
||||||
|
`-d "autoplay=true"`<br>
|
||||||
|
`-d "autoplay=false"`
|
||||||
|
|
||||||
|
🟠 **autoplay_volume**: Set the autoplay volume. Should be between 0.1 and 1.0. Needs to be specified in the JSON request even if autoplay is false.
|
||||||
|
|
||||||
|
`-d "autoplay_volume=0.8"`
|
||||||
|
|
||||||
|
### 🟠 TTS Generation Response
|
||||||
|
The API returns a JSON object with the following properties:
|
||||||
|
|
||||||
|
- **status** Indicates whether the generation was successful (generate-success) or failed (generate-failure).<br>
|
||||||
|
- **output_file_path** The on-disk location of the generated WAV file.<br>
|
||||||
|
- **output_file_url** The HTTP location for accessing the generated WAV file for browser playback.<br>
|
||||||
|
- **output_cache_url** The HTTP location for accessing the generated WAV file as a pushed download.<br>
|
||||||
|
|
||||||
|
Example JSON TTS Generation Response:
|
||||||
|
|
||||||
|
`{"status":"generate-success","output_file_path":"C:\\text-generation-webui\\extensions\\alltalk_tts\\outputs\\myoutputfile_1704141936.wav","output_file_url":"http://127.0.0.1:7851/audio/myoutputfile_1704141936.wav","output_cache_url":"http://127.0.0.1:7851/audiocache/myoutputfile_1704141936.wav"}`
|
||||||
|
|
||||||
|
### 🔴 Future to-do list
|
||||||
|
- Voice output within the command prompt/terminal (TBD).
|
||||||
|
- Correct a few spelling mistakes in the documentation.
|
||||||
|
- Possibly add some additional TTS engines (TBD).
|
||||||
|
- Have a break!
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"activate": true, "autoplay": true, "branding": "AllTalk ", "narrator_enabled": false, "deepspeed_activate": false, "delete_output_wavs": "Disabled", "ip_address": "127.0.0.1", "language": "English", "low_vram": false, "local_temperature": "0.7", "local_repetition_penalty": "12.0", "model_loaded": true, "model_name": "tts_models/multilingual/multi-dataset/xtts_v2", "narrator_voice": "female_01.wav", "output_folder_wav": "extensions/alltalk_tts/outputs/", "port_number": "7851", "remove_trailing_dots": false, "show_text": true, "tts_method_api_local": false, "tts_method_api_tts": false, "tts_method_xtts_local": true, "voice": "female_01.wav"}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"activate": true, "autoplay": true, "branding": "AllTalk ", "narrator_enabled": false, "deepspeed_activate": false, "delete_output_wavs": "Disabled", "ip_address": "127.0.0.1", "language": "English", "low_vram": false, "local_temperature": "0.7", "local_repetition_penalty": "10.0", "tts_model_loaded": true, "tts_model_name": "tts_models/multilingual/multi-dataset/xtts_v2", "narrator_voice": "female_01.wav", "output_folder_wav": "extensions/alltalk_tts/outputs/", "output_folder_wav_standalone": "outputs/", "port_number": "7851", "remove_trailing_dots": false, "show_text": true, "tts_method_api_local": false, "tts_method_api_tts": false, "tts_method_xtts_local": true, "voice": "female_01.wav"}
|
||||||
+232
@@ -0,0 +1,232 @@
|
|||||||
|
try:
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
import logging
|
||||||
|
from importlib_metadata import distributions
|
||||||
|
import torch
|
||||||
|
import os # Import the os module
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import glob
|
||||||
|
import textwrap
|
||||||
|
import packaging.version
|
||||||
|
import packaging.specifiers
|
||||||
|
from packaging.specifiers import SpecifierSet
|
||||||
|
from packaging.specifiers import SpecifierSet
|
||||||
|
from packaging.version import parse as parse_version
|
||||||
|
except ImportError as e:
|
||||||
|
print(f"\033[91mError importing module: {e}\033[0m\n")
|
||||||
|
print("\033[94mPlease ensure you started the Text-generation-webUI Python environment with either\033[0m")
|
||||||
|
print("\033[92mcmd_linux.sh\033[0m, \033[92mcmd_windows.bat\033[0m, \033[92mcmd_macos.sh\033[0m, or \033[92mcmd_wsl.bat\033[0m")
|
||||||
|
print("\033[94mfrom the text-generation-webui directory, and then try running the diagnostics again.\033[0m")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
try:
|
||||||
|
import psutil
|
||||||
|
except ImportError:
|
||||||
|
print("psutil not found. Installing...")
|
||||||
|
subprocess.run(['pip', 'install', 'psutil'])
|
||||||
|
import psutil
|
||||||
|
|
||||||
|
def get_requirements_file():
|
||||||
|
requirements_files = glob.glob("requirements*.txt")
|
||||||
|
if not requirements_files:
|
||||||
|
print("\033[91mNo requirements files found.\033[0m")
|
||||||
|
return None
|
||||||
|
|
||||||
|
print("\033[94m\nSelect a requirements file to check against (or press Enter for default 'requirements.txt'):\033[0m\n")
|
||||||
|
for i, file in enumerate(requirements_files, start=1):
|
||||||
|
print(f"{i}. {file}")
|
||||||
|
|
||||||
|
choice = input("\nEnter the number of your choice: ")
|
||||||
|
try:
|
||||||
|
choice = int(choice) - 1
|
||||||
|
return requirements_files[choice]
|
||||||
|
except (ValueError, IndexError):
|
||||||
|
return "requirements.txt"
|
||||||
|
|
||||||
|
# Set up logging with filemode='w'
|
||||||
|
logging.basicConfig(filename='diagnostics.log', filemode='w', level=logging.INFO)
|
||||||
|
|
||||||
|
# Function to get GPU information using subprocess
|
||||||
|
def get_gpu_info():
|
||||||
|
try:
|
||||||
|
result = subprocess.run(['nvidia-smi'], stdout=subprocess.PIPE, text=True)
|
||||||
|
return result.stdout
|
||||||
|
except FileNotFoundError:
|
||||||
|
return "NVIDIA GPU information not available"
|
||||||
|
|
||||||
|
# Function to check if a port is in use
|
||||||
|
def is_port_in_use(port):
|
||||||
|
for conn in psutil.net_connections():
|
||||||
|
if conn.laddr.port == port:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def satisfies_wildcard(installed_version, required_version):
|
||||||
|
if '*' in required_version:
|
||||||
|
required_parts = required_version.split('.')
|
||||||
|
installed_parts = installed_version.split('.')
|
||||||
|
for req, inst in zip(required_parts, installed_parts):
|
||||||
|
if req != '*' and req != inst:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Function to log and print system information
|
||||||
|
def log_system_info():
|
||||||
|
# System information
|
||||||
|
os_version = platform.system() + " " + platform.version()
|
||||||
|
|
||||||
|
# Get CUDA_HOME environment variable
|
||||||
|
cuda_home = os.environ.get('CUDA_HOME', 'N/A')
|
||||||
|
|
||||||
|
gpu_info = get_gpu_info()
|
||||||
|
|
||||||
|
# Python environment information
|
||||||
|
python_version = platform.python_version()
|
||||||
|
|
||||||
|
# Torch version
|
||||||
|
torch_version = torch.__version__
|
||||||
|
|
||||||
|
# System RAM using psutil
|
||||||
|
try:
|
||||||
|
virtual_memory = psutil.virtual_memory()
|
||||||
|
total_ram = f"{virtual_memory.total / (1024 ** 3):.2f} GB"
|
||||||
|
available_ram = f"{virtual_memory.available / (1024 ** 3):.2f} GB"
|
||||||
|
system_ram = f"{available_ram} available out of {total_ram} total"
|
||||||
|
except NameError:
|
||||||
|
print("psutil is not installed. Unable to check system RAM.")
|
||||||
|
system_ram = "N/A"
|
||||||
|
|
||||||
|
# Port check (if psutil is available)
|
||||||
|
port_status = "N/A"
|
||||||
|
if 'psutil' in globals():
|
||||||
|
port_to_check = 7851
|
||||||
|
if is_port_in_use(port_to_check):
|
||||||
|
port_status = f"Port {port_to_check} is in use."
|
||||||
|
else:
|
||||||
|
port_status = f"Port {port_to_check} is available."
|
||||||
|
|
||||||
|
# Package versions using importlib_metadata
|
||||||
|
package_versions = {d.metadata['Name']: d.version for d in distributions()}
|
||||||
|
|
||||||
|
# Python environment information
|
||||||
|
python_executable = sys.executable
|
||||||
|
python_version_info = sys.version_info
|
||||||
|
python_virtual_env = os.environ.get('VIRTUAL_ENV', 'N/A')
|
||||||
|
|
||||||
|
# Conda environment information
|
||||||
|
conda_env = os.environ.get('CONDA_DEFAULT_ENV', 'N/A')
|
||||||
|
|
||||||
|
# Get Path environment information
|
||||||
|
search_path = sys.path
|
||||||
|
path_env = os.environ.get('PATH', 'N/A')
|
||||||
|
|
||||||
|
# Compare with requirements file
|
||||||
|
requirements_file = get_requirements_file()
|
||||||
|
if requirements_file:
|
||||||
|
required_packages = {}
|
||||||
|
installed_packages = {}
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(requirements_file, 'r') as req_file:
|
||||||
|
requirements = [line.strip() for line in req_file]
|
||||||
|
for req in requirements:
|
||||||
|
# Use regular expression to parse package name and version
|
||||||
|
match = re.match(r'([^\s>=]+)\s*([>=<]+)\s*([^,]+)', req)
|
||||||
|
if match:
|
||||||
|
package_name, operator, version_spec = match.groups()
|
||||||
|
installed_version = package_versions.get(package_name, 'Not installed')
|
||||||
|
if installed_version != 'Not installed':
|
||||||
|
required_packages[package_name] = (operator, version_spec)
|
||||||
|
installed_packages[package_name] = installed_version
|
||||||
|
except FileNotFoundError:
|
||||||
|
print(f"\n{requirements_file} not found. Skipping version checks.")
|
||||||
|
logging.info(f"NOTE {requirements_file} not found. Skipping version checks.")
|
||||||
|
|
||||||
|
# Log and print information
|
||||||
|
logging.info(f"OS Version: {os_version}")
|
||||||
|
logging.info(f"Note: Windows 11 will list as build is 10.x.22xxx")
|
||||||
|
logging.info(f"Torch Version: {torch_version}")
|
||||||
|
logging.info(f"System RAM: {system_ram}")
|
||||||
|
logging.info(f"CUDA_HOME: {cuda_home}")
|
||||||
|
logging.info(f"Port Status: {port_status}")
|
||||||
|
logging.info(f"Python Version: {platform.python_version()}")
|
||||||
|
logging.info(f"Python Version Info: {python_version_info}")
|
||||||
|
logging.info(f"Python Executable: {python_executable}")
|
||||||
|
logging.info(f"Python Virtual Environment: {python_virtual_env} (Should be N/A when in Text-generation-webui Conda Python environment)")
|
||||||
|
logging.info(f"Conda Environment: {conda_env}")
|
||||||
|
logging.info("\nPython Search Path:")
|
||||||
|
for path in search_path:
|
||||||
|
logging.info(f" {path}")
|
||||||
|
logging.info("\nOS PATH Environment Variable:")
|
||||||
|
for path in path_env.split(';'):
|
||||||
|
logging.info(f" {path}")
|
||||||
|
if required_packages: # Check if the dictionary is not empty
|
||||||
|
logging.info("\nPackage Versions:")
|
||||||
|
max_package_length = max(len(package) for package in required_packages.keys())
|
||||||
|
for package_name, (operator, required_version) in required_packages.items():
|
||||||
|
installed_version = installed_packages.get(package_name, 'Not installed')
|
||||||
|
logging.info(f"{package_name.ljust(max_package_length)} Required: {operator} {required_version.ljust(12)} Installed: {installed_version}")
|
||||||
|
logging.info(f"GPU Information:\n{gpu_info}")
|
||||||
|
logging.info("Package Versions:")
|
||||||
|
for package, version in package_versions.items():
|
||||||
|
logging.info(f"{package}>= {version}")
|
||||||
|
|
||||||
|
# Print to screen
|
||||||
|
print(f"\n\033[94mOS Version:\033[0m \033[92m{os_version}\033[0m")
|
||||||
|
print(f"\033[94mOS Ver note:\033[0m \033[92m(Windows 11 will say build is 10.x.22xxx)\033[0m")
|
||||||
|
print(f"\033[94mCUDA_HOME:\033[0m \033[92m{cuda_home}\033[0m")
|
||||||
|
print(f"\033[94mSystem RAM:\033[0m \033[92m{system_ram}\033[0m")
|
||||||
|
print(f"\033[94mPort Status:\033[0m \033[92m{port_status}\033[0m")
|
||||||
|
print(f"\033[94mTorch Version:\033[0m \033[92m{torch_version}\033[0m")
|
||||||
|
print(f"\033[94mPython Version:\033[0m \033[92m{platform.python_version()}\033[0m")
|
||||||
|
print(f"\033[94mPython Version Info:\033[0m \033[92m{python_version_info}\033[0m")
|
||||||
|
print(f"\033[94mPython Executable:\033[0m \033[92m{python_executable}\033[0m")
|
||||||
|
print(f"\033[94mPython Virtual Environment:\033[0m \033[92m{python_virtual_env}\033[0m (Should be N/A when in Text-generation-webui Conda Python environment)")
|
||||||
|
print(f"\033[94mConda Environment:\033[0m \033[92m{conda_env}\033[0m")
|
||||||
|
print(f"\n\033[94mPython Search Path:\033[0m")
|
||||||
|
for path in search_path:
|
||||||
|
print(f" {path}")
|
||||||
|
print(f"\n\033[94mOS Search PATH Environment Variable:\033[0m")
|
||||||
|
for path in path_env.split(';'):
|
||||||
|
print(f" {path}")
|
||||||
|
if required_packages: # Check if the dictionary is not empty
|
||||||
|
print("\033[94m\nRequirements file package comparison:\033[0m")
|
||||||
|
max_package_length = max(len(package) for package in required_packages.keys())
|
||||||
|
|
||||||
|
for package_name, (operator, required_version) in required_packages.items():
|
||||||
|
installed_version = installed_packages.get(package_name, 'Not installed')
|
||||||
|
|
||||||
|
# Exclude build information (e.g., +cu118) before creating the SpecifierSet
|
||||||
|
required_version_no_build = required_version.split("+")[0]
|
||||||
|
|
||||||
|
if '*' in required_version:
|
||||||
|
condition_met = satisfies_wildcard(installed_version, required_version)
|
||||||
|
else:
|
||||||
|
# Compare versions using packaging.version
|
||||||
|
required_specifier = SpecifierSet(f"{operator}{required_version_no_build}")
|
||||||
|
installed_version = parse_version(installed_version)
|
||||||
|
condition_met = installed_version in required_specifier
|
||||||
|
|
||||||
|
color_required = "\033[92m" if condition_met else "\033[91m"
|
||||||
|
color_installed = "\033[92m" if condition_met else "\033[91m"
|
||||||
|
|
||||||
|
# Print colored output
|
||||||
|
print(f"{package_name.ljust(max_package_length)} Required: {color_required}{operator} {required_version.ljust(12)}\033[0m Installed: {color_installed}{installed_version}\033[0m")
|
||||||
|
print("\033[94m\nRequirements file specifier meanings:\033[0m")
|
||||||
|
explanation = textwrap.dedent("""
|
||||||
|
== Exact version != Any version except < Less than
|
||||||
|
<= Less than or equal to > Greater than >= Greater than or equal to
|
||||||
|
~ Compatible release ; Environment marker AND Logical AND
|
||||||
|
OR Logical OR
|
||||||
|
""")
|
||||||
|
print(explanation.strip())
|
||||||
|
print("")
|
||||||
|
print(f"GPU Information:{gpu_info}")
|
||||||
|
print(f"\033[94mDiagnostic log created:\033[0m \033[92mdiagnostics.log\033[0m")
|
||||||
|
print(f"\033[94mPlease upload the log file with any support ticket.\033[0m")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
log_system_info()
|
||||||
+1349
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,26 @@
|
|||||||
|
import torch
|
||||||
|
import os
|
||||||
|
MODEL_PATH = "best_model.pth"
|
||||||
|
# Check if best_model.pth exists
|
||||||
|
if not os.path.exists(MODEL_PATH):
|
||||||
|
print(f"\nCannot find \033[94m{MODEL_PATH}\033[0m in the current folder.")
|
||||||
|
|
||||||
|
# Check if model.pth exists as an alternative
|
||||||
|
ALTERNATIVE_PATH = "model.pth"
|
||||||
|
if os.path.exists(ALTERNATIVE_PATH):
|
||||||
|
print(f"\nIf your model is currently called \033[93m{ALTERNATIVE_PATH}\033[0m please rename it to \033[94mbest_model.pth\033[0m.")
|
||||||
|
else:
|
||||||
|
print(f"Please put \033[91mbest_model.pth\033[0m in the current folder or rename your model file to \033[94mbest_model.pth\033[0m.")
|
||||||
|
exit(1)
|
||||||
|
# Attempt to load the model
|
||||||
|
try:
|
||||||
|
checkpoint = torch.load(MODEL_PATH, map_location=torch.device("cpu"))
|
||||||
|
except Exception as e:
|
||||||
|
print("Error loading checkpoint:", e)
|
||||||
|
raise
|
||||||
|
del checkpoint["optimizer"]
|
||||||
|
for key in list(checkpoint["model"].keys()):
|
||||||
|
if "dvae" in key:
|
||||||
|
del checkpoint["model"][key]
|
||||||
|
torch.save(checkpoint, "model.pth")
|
||||||
|
print(f"\nYour compacted model is created \033[93mmodel.pth\033[0m.")
|
||||||
Whitespace-only changes.
+4
-1
@@ -6,6 +6,9 @@
|
|||||||
"README.md": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/README.md?download=true",
|
"README.md": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/README.md?download=true",
|
||||||
"config.json": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/config.json?download=true",
|
"config.json": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/config.json?download=true",
|
||||||
"model.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/model.pth?download=true",
|
"model.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/model.pth?download=true",
|
||||||
|
"dvae.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/dvae.pth?download=true",
|
||||||
|
"mel_stats.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/mel_stats.pth?download=true",
|
||||||
|
"speakers_xtts.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/speakers_xtts.pth?download=true",
|
||||||
"vocab.json": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/vocab.json?download=true"
|
"vocab.json": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/vocab.json?download=true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-4
@@ -6,9 +6,9 @@ import importlib.metadata as metadata
|
|||||||
import json
|
import json
|
||||||
from packaging import version
|
from packaging import version
|
||||||
|
|
||||||
##############################################################
|
#################################################################
|
||||||
#### LOAD PARAMS FROM CONFIG.JSON - REQUIRED FOR BRANDING ####
|
#### LOAD PARAMS FROM confignew.json - REQUIRED FOR BRANDING ####
|
||||||
##############################################################
|
#################################################################
|
||||||
# STARTUP VARIABLE - Create "this_dir" variable as the current script directory
|
# STARTUP VARIABLE - Create "this_dir" variable as the current script directory
|
||||||
this_dir = Path(__file__).parent.resolve()
|
this_dir = Path(__file__).parent.resolve()
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ def load_config(file_path):
|
|||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
config_file_path = this_dir / "config.json"
|
config_file_path = this_dir / "confignew.json"
|
||||||
params = load_config(config_file_path)
|
params = load_config(config_file_path)
|
||||||
|
|
||||||
# Define the path to the modeldownload config file file
|
# Define the path to the modeldownload config file file
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
gradio>=3.50.2
|
||||||
|
torch>=2.1.0+cu118
|
||||||
|
torchaudio>=2.1.0+cu118
|
||||||
|
TTS==0.21.3
|
||||||
|
faster-whisper>=0.10.0
|
||||||
|
tqdm>=4.66.0
|
||||||
|
pandas>=1.5.0
|
||||||
@@ -10,3 +10,6 @@ requests>=2.31.0
|
|||||||
tqdm>=4.66.1
|
tqdm>=4.66.1
|
||||||
importlib-metadata>=4.8.1
|
importlib-metadata>=4.8.1
|
||||||
packaging>=23.2
|
packaging>=23.2
|
||||||
|
pydantic>=1.10.13
|
||||||
|
sounddevice>=0.4.6
|
||||||
|
python-multipart>=0.0.6
|
||||||
@@ -10,3 +10,6 @@ requests>=2.31.0
|
|||||||
tqdm>=4.66.1
|
tqdm>=4.66.1
|
||||||
importlib-metadata>=4.8.1
|
importlib-metadata>=4.8.1
|
||||||
packaging>=23.2
|
packaging>=23.2
|
||||||
|
pydantic>=1.10.13
|
||||||
|
sounddevice>=0.4.6
|
||||||
|
python-multipart>=0.0.6
|
||||||
@@ -16,9 +16,9 @@ import numpy as np
|
|||||||
import soundfile as sf
|
import soundfile as sf
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
##############################################################
|
#################################################################
|
||||||
#### LOAD PARAMS FROM CONFIG.JSON - REQUIRED FOR BRANDING ####
|
#### LOAD PARAMS FROM confignew.json - REQUIRED FOR BRANDING ####
|
||||||
##############################################################
|
#################################################################
|
||||||
# STARTUP VARIABLE - Create "this_dir" variable as the current script directory
|
# STARTUP VARIABLE - Create "this_dir" variable as the current script directory
|
||||||
this_dir = Path(__file__).parent.resolve()
|
this_dir = Path(__file__).parent.resolve()
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@ def load_config(file_path):
|
|||||||
config = json.load(config_file)
|
config = json.load(config_file)
|
||||||
return config
|
return config
|
||||||
|
|
||||||
config_file_path = this_dir / "config.json"
|
config_file_path = this_dir / "confignew.json"
|
||||||
# Load the params dictionary from the config.json file
|
# Load the params dictionary from the confignew.json file
|
||||||
params = load_config(config_file_path)
|
params = load_config(config_file_path)
|
||||||
|
|
||||||
# Required for sentence splitting
|
# Required for sentence splitting
|
||||||
@@ -39,8 +39,8 @@ try:
|
|||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"[{params['branding']}]\033[91mWarning\033[0m Could not find the TTS module. Make sure to install the requirements for the {params['branding']} extension."
|
f"[{params['branding']}]\033[91mWarning\033[0m Could not find the TTS module. Make sure to install the requirements for the {params['branding']} extension."
|
||||||
f"[{params['branding']}]\033[91mWarning\033[0m Linux / Mac:\npip install -r extensions/alltalk_tts/requirements.txt\n"
|
f"[{params['branding']}]\033[91mWarning\033[0m Linux / Mac:\npip install -r /alltalk_tts/requirements.txt\n"
|
||||||
f"[{params['branding']}]\033[91mWarning\033[0m Windows:\npip install -r extensions\\alltalk_tts\\requirements.txt\n"
|
f"[{params['branding']}]\033[91mWarning\033[0m Windows:\npip install -r \\alltalk_tts\\requirements.txt\n"
|
||||||
f"[{params['branding']}]\033[91mWarning\033[0m If you used the one-click installer, paste the command above in the terminal window launched after running the cmd_ script. On Windows, that's cmd_windows.bat."
|
f"[{params['branding']}]\033[91mWarning\033[0m If you used the one-click installer, paste the command above in the terminal window launched after running the cmd_ script. On Windows, that's cmd_windows.bat."
|
||||||
)
|
)
|
||||||
raise
|
raise
|
||||||
@@ -62,7 +62,9 @@ try:
|
|||||||
from modules.utils import gradio
|
from modules.utils import gradio
|
||||||
# This is set to check if the script is being run within text generation webui or as a standalone script. False is running as part of text gen web ui or a gradio interface
|
# This is set to check if the script is being run within text generation webui or as a standalone script. False is running as part of text gen web ui or a gradio interface
|
||||||
running_in_standalone = False
|
running_in_standalone = False
|
||||||
|
output_folder_wav = params["output_folder_wav"]
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
|
output_folder_wav = params["output_folder_wav_standalone"]
|
||||||
print(f"[{params['branding']}Startup] Running script.py in standalone mode")
|
print(f"[{params['branding']}Startup] Running script.py in standalone mode")
|
||||||
# This is set to check if the script is being run within text generation webui or as a standalone script. true means standalone
|
# This is set to check if the script is being run within text generation webui or as a standalone script. true means standalone
|
||||||
running_in_standalone = True
|
running_in_standalone = True
|
||||||
@@ -75,6 +77,8 @@ with open(this_dir / "languages.json", encoding="utf8") as f:
|
|||||||
languages = json.load(f)
|
languages = json.load(f)
|
||||||
# Create a global lock
|
# Create a global lock
|
||||||
process_lock = threading.Lock()
|
process_lock = threading.Lock()
|
||||||
|
# Base setting for a possible FineTuned model existing and the loader being available
|
||||||
|
tts_method_xtts_ft = False
|
||||||
|
|
||||||
# Gather the voice files
|
# Gather the voice files
|
||||||
def get_available_voices():
|
def get_available_voices():
|
||||||
@@ -108,7 +112,6 @@ def delete_old_files(folder_path, days_to_keep):
|
|||||||
|
|
||||||
# Extract settings using params dictionary
|
# Extract settings using params dictionary
|
||||||
delete_output_wavs_setting = params["delete_output_wavs"]
|
delete_output_wavs_setting = params["delete_output_wavs"]
|
||||||
output_folder_wav = params["output_folder_wav"]
|
|
||||||
output_folder_wav = os.path.normpath(output_folder_wav)
|
output_folder_wav = os.path.normpath(output_folder_wav)
|
||||||
|
|
||||||
# Check and perform file deletion
|
# Check and perform file deletion
|
||||||
@@ -138,14 +141,27 @@ def check_required_files():
|
|||||||
subprocess.run(["python", str(download_script_path)])
|
subprocess.run(["python", str(download_script_path)])
|
||||||
print(f"[{params['branding']}Startup] All required files are present.")
|
print(f"[{params['branding']}Startup] All required files are present.")
|
||||||
|
|
||||||
|
|
||||||
# STARTUP Call Check routine
|
# STARTUP Call Check routine
|
||||||
check_required_files()
|
check_required_files()
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
#### Check to see if a finetuned model exists ####
|
||||||
|
##################################################
|
||||||
|
# Set the path to the directory
|
||||||
|
trained_model_directory = this_dir / "models" / "trainedmodel"
|
||||||
|
# Check if the directory "trainedmodel" exists
|
||||||
|
finetuned_model = trained_model_directory.exists()
|
||||||
|
# If the directory exists, check for the existence of the required files
|
||||||
|
# If true, this will add a extra option in the Gradio interface for loading Xttsv2 FT
|
||||||
|
if finetuned_model:
|
||||||
|
required_files = ["model.pth", "config.json", "vocab.json"]
|
||||||
|
finetuned_model = all((trained_model_directory / file).exists() for file in required_files)
|
||||||
|
if finetuned_model:
|
||||||
|
print(f"[{params['branding']}Startup] Finetuned model \033[93mDetected\033[0m")
|
||||||
|
|
||||||
#################################################
|
####################################################
|
||||||
#### SET GRADIO BUTTONS BASED ON CONFIG.JSON ####
|
#### SET GRADIO BUTTONS BASED ON confignew.json ####
|
||||||
#################################################
|
####################################################
|
||||||
|
|
||||||
if params["tts_method_api_tts"] == True:
|
if params["tts_method_api_tts"] == True:
|
||||||
gr_modelchoice = "API TTS"
|
gr_modelchoice = "API TTS"
|
||||||
@@ -248,10 +264,10 @@ else:
|
|||||||
# Cleanly kill off this script, but allow text-generation-webui to keep running, albeit without this alltalk_tts
|
# Cleanly kill off this script, but allow text-generation-webui to keep running, albeit without this alltalk_tts
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
timeout = 60 # Adjust the timeout as needed
|
timeout = 120 # Adjust the timeout as needed
|
||||||
|
|
||||||
# Introduce a delay before starting the check loop
|
# Introduce a delay before starting the check loop
|
||||||
time.sleep(25) # Wait 25 secs before checking if the tts_server.py has started up.
|
time.sleep(26) # Wait 26 secs before checking if the tts_server.py has started up.
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
while time.time() - start_time < timeout:
|
while time.time() - start_time < timeout:
|
||||||
try:
|
try:
|
||||||
@@ -261,9 +277,9 @@ while time.time() - start_time < timeout:
|
|||||||
except requests.RequestException as e:
|
except requests.RequestException as e:
|
||||||
# Print the exception for debugging purposes
|
# Print the exception for debugging purposes
|
||||||
print(
|
print(
|
||||||
f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess has NOT started up yet, Will keep trying for 60 seconds maximum. Please wait."
|
f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess has NOT started up yet, Will keep trying for 120 seconds maximum. Please wait."
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(4)
|
||||||
else:
|
else:
|
||||||
print(
|
print(
|
||||||
f"[{params['branding']}Startup] Startup timed out. Check the server logs for more information."
|
f"[{params['branding']}Startup] Startup timed out. Check the server logs for more information."
|
||||||
@@ -271,13 +287,15 @@ else:
|
|||||||
# Cleanly kill off this script, but allow text-generation-webui to keep running, albeit without this alltalk_tts
|
# Cleanly kill off this script, but allow text-generation-webui to keep running, albeit without this alltalk_tts
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
#### MODEL LOADING AND UNLOADING ####
|
#### MODEL LOADING AND UNLOADING ####
|
||||||
#####################################
|
#####################################
|
||||||
# MODEL - Swap model based on Gradio selection API TTS, API Local, XTTSv2 Local
|
# MODEL - Swap model based on Gradio selection API TTS, API Local, XTTSv2 Local
|
||||||
def send_reload_request(tts_method):
|
def send_reload_request(tts_method):
|
||||||
|
global tts_method_xtts_ft
|
||||||
try:
|
try:
|
||||||
params["model_loaded"] = False
|
params["tts_model_loaded"] = False
|
||||||
url = f"{base_url}/api/reload"
|
url = f"{base_url}/api/reload"
|
||||||
payload = {"tts_method": tts_method}
|
payload = {"tts_method": tts_method}
|
||||||
response = requests.post(url, params=payload)
|
response = requests.post(url, params=payload)
|
||||||
@@ -285,8 +303,8 @@ def send_reload_request(tts_method):
|
|||||||
json_response = response.json()
|
json_response = response.json()
|
||||||
# Check if the reload operation was successful
|
# Check if the reload operation was successful
|
||||||
if json_response.get("status") == "model-success":
|
if json_response.get("status") == "model-success":
|
||||||
# Update model_loaded to True if the reload was successful
|
# Update tts_tts_model_loaded to True if the reload was successful
|
||||||
params["model_loaded"] = True
|
params["tts_model_loaded"] = True
|
||||||
# Update local script parameters based on the tts_method
|
# Update local script parameters based on the tts_method
|
||||||
if tts_method == "API TTS":
|
if tts_method == "API TTS":
|
||||||
params["tts_method_api_local"] = False
|
params["tts_method_api_local"] = False
|
||||||
@@ -294,17 +312,26 @@ def send_reload_request(tts_method):
|
|||||||
params["tts_method_api_tts"] = True
|
params["tts_method_api_tts"] = True
|
||||||
params["deepspeed_activate"] = False
|
params["deepspeed_activate"] = False
|
||||||
audio_path = this_dir / "templates" / "apitts.wav"
|
audio_path = this_dir / "templates" / "apitts.wav"
|
||||||
|
tts_method_xtts_ft = False
|
||||||
elif tts_method == "API Local":
|
elif tts_method == "API Local":
|
||||||
params["tts_method_api_tts"] = False
|
params["tts_method_api_tts"] = False
|
||||||
params["tts_method_xtts_local"] = False
|
params["tts_method_xtts_local"] = False
|
||||||
params["tts_method_api_local"] = True
|
params["tts_method_api_local"] = True
|
||||||
params["deepspeed_activate"] = False
|
params["deepspeed_activate"] = False
|
||||||
audio_path = this_dir / "templates" / "apilocal.wav"
|
audio_path = this_dir / "templates" / "apilocal.wav"
|
||||||
|
tts_method_xtts_ft = False
|
||||||
elif tts_method == "XTTSv2 Local":
|
elif tts_method == "XTTSv2 Local":
|
||||||
params["tts_method_api_tts"] = False
|
params["tts_method_api_tts"] = False
|
||||||
params["tts_method_api_local"] = False
|
params["tts_method_api_local"] = False
|
||||||
params["tts_method_xtts_local"] = True
|
params["tts_method_xtts_local"] = True
|
||||||
audio_path = this_dir / "templates" / "xttslocal.wav"
|
audio_path = this_dir / "templates" / "xttslocal.wav"
|
||||||
|
tts_method_xtts_ft = False
|
||||||
|
elif tts_method == "XTTSv2 FT":
|
||||||
|
params["tts_method_api_tts"] = False
|
||||||
|
params["tts_method_api_local"] = False
|
||||||
|
params["tts_method_xtts_local"] = False
|
||||||
|
audio_path = this_dir / "templates" / "xttsfinetuned.wav"
|
||||||
|
tts_method_xtts_ft = True
|
||||||
return f'<audio src="file/{audio_path}" controls autoplay></audio>'
|
return f'<audio src="file/{audio_path}" controls autoplay></audio>'
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
# Handle the HTTP request error
|
# Handle the HTTP request error
|
||||||
@@ -319,7 +346,7 @@ def send_reload_request(tts_method):
|
|||||||
# LOW VRAM - Gradio Checkbox handling
|
# LOW VRAM - Gradio Checkbox handling
|
||||||
def send_lowvram_request(low_vram):
|
def send_lowvram_request(low_vram):
|
||||||
try:
|
try:
|
||||||
params["model_loaded"] = False
|
params["tts_model_loaded"] = False
|
||||||
if low_vram:
|
if low_vram:
|
||||||
audio_path = this_dir / "templates" / "lowvramenabled.wav"
|
audio_path = this_dir / "templates" / "lowvramenabled.wav"
|
||||||
else:
|
else:
|
||||||
@@ -332,7 +359,7 @@ def send_lowvram_request(low_vram):
|
|||||||
# Check if the low VRAM request was successful
|
# Check if the low VRAM request was successful
|
||||||
if json_response.get("status") == "lowvram-success":
|
if json_response.get("status") == "lowvram-success":
|
||||||
# Update any relevant variables or perform other actions on success
|
# Update any relevant variables or perform other actions on success
|
||||||
params["model_loaded"] = True
|
params["tts_model_loaded"] = True
|
||||||
return f'<audio src="file/{audio_path}" controls autoplay></audio>'
|
return f'<audio src="file/{audio_path}" controls autoplay></audio>'
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
# Handle the HTTP request error
|
# Handle the HTTP request error
|
||||||
@@ -348,7 +375,7 @@ def send_lowvram_request(low_vram):
|
|||||||
# DEEPSPEED - Reload the model when DeepSpeed checkbox is enabled/disabled
|
# DEEPSPEED - Reload the model when DeepSpeed checkbox is enabled/disabled
|
||||||
def send_deepspeed_request(deepspeed_param):
|
def send_deepspeed_request(deepspeed_param):
|
||||||
try:
|
try:
|
||||||
params["model_loaded"] = False
|
params["tts_model_loaded"] = False
|
||||||
if deepspeed_param:
|
if deepspeed_param:
|
||||||
audio_path = this_dir / "templates" / "deepspeedenabled.wav"
|
audio_path = this_dir / "templates" / "deepspeedenabled.wav"
|
||||||
else:
|
else:
|
||||||
@@ -362,7 +389,7 @@ def send_deepspeed_request(deepspeed_param):
|
|||||||
# Check if the deepspeed request was successful
|
# Check if the deepspeed request was successful
|
||||||
if json_response.get("status") == "deepspeed-success":
|
if json_response.get("status") == "deepspeed-success":
|
||||||
# Update any relevant variables or perform other actions on success
|
# Update any relevant variables or perform other actions on success
|
||||||
params["model_loaded"] = True
|
params["tts_model_loaded"] = True
|
||||||
return f'<audio src="file/{audio_path}" controls autoplay></audio>'
|
return f'<audio src="file/{audio_path}" controls autoplay></audio>'
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
# Handle the HTTP request error
|
# Handle the HTTP request error
|
||||||
@@ -400,7 +427,7 @@ Synthesizer.split_into_sentences = new_split_into_sentences
|
|||||||
# Check model is loaded and string isnt empty, before sending a TTS request.
|
# Check model is loaded and string isnt empty, before sending a TTS request.
|
||||||
def before_audio_generation(string, params):
|
def before_audio_generation(string, params):
|
||||||
# Check Model is loaded into cuda or cpu and error if not
|
# Check Model is loaded into cuda or cpu and error if not
|
||||||
if not params["model_loaded"]:
|
if not params["tts_model_loaded"]:
|
||||||
print(
|
print(
|
||||||
f"[{params['branding']}Model] \033[91mWarning\033[0m Model is still loading, please wait before trying to generate TTS"
|
f"[{params['branding']}Model] \033[91mWarning\033[0m Model is still loading, please wait before trying to generate TTS"
|
||||||
)
|
)
|
||||||
@@ -482,6 +509,54 @@ def voice_preview(string):
|
|||||||
return f"[{params['branding']}Server] Audio generation failed. Status: {generate_response.get('status')}"
|
return f"[{params['branding']}Server] Audio generation failed. Status: {generate_response.get('status')}"
|
||||||
|
|
||||||
|
|
||||||
|
def process_text(text):
|
||||||
|
# Normalize HTML encoded quotes
|
||||||
|
text = html.unescape(text)
|
||||||
|
|
||||||
|
# Replace ellipsis with a single dot
|
||||||
|
text = re.sub(r'\.{3,}', '.', text)
|
||||||
|
|
||||||
|
# Pattern to identify combined narrator and character speech
|
||||||
|
combined_pattern = r'(\*[^*"]+\*|"[^"*]+")'
|
||||||
|
|
||||||
|
# List to hold parts of speech along with their type
|
||||||
|
ordered_parts = []
|
||||||
|
|
||||||
|
# Track the start of the next segment
|
||||||
|
start = 0
|
||||||
|
|
||||||
|
# Find all matches
|
||||||
|
for match in re.finditer(combined_pattern, text):
|
||||||
|
# Add the text before the match, if any, as ambiguous
|
||||||
|
if start < match.start():
|
||||||
|
ambiguous_text = text[start:match.start()].strip()
|
||||||
|
if ambiguous_text:
|
||||||
|
ordered_parts.append(('ambiguous', ambiguous_text))
|
||||||
|
|
||||||
|
# Add the matched part as either narrator or character
|
||||||
|
matched_text = match.group(0)
|
||||||
|
if matched_text.startswith('*') and matched_text.endswith('*'):
|
||||||
|
ordered_parts.append(('narrator', matched_text.strip('*').strip()))
|
||||||
|
elif matched_text.startswith('"') and matched_text.endswith('"'):
|
||||||
|
ordered_parts.append(('character', matched_text.strip('"').strip()))
|
||||||
|
else:
|
||||||
|
# In case of mixed or improperly formatted parts
|
||||||
|
if '*' in matched_text:
|
||||||
|
ordered_parts.append(('narrator', matched_text.strip('*').strip('"')))
|
||||||
|
else:
|
||||||
|
ordered_parts.append(('character', matched_text.strip('"').strip('*')))
|
||||||
|
|
||||||
|
# Update the start of the next segment
|
||||||
|
start = match.end()
|
||||||
|
|
||||||
|
# Add any remaining text after the last match as ambiguous
|
||||||
|
if start < len(text):
|
||||||
|
ambiguous_text = text[start:].strip()
|
||||||
|
if ambiguous_text:
|
||||||
|
ordered_parts.append(('ambiguous', ambiguous_text))
|
||||||
|
|
||||||
|
return ordered_parts
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
#### TTS STANDARD GENERATION ####
|
#### TTS STANDARD GENERATION ####
|
||||||
#################################
|
#################################
|
||||||
@@ -490,6 +565,7 @@ def output_modifier(string, state):
|
|||||||
if not params["activate"]:
|
if not params["activate"]:
|
||||||
return string
|
return string
|
||||||
original_string = string
|
original_string = string
|
||||||
|
#print("ORIGINAL STRING IS:", original_string)
|
||||||
cleaned_string = before_audio_generation(string, params)
|
cleaned_string = before_audio_generation(string, params)
|
||||||
if cleaned_string is None:
|
if cleaned_string is None:
|
||||||
return
|
return
|
||||||
@@ -500,85 +576,55 @@ def output_modifier(string, state):
|
|||||||
if process_lock.acquire(blocking=False):
|
if process_lock.acquire(blocking=False):
|
||||||
try:
|
try:
|
||||||
if params["narrator_enabled"]:
|
if params["narrator_enabled"]:
|
||||||
# print(original_string)
|
processed_parts = process_text(original_string)
|
||||||
# Do Some basic stripping and remove any double CR's
|
|
||||||
processed_string = (
|
|
||||||
original_string
|
|
||||||
.replace("***", "*")
|
|
||||||
.replace("**", "*")
|
|
||||||
.replace("\n\n", "\n")
|
|
||||||
)
|
|
||||||
# Clean up two asterisks (narrators) being made between a newline, making it one sentence.
|
|
||||||
processed_string = re.sub(r'\.\*\n\*', '. ', processed_string)
|
|
||||||
# Clean up a few other bits.
|
|
||||||
processed_string = (
|
|
||||||
processed_string
|
|
||||||
.replace("'", "'")
|
|
||||||
.replace("\n", " ")
|
|
||||||
# Add special characters to the quote so that we can use it to identify things later after its been split
|
|
||||||
.replace('"', '"<')
|
|
||||||
# Capture new conversations which wont have things like "e in them
|
|
||||||
.replace('"', '"<')
|
|
||||||
)
|
|
||||||
#capturing another outlier in inital character paragraph
|
|
||||||
# print("processed string 1 is:", processed_string)
|
|
||||||
processed_string = processed_string.replace('"<. *', '"< *"')
|
|
||||||
processed_string = processed_string.replace('< *"', '< *')
|
|
||||||
processed_string = processed_string.replace('. *', '< *')
|
|
||||||
# print("processed string 2 is:", processed_string)
|
|
||||||
# Set up a tracking of the individual wav files.
|
|
||||||
audio_files_all_paragraphs = []
|
audio_files_all_paragraphs = []
|
||||||
# Split the line using " and ".* " (so end of sentences, leaving special characters added to the start of all OTHER sentences, bar possibly the first one if its starting with a *
|
for part_type, part in processed_parts:
|
||||||
parts = re.split(r'"|\.\*', processed_string)
|
|
||||||
audio_files_paragraph = []
|
|
||||||
for i, part in enumerate(parts):
|
|
||||||
# Skip parts that are too short
|
# Skip parts that are too short
|
||||||
if len(part.strip()) <= 1:
|
if len(part.strip()) <= 3:
|
||||||
continue
|
continue
|
||||||
# Figure out which type of line it is, then replace characters as necessary to avoid TTS trying to pronunce them, htmlunescape after.
|
|
||||||
# Character will always be a < with a letter immediately after it
|
# Determine the voice to use based on the part type
|
||||||
if '<' in part and '< *' not in part and '<*' not in part and '< *' not in part and '< ' not in part and '< ' not in part:
|
if part_type == 'narrator':
|
||||||
cleaned_part = html.unescape(part.replace('<', ''))
|
|
||||||
voice_to_use = params["voice"]
|
|
||||||
#Narrator will always be an * or < with an * a position or two after it.
|
|
||||||
elif '<*' in part or '< *' in part or '< *' in part or '*' in part:
|
|
||||||
cleaned_part = html.unescape(part.replace('<*', '').replace('< *', '').replace('< *', '').replace('*', ''))
|
|
||||||
voice_to_use = params["narrator_voice"]
|
voice_to_use = params["narrator_voice"]
|
||||||
#If the other two dont capture it, aka, the AI gave no * or " on the line, use non_quoted_text_is aka user interface, user can choose Char or Narrator
|
print(f"[{params['branding']}TTSGen] \033[92mNarrator\033[0m") # Green
|
||||||
elif non_quoted_text_is:
|
elif part_type == 'character':
|
||||||
cleaned_part = html.unescape(part.replace('< ', '').replace('< ', '').replace('< ', ''))
|
|
||||||
voice_to_use = params["voice"]
|
voice_to_use = params["voice"]
|
||||||
|
print(f"[{params['branding']}TTSGen] \033[36mCharacter\033[0m") # Yellow
|
||||||
else:
|
else:
|
||||||
cleaned_part = html.unescape(part.replace('< ', '').replace('< ', '').replace('< ', ''))
|
# Handle ambiguous parts based on user preference
|
||||||
voice_to_use = params["narrator_voice"]
|
voice_to_use = params["voice"] if non_quoted_text_is else params["narrator_voice"]
|
||||||
# Check if character name exists and if not, just call it TTSOUT_
|
voice_description = "\033[36mCharacter (Text-not-inside)\033[0m" if non_quoted_text_is else "\033[92mNarrator (Text-not-inside)\033[0m"
|
||||||
if "character_menu" in state:
|
print(f"[{params['branding']}TTSGen] {voice_description}")
|
||||||
output_file = Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{int(time.time())}_{i}.wav')
|
|
||||||
else:
|
# Replace multiple exclamation marks, question marks, or other punctuation with a single instance
|
||||||
output_file = Path(f'{params["output_folder_wav"]}/TTSOUT_{int(time.time())}_{i}.wav')
|
cleaned_part = re.sub(r'([!?.])\1+', r'\1', part)
|
||||||
# Generate that TTS and output to a file
|
# Further clean to remove any other unwanted characters
|
||||||
output_file_str = output_file.as_posix()
|
cleaned_part = re.sub(r'[^a-zA-Z0-9\s\.,;:!?\-\'"]', '', cleaned_part)
|
||||||
|
# Remove all newline characters (single or multiple)
|
||||||
|
cleaned_part = re.sub(r'\n+', ' ', cleaned_part)
|
||||||
|
|
||||||
|
# Generate TTS and output to a file
|
||||||
|
output_filename = get_output_filename(state)
|
||||||
generate_response = send_generate_request(
|
generate_response = send_generate_request(
|
||||||
cleaned_part, voice_to_use, language_code, output_file_str
|
cleaned_part, voice_to_use, language_code, output_filename
|
||||||
)
|
)
|
||||||
audio_path = generate_response.get("data", {}).get("audio_path")
|
audio_path = generate_response.get("data", {}).get("audio_path")
|
||||||
audio_files_paragraph.append(audio_path)
|
audio_files_all_paragraphs.append(audio_path)
|
||||||
# Accumulate audio files within the paragraph
|
|
||||||
audio_files_all_paragraphs.extend(audio_files_paragraph)
|
|
||||||
# Combine audio files across paragraphs
|
# Combine audio files across paragraphs
|
||||||
final_output_file = combine(
|
final_output_file = combine(
|
||||||
audio_files_all_paragraphs, params["output_folder_wav"], state
|
audio_files_all_paragraphs, params["output_folder_wav"], state
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
processed_string = (
|
# Decode HTML entities first
|
||||||
original_string
|
cleaned_part = html.unescape(original_string)
|
||||||
.replace("***", "")
|
# Replace multiple instances of certain punctuation marks with a single instance
|
||||||
.replace("**", "")
|
cleaned_part = re.sub(r'([!?.])\1+', r'\1', cleaned_part)
|
||||||
.replace("*", "")
|
# Further clean to remove any other unwanted characters
|
||||||
.replace("\n\n", "\n")
|
cleaned_part = re.sub(r'[^a-zA-Z0-9\s\.,;:!?\-\'"]', '', cleaned_part)
|
||||||
.replace("'", "'")
|
# Remove all newline characters (single or multiple)
|
||||||
)
|
cleaned_part = re.sub(r'\n+', ' ', cleaned_part)
|
||||||
cleaned_part = html.unescape(processed_string)
|
|
||||||
# Process the part and give it a non-character name if being used vai API or standalone.
|
# Process the part and give it a non-character name if being used vai API or standalone.
|
||||||
if "character_menu" in state:
|
if "character_menu" in state:
|
||||||
output_file = Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{int(time.time())}.wav')
|
output_file = Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{int(time.time())}.wav')
|
||||||
@@ -627,9 +673,10 @@ def output_modifier(string, state):
|
|||||||
|
|
||||||
|
|
||||||
def get_output_filename(state):
|
def get_output_filename(state):
|
||||||
return Path(
|
if "character_menu" in state:
|
||||||
f'{params["output_folder_wav"]}/{state["character_menu"]}_{str(uuid.uuid4())[:8]}.wav'
|
return Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{str(uuid.uuid4())[:8]}.wav').as_posix()
|
||||||
).as_posix()
|
else:
|
||||||
|
return Path(f'{params["output_folder_wav"]}/TTSOUT_{str(uuid.uuid4())[:8]}.wav').as_posix()
|
||||||
|
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
@@ -685,10 +732,6 @@ def input_modifier(string, state):
|
|||||||
shared.processing_message = "*Is recording a voice message...*"
|
shared.processing_message = "*Is recording a voice message...*"
|
||||||
return string
|
return string
|
||||||
|
|
||||||
def custom_css():
|
|
||||||
path_to_css = Path(f"{this_dir}/style.css")
|
|
||||||
return open(path_to_css, "r").read()
|
|
||||||
|
|
||||||
|
|
||||||
def ui():
|
def ui():
|
||||||
with gr.Accordion(params["branding"] + " TTS (XTTSv2)"):
|
with gr.Accordion(params["branding"] + " TTS (XTTSv2)"):
|
||||||
@@ -782,14 +825,17 @@ def ui():
|
|||||||
deepspeed_checkbox_play = gr.HTML(visible=False)
|
deepspeed_checkbox_play = gr.HTML(visible=False)
|
||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
|
model_loader_choices=["API TTS", "API Local", "XTTSv2 Local"]
|
||||||
|
if finetuned_model:
|
||||||
|
model_loader_choices.append("XTTSv2 FT")
|
||||||
tts_radio_buttons = gr.Radio(
|
tts_radio_buttons = gr.Radio(
|
||||||
choices=["API TTS", "API Local", "XTTSv2 Local"],
|
choices=model_loader_choices,
|
||||||
label="Select TTS Generation Method (Read NOTE)",
|
label="Select TTS Generation Method (Read NOTE)",
|
||||||
value=gr_modelchoice, # Set the default value
|
value=gr_modelchoice, # Set the default value
|
||||||
)
|
)
|
||||||
tts_radio_buttons_play = gr.HTML(visible=False)
|
tts_radio_buttons_play = gr.HTML(visible=False)
|
||||||
explanation_text = gr.HTML(
|
explanation_text = gr.HTML(
|
||||||
f"<p>NOTE: Switching Model Type, Low VRAM & DeepSpeed takes 15 seconds. Each TTS generation method has a slightly different sound. DeepSpeed checkbox is only visible if DeepSpeed is present. Readme & Settings: <a href='http://{params['ip_address']}:{params['port_number']}'>http://{params['ip_address']}:{params['port_number']}</a>"
|
f"<p>⚙️ <a href='http://{params['ip_address']}:{params['port_number']}'>Click here for the Settings page, help & instructions</a><a href='http://{params['ip_address']}:{params['port_number']}'></a>⚙️<br>NOTE: Switching Model Type, Low VRAM & DeepSpeed, each takes 15 seconds. Each TTS generation method has a slightly different sound. DeepSpeed checkbox is only visible if DeepSpeed is installed on your system."
|
||||||
)
|
)
|
||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
@@ -888,4 +934,4 @@ if running_in_standalone:
|
|||||||
try:
|
try:
|
||||||
time.sleep(1) # Add a small delay to avoid high CPU usage
|
time.sleep(1) # Add a small delay to avoid high CPU usage
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
break # Allow graceful exit on Ctrl+C
|
break # Allow graceful exit on Ctrl+C
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
.SDAP .hires_opts input[type="number"] {
|
|
||||||
width: 6em !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* silero_tts preview */
|
|
||||||
.form:has(> #silero_preview_text) {
|
|
||||||
min-width: 75%
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,584 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>AllTalk TTS Generator</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body,
|
||||||
|
textarea,
|
||||||
|
select,
|
||||||
|
input[type="range"],
|
||||||
|
input[type="number"],
|
||||||
|
button {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 20px;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #333;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-container {
|
||||||
|
max-width: 80%;
|
||||||
|
margin: 50px auto;
|
||||||
|
padding: 20px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-section {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
/* Align items to the start */
|
||||||
|
align-items: center;
|
||||||
|
/* Align items vertically */
|
||||||
|
gap: 20px;
|
||||||
|
/* This creates a consistent gap between all child elements */
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
/* Space from bottom if wrapped */
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
/* Removed flex property to stop forcing them to grow */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
label {
|
||||||
|
font-size: 0.9em;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
resize: vertical;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure select and input elements do not exceed the width of their parent */
|
||||||
|
select,
|
||||||
|
input[type="range"],
|
||||||
|
input[type="number"] {
|
||||||
|
width: 100%;
|
||||||
|
/* They will fill the width of their .setting container */
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
|
||||||
|
select,
|
||||||
|
input[type="range"],
|
||||||
|
input[type="number"] {
|
||||||
|
width: auto;
|
||||||
|
/* Only auto width for larger screens */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
button {
|
||||||
|
background-color: #4caf50;
|
||||||
|
color: #fff;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background-color: #45a049;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark-mode {
|
||||||
|
background-color: #121212;
|
||||||
|
color: #ffffff;
|
||||||
|
/* Text color for dark mode background */
|
||||||
|
}
|
||||||
|
|
||||||
|
.dark-mode .form-container {
|
||||||
|
background-color: #1e1e1e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modify the text color for elements within dark mode */
|
||||||
|
.dark-mode label,
|
||||||
|
.dark-mode textarea,
|
||||||
|
.dark-mode select,
|
||||||
|
.dark-mode input[type="range"],
|
||||||
|
.dark-mode input[type="number"],
|
||||||
|
.dark-mode button,
|
||||||
|
.dark-mode .error {
|
||||||
|
color: #ffffff;
|
||||||
|
/* Text color for dark mode elements */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modify text color for input elements, textarea, and dropdowns in dark mode */
|
||||||
|
.dark-mode input,
|
||||||
|
.dark-mode textarea,
|
||||||
|
.dark-mode select {
|
||||||
|
color: #000000;
|
||||||
|
/* Text color for input elements, textarea, and dropdowns in dark mode */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set background color for textarea in dark mode */
|
||||||
|
.dark-mode textarea {
|
||||||
|
background-color: #C0C0C0;
|
||||||
|
/* Light grey background color for textarea in dark mode */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set background color for option elements within select in dark mode */
|
||||||
|
.dark-mode select {
|
||||||
|
background-color: #C0C0C0;
|
||||||
|
/* Light grey background color for options in dark mode */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Additional styles if needed for fixed-width dropdowns */
|
||||||
|
.fixed-size-dropdown {
|
||||||
|
width: 130px;
|
||||||
|
/* Adjust the width as needed */
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
border: 5px solid #f3f3f3;
|
||||||
|
border-top: 5px solid #3498db;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
animation: spin 2s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.error {
|
||||||
|
color: #ff0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Add space between sliders */
|
||||||
|
.slider-setting {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Adjust the thumb appearance for a more standard line slider look */
|
||||||
|
input[type="range"]::-webkit-slider-thumb,
|
||||||
|
input[type="range"]::-moz-range-thumb,
|
||||||
|
input[type="range"]::-ms-thumb {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
width: 16px;
|
||||||
|
/* Smaller width for a more standard thumb size */
|
||||||
|
height: 16px;
|
||||||
|
/* Smaller height for a more standard thumb size */
|
||||||
|
border-radius: 50%;
|
||||||
|
/* Keep it rounded, or set to 0 for square */
|
||||||
|
background: #3071a9;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-top: -7px;
|
||||||
|
/* Adjust if needed to align thumb with the track */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<h1>AllTalk TTS Generator</h1>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<div class="input-section">
|
||||||
|
<label for="text_input">Text Input:</label>
|
||||||
|
<textarea id="text_input" rows="8"></textarea> <!-- Removed cols attribute -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="settings-section">
|
||||||
|
|
||||||
|
<div class="setting voice-setting">
|
||||||
|
<label for="character_voice_gen">Character Voice:</label>
|
||||||
|
<select id="character_voice_gen"></select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="setting language-setting">
|
||||||
|
<label for="language">Language:</label>
|
||||||
|
<select id="language" name="language" class="fixed-size-dropdown">
|
||||||
|
<option value="ar">Arabic</option>
|
||||||
|
<option value="zh-cn">Chinese (Simplified)</option>
|
||||||
|
<option value="cs">Czech</option>
|
||||||
|
<option value="nl">Dutch</option>
|
||||||
|
<option value="en" selected>English</option>
|
||||||
|
<option value="fr">French</option>
|
||||||
|
<option value="de">German</option>
|
||||||
|
<option value="hu">Hungarian</option>
|
||||||
|
<option value="it">Italian</option>
|
||||||
|
<option value="ja">Japanese</option>
|
||||||
|
<option value="ko">Korean</option>
|
||||||
|
<option value="pl">Polish</option>
|
||||||
|
<option value="pt">Portuguese</option>
|
||||||
|
<option value="ru">Russian</option>
|
||||||
|
<option value="es">Spanish</option>
|
||||||
|
<option value="tr">Turkish</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="setting play-mode-setting">
|
||||||
|
<label for="playMode">Playback:</label>
|
||||||
|
<select id="playMode" name="playMode" class="fixed-size-dropdown">
|
||||||
|
<option value="local" selected>In Browser</option>
|
||||||
|
<option value="remote">On Server</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="setting theme-mode-setting">
|
||||||
|
<label for="themeMode">Theme:</label>
|
||||||
|
<select id="themeMode" name="themeMode" class="fixed-size-dropdown">
|
||||||
|
<option value="light" selected>Light</option>
|
||||||
|
<option value="dark">Dark</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="setting chunk-size-setting">
|
||||||
|
<label for="chunkSize">Sentence Chunk Size:</label>
|
||||||
|
<input type="range" id="chunkSize" name="chunkSize" class="slider-setting" min="1" max="10" value="4"
|
||||||
|
oninput="updateChunkSizeValue(this.value)">
|
||||||
|
<span id="chunkSizeValue">3</span> <!-- Display the value of the slider -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="setting volume-setting">
|
||||||
|
<label for="volume">Volume:</label>
|
||||||
|
<input type="range" id="volume" name="volume" class="slider-setting" min="0.1" max="1.0" step="0.1"
|
||||||
|
value="0.8" oninput="updateVolumeValue(this.value)">
|
||||||
|
<span id="volumeValue">0.8</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="action-buttons">
|
||||||
|
<button onclick="generateTTS()">Generate TTS</button>
|
||||||
|
<button onclick="stopPlayback()">Stop Playback</button>
|
||||||
|
<button onclick="previewVoice()">Preview Voice</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="progressIndicator" class="progress-overlay" style="display: none;">
|
||||||
|
<div class="spinner"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
async function fetchVoices() {
|
||||||
|
try {
|
||||||
|
const response = await fetch("http://127.0.0.1:7851/api/voices");
|
||||||
|
const result = await response.json();
|
||||||
|
const characterVoiceSelect = document.getElementById("character_voice_gen");
|
||||||
|
|
||||||
|
result.voices.forEach(voice => {
|
||||||
|
const option = document.createElement("option");
|
||||||
|
option.value = voice;
|
||||||
|
option.text = voice;
|
||||||
|
characterVoiceSelect.add(option);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateVolumeValue(value) {
|
||||||
|
document.getElementById("volumeValue").innerText = value;
|
||||||
|
|
||||||
|
// Set the volume for browser playback
|
||||||
|
audioElement.volume = parseFloat(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
let stopTTSGeneration = false;
|
||||||
|
let audioQueue = [];
|
||||||
|
let currentlyPlaying = false;
|
||||||
|
const audioElement = new Audio();
|
||||||
|
|
||||||
|
async function generateTTS() {
|
||||||
|
try {
|
||||||
|
// Reset the flag at the start
|
||||||
|
stopTTSGeneration = false;
|
||||||
|
|
||||||
|
const textInput = document.getElementById("text_input").value;
|
||||||
|
const language = document.getElementById("language").value;
|
||||||
|
const characterVoice = document.getElementById("character_voice_gen").value;
|
||||||
|
const volume = parseFloat(document.getElementById("volume").value);
|
||||||
|
const chunkSize = parseInt(document.getElementById("chunkSize").value);
|
||||||
|
// Retrieve the value of the selected option for playMode from the dropdown
|
||||||
|
const playModeValue = document.getElementById("playMode").value;
|
||||||
|
|
||||||
|
// Clean up the textInput
|
||||||
|
let cleanedText = textInput.replace(/ \- | \– /g, ' '); // Replaces " - " and " – " with " "
|
||||||
|
cleanedText = cleanedText.replace(/\.\s'/g, ".'"); // Correctly remove space between a period and a single quote
|
||||||
|
cleanedText = cleanedText.replace(/'/g, ""); // Remove all single quotes
|
||||||
|
|
||||||
|
// Split text into chunks based on the specified number of sentences
|
||||||
|
const sentences = cleanedText.match(/("[^"]+"|[^.!?]+[.!?]+)/g);
|
||||||
|
const chunks = [];
|
||||||
|
for (let i = 0; i < sentences.length; i += chunkSize) {
|
||||||
|
let chunk = sentences.slice(i, i + chunkSize).map(s => s.trim()).join(' ');
|
||||||
|
chunks.push(chunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use playModeValue for the conditional check
|
||||||
|
if (playModeValue === "remote") {
|
||||||
|
for (const chunk of chunks) {
|
||||||
|
if (stopTTSGeneration) break; // Stop if flag is set
|
||||||
|
await generateAndPlayRemote(chunk, language, characterVoice, volume);
|
||||||
|
}
|
||||||
|
} else if (playModeValue === "local") {
|
||||||
|
generateAndPlayLocal(chunks, 0);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error in generateTTS:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async function generateAndPlayLocal(chunks, index) {
|
||||||
|
if (index >= chunks.length || stopTTSGeneration) {
|
||||||
|
return; // Stop if no more chunks or flag is set
|
||||||
|
}
|
||||||
|
if (index >= chunks.length) {
|
||||||
|
// No more chunks to process
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const chunk = chunks[index];
|
||||||
|
const data = new URLSearchParams({
|
||||||
|
text_input: chunk.trim(),
|
||||||
|
text_filtering: "standard",
|
||||||
|
character_voice_gen: document.getElementById("character_voice_gen").value,
|
||||||
|
narrator_enabled: "false",
|
||||||
|
narrator_voice_gen: document.getElementById("character_voice_gen").value,
|
||||||
|
text_not_inside: "character",
|
||||||
|
language: document.getElementById("language").value,
|
||||||
|
output_file_name: "myoutputfile",
|
||||||
|
output_file_timestamp: "true",
|
||||||
|
autoplay: "false",
|
||||||
|
autoplay_volume: document.getElementById("volume").value
|
||||||
|
});
|
||||||
|
|
||||||
|
const response = await fetch("http://127.0.0.1:7851/api/tts-generate", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
},
|
||||||
|
body: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
if (result.output_file_url) {
|
||||||
|
audioQueue.push(result.output_file_url);
|
||||||
|
if (!currentlyPlaying) {
|
||||||
|
playNextLocalChunk();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recursively call the function with the next index
|
||||||
|
generateAndPlayLocal(chunks, index + 1);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error in generateAndPlayLocal with chunk index", index, ":", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateAndPlayRemote(chunk, language, characterVoice, volume) {
|
||||||
|
try {
|
||||||
|
if (stopTTSGeneration) {
|
||||||
|
console.log("TTS generation stopped.");
|
||||||
|
return; // Early return if stop flag is set
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = new URLSearchParams({
|
||||||
|
text_input: chunk.trim(),
|
||||||
|
text_filtering: "standard",
|
||||||
|
character_voice_gen: characterVoice,
|
||||||
|
narrator_enabled: "false",
|
||||||
|
narrator_voice_gen: characterVoice,
|
||||||
|
text_not_inside: "character",
|
||||||
|
language: language,
|
||||||
|
output_file_name: "myoutputfile",
|
||||||
|
output_file_timestamp: "true",
|
||||||
|
autoplay: "true",
|
||||||
|
autoplay_volume: volume.toString(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const response = await fetch("http://127.0.0.1:7851/api/tts-generate", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
},
|
||||||
|
body: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`API error: ${result.detail || 'Unknown error'}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("TTS generation complete for chunk:", chunk);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error in generateAndPlayRemote:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function previewVoice() {
|
||||||
|
const characterVoice = document.getElementById("character_voice_gen").value;
|
||||||
|
try {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("voice", characterVoice);
|
||||||
|
|
||||||
|
const response = await fetch("http://127.0.0.1:7851/api/previewvoice/", {
|
||||||
|
method: "POST",
|
||||||
|
body: formData,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
if (result.status === "generate-success") {
|
||||||
|
// Play the preview audio
|
||||||
|
const audioPreview = new Audio(result.output_file_url);
|
||||||
|
audioPreview.play();
|
||||||
|
} else {
|
||||||
|
throw new Error('Preview generation failed');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error in previewVoice:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function playNextLocalChunk() {
|
||||||
|
if (audioQueue.length > 0) {
|
||||||
|
currentlyPlaying = true;
|
||||||
|
const audioUrl = audioQueue.shift();
|
||||||
|
audioElement.src = audioUrl;
|
||||||
|
audioElement.play();
|
||||||
|
|
||||||
|
audioElement.onended = () => {
|
||||||
|
currentlyPlaying = false;
|
||||||
|
playNextLocalChunk();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleThemeMode() {
|
||||||
|
// Retrieve the value of the selected option for themeMode from the dropdown
|
||||||
|
const themeModeValue = document.getElementById('themeMode').value;
|
||||||
|
|
||||||
|
if (themeModeValue === "dark") {
|
||||||
|
document.body.classList.add('dark-mode');
|
||||||
|
localStorage.setItem('darkMode', 'enabled'); // Assuming saveDarkModePreference sets this
|
||||||
|
} else {
|
||||||
|
document.body.classList.remove('dark-mode');
|
||||||
|
localStorage.setItem('darkMode', 'disabled'); // Assuming saveDarkModePreference sets this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateChunkSizeValue(value) {
|
||||||
|
document.getElementById("chunkSizeValue").innerText = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Optionally, save the dark mode preference in localStorage
|
||||||
|
function saveDarkModePreference(isDarkMode) {
|
||||||
|
localStorage.setItem('darkMode', isDarkMode ? 'enabled' : 'disabled');
|
||||||
|
}
|
||||||
|
|
||||||
|
function stopPlayback() {
|
||||||
|
// Stop current audio playback
|
||||||
|
audioElement.pause();
|
||||||
|
audioElement.currentTime = 0;
|
||||||
|
|
||||||
|
// Clear the audio queue, reset playback flag, and stop further TTS generation
|
||||||
|
audioQueue = [];
|
||||||
|
currentlyPlaying = false;
|
||||||
|
stopTTSGeneration = true; // Set flag to stop TTS generation
|
||||||
|
}
|
||||||
|
|
||||||
|
function showProgress() {
|
||||||
|
document.getElementById('progressIndicator').style.display = 'flex';
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideProgress() {
|
||||||
|
document.getElementById('progressIndicator').style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
function displayOutput(result) {
|
||||||
|
const outputContainer = document.getElementById("output");
|
||||||
|
outputContainer.innerHTML = `<p>Status: ${result.status}</p>`;
|
||||||
|
if (result.output_file_path) {
|
||||||
|
outputContainer.innerHTML += `<p>File Path: ${result.output_file_path}</p>`;
|
||||||
|
}
|
||||||
|
if (result.output_file_url) {
|
||||||
|
outputContainer.innerHTML += `<p>File URL: ${result.output_file_url}</p>`;
|
||||||
|
}
|
||||||
|
if (result.error) {
|
||||||
|
outputContainer.innerHTML += `<p class="error">Error: ${result.error}</p>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
fetchVoices();
|
||||||
|
|
||||||
|
const isDarkModeEnabled = localStorage.getItem('darkMode') === 'enabled';
|
||||||
|
const themeModeSelect = document.getElementById('themeMode');
|
||||||
|
if (isDarkModeEnabled) {
|
||||||
|
document.body.classList.add('dark-mode');
|
||||||
|
themeModeSelect.value = 'dark';
|
||||||
|
} else {
|
||||||
|
themeModeSelect.value = 'light';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add change event listener to the themeMode dropdown
|
||||||
|
themeModeSelect.addEventListener('change', toggleThemeMode);
|
||||||
|
|
||||||
|
// Initialize other elements if necessary
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -201,12 +201,12 @@
|
|||||||
value="{{ data.output_folder_wav }}" />
|
value="{{ data.output_folder_wav }}" />
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" id="model_loaded" name="model_loaded" value="{{ data.model_loaded }}" />
|
<input type="hidden" id="tts_model_loaded" name="tts_model_loaded" value="{{ data.tts_model_loaded }}" />
|
||||||
|
|
||||||
<!-- Continue updating other dropdowns and inputs in a similar manner -->
|
<!-- Continue updating other dropdowns and inputs in a similar manner -->
|
||||||
|
|
||||||
<label for="model_name" style="color: red;"> API TTS Model Name:</label>
|
<label for="tts_model_name" style="color: red;"> API TTS Model Name:</label>
|
||||||
<input id="model_name" name="model_name" required="" type="text" value="{{ data.model_name }}" />
|
<input id="tts_model_name" name="tts_model_name" required="" type="text" value="{{ data.tts_model_name }}" />
|
||||||
|
|
||||||
<label for="model_version"
|
<label for="model_version"
|
||||||
style="color: red; font-size: 16px; line-height: 1; vertical-align: bottom; margin-bottom: 0;">
|
style="color: red; font-size: 16px; line-height: 1; vertical-align: bottom; margin-bottom: 0;">
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 547 KiB After Width: | Height: | Size: 547 KiB |
Binary file not shown.
+491
-665
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user