Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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
+5
-160
@@ -1,160 +1,5 @@
|
|||||||
# Byte-compiled / optimized / DLL files
|
voices/*.*
|
||||||
__pycache__/
|
models/*.*
|
||||||
*.py[cod]
|
outputs/*.*
|
||||||
*$py.class
|
confignew.json
|
||||||
|
models.json
|
||||||
# C extensions
|
|
||||||
*.so
|
|
||||||
|
|
||||||
# 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/
|
|
||||||
@@ -11,6 +11,15 @@ AllTalk is an updated version of the Coqui_tts extension for Text Generation web
|
|||||||
- **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.
|
- **Standalone/3rd Party support via JSON calls** Can be used with 3rd party applications via JSON calls.
|
||||||
|
|
||||||
|
## Index
|
||||||
|
|
||||||
|
- 🟩 [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)
|
||||||
|
- 🔵🟢🟡 [DeepSpeed Installation (Windows & Linux)](https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options)
|
||||||
|
- 🔴 [Future to-do list & Upcoming updates](https://github.com/erew123/alltalk_tts?#-future-to-do-list)
|
||||||
|
|
||||||
#### Updates
|
#### Updates
|
||||||
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.
|
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.
|
||||||
|
|
||||||
@@ -26,39 +35,34 @@ I could force a delimeter in at this stage, but I know it would/may affect thing
|
|||||||
`"`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.`"`
|
`"`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:
|
|
||||||
|
|
||||||
|
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:<br><br>
|
||||||
|
|
||||||
`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`
|
`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 the requirements:<br><br>
|
||||||
|
*Nvidia graphics card machines* - `pip install -r requirements_nvidia.txt`<br><br>
|
||||||
*Nvidia graphics card machines* - `pip install -r requirements_nvidia.txt`
|
|
||||||
|
|
||||||
*Other machines (mac, amd etc)* - `pip install -r requirements_other.txt`
|
*Other machines (mac, amd etc)* - `pip install -r requirements_other.txt`
|
||||||
|
|
||||||
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.
|
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). Though you may wish to check things are generally working with the below steps before installing DeepSpeed.
|
||||||
|
|
||||||
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)
|
8) 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.
|
||||||
|
|
||||||
9) Some extra voices downloadable [here](https://drive.google.com/file/d/1bYdZdr3L69kmzUN3vSiqZmLRD7-A3M47/view?usp=drive_link)
|
9) 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) 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.
|
**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.
|
||||||
|
|
||||||
@@ -73,75 +77,151 @@ Once the extension is loaded, please find all documentation and settings on the
|
|||||||
|
|
||||||
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`.
|
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`.
|
||||||
|
|
||||||
## Screenshots
|
### 🟪 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`
|
||||||
|
|
||||||
|
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 requirements:<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`
|
||||||
|
|
||||||
|
#### 🟪 **git pull error**
|
||||||
|
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/*.*
|
||||||
|
config.json
|
||||||
|
models.json
|
||||||
|
```
|
||||||
|
### 🟪 Problems Updating
|
||||||
|
|
||||||
|
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 requirements:<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.
|
||||||
|
|
||||||
|
## 🟫 Screenshots
|
||||||
| |  |
|
| |  |
|
||||||
|:---:|:---:|
|
|:---:|:---:|
|
||||||
| |  |
|
| |  |
|
||||||
|
|
||||||
## DeepSpeed Installation Options
|
## 🟨 Help with problems
|
||||||
|
|
||||||
|
#### 🟨 I activated DeepSpeed in the settings page, but I didnt install DeepSpeed yet and now I have issues starting up
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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?tab=readme-ov-file#deepspeed-installation-options).
|
||||||
|
|
||||||
|
#### 🟨 I am having problems getting AllTalk to start after changing settings or making a custom setup/model setup.
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
#### 🟨 I see some red "asyncio" messages
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
#### 🟨 I am having problems updating/some other issue where it wont start up/Im sure this is a bug
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
## 🔵🟢🟡 DeepSpeed Installation Options
|
||||||
### 🔵 For Linux
|
### 🔵 For Linux
|
||||||
|
➡️DeepSpeed requires an Nvidia Graphics card!⬅️
|
||||||
|
|
||||||
Covered in the online/buit-in documentation, but a nice easy install.
|
Covered in the online/buit-in documentation, but a nice easy install.
|
||||||
|
|
||||||
### 🟢🟡 For Windows & Python 3.11
|
### 🟢🟡 For Windows & Python 3.11.x or 3.10.x
|
||||||
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).
|
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).
|
||||||
|
|
||||||
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)
|
#### Pre-Compiled Wheel Deepspeed v11.1 (for Windows and Python 3.11)
|
||||||
[@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:
|
➡️DeepSpeed requires an Nvidia Graphics card!⬅️
|
||||||
|
|
||||||
**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.
|
**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 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.
|
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.
|
||||||
|
|
||||||
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:<br><br>
|
||||||
|
|
||||||
`pip install "deepspeed-0.11.1+e9503fe-cp311-cp311-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.1 installed within the Python 3.11 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.
|
||||||
|
|
||||||
#### 🟡 OPTION 2 - A bit more complicated!
|
#### 🟡 OPTION 2 - A bit more complicated!
|
||||||
|
|
||||||
#### Manual Build DeepSpeed v11.2 (for Windows and Python 3.11)
|
#### Manual Build DeepSpeed v11.2 (for Windows and Python 3.11)
|
||||||
DeepSpeed Version 11.2 with CUDA 12.1 - Installation Instructions:
|
➡️DeepSpeed requires an Nvidia Graphics card!⬅️
|
||||||
|
|
||||||
|
DeepSpeed Version 11.2 with CUDA 11.8 or 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, 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>
|
||||||
|
```conda create -n pythonenv python=3.11```<br>
|
||||||
|
```activate pythonenv```<br><br>
|
||||||
|
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>
|
||||||
|
|
||||||
|
5. Launch the Command Prompt cmd with Administrator privilege as it requires admin to allow creating symlink folders.
|
||||||
|
6. Install PyTorch, 2.1.0 with CUDA 12.1 into your Python 3.11 environment e.g:<br><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```<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>
|
||||||
|
7. 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><br>
|
||||||
```set CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1```<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>
|
```set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1```<br>
|
||||||
|
rr<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>
|
||||||
|
|
||||||
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>
|
8. Navigate to your deepspeed folder in the Command Prompt:<br><br>
|
||||||
```conda create -n pythonenv python=3.11```<br>
|
|
||||||
```activate pythonenv```<br>
|
|
||||||
|
|
||||||
6. 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>
|
|
||||||
```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```
|
|
||||||
|
|
||||||
8. In your python environment check that your CUDA_HOME and CUDA_PATH are still pointing to the correct location.<br>
|
|
||||||
```set``` (to list and check the windows environment variables. Refer to step 4 if not)
|
|
||||||
|
|
||||||
9. Navigate to your deepspeed folder in the Command Prompt:<br>
|
|
||||||
```cd c:\deepspeed``` (wherever you extracted it to)
|
```cd c:\deepspeed``` (wherever you extracted it to)
|
||||||
|
|
||||||
10. Modify the following files:<br>
|
9. Modify the following files:<br>
|
||||||
|
**(These modified files are included in the git-pull of AllTalk, in the DeepSpeed Windows folder 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 +277,15 @@ 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).
|
||||||
|
|
||||||
|
### 🔴 Future to-do list
|
||||||
|
- Complete & document the new/full standalone mode API.
|
||||||
|
- Voice output within the command prompt/terminal (TBD).
|
||||||
|
- Correct an issue on incorrect output folder path when running as a standalone app.
|
||||||
|
- Correct a few spelling mistakes in the documnentation.
|
||||||
|
- 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"}
|
||||||
+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
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
numpy>=1.22.0
|
numpy>=1.22.0
|
||||||
soundfile>=0.12.1
|
soundfile>=0.12.1
|
||||||
uvicorn>=0.24.0.post1
|
uvicorn>=0.24.0.post1
|
||||||
TTS>=0.21.3
|
TTS>=0.22.0
|
||||||
torch>=2.1.0+cu118
|
torch>=2.1.0+cu118
|
||||||
torchaudio>=2.1.0+cu118
|
torchaudio>=2.1.0+cu118
|
||||||
fastapi>=0.104.1
|
fastapi>=0.104.1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
numpy>=1.22.0
|
numpy>=1.22.0
|
||||||
soundfile>=0.12.1
|
soundfile>=0.12.1
|
||||||
uvicorn>=0.24.0.post1
|
uvicorn>=0.24.0.post1
|
||||||
TTS>=0.21.3
|
TTS>=0.22.0
|
||||||
torch>=2.1.0
|
torch>=2.1.0
|
||||||
torchaudio>=2.1.0
|
torchaudio>=2.1.0
|
||||||
fastapi>=0.104.1
|
fastapi>=0.104.1
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -143,9 +143,9 @@ def check_required_files():
|
|||||||
check_required_files()
|
check_required_files()
|
||||||
|
|
||||||
|
|
||||||
#################################################
|
####################################################
|
||||||
#### 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"
|
||||||
@@ -277,7 +277,7 @@ else:
|
|||||||
# 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):
|
||||||
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 +285,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
|
||||||
@@ -319,7 +319,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 +332,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 +348,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 +362,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 +400,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"
|
||||||
)
|
)
|
||||||
@@ -789,7 +789,7 @@ def ui():
|
|||||||
)
|
)
|
||||||
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>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 present. Readme & Settings: <a href='http://{params['ip_address']}:{params['port_number']}'>http://{params['ip_address']}:{params['port_number']}</a>"
|
||||||
)
|
)
|
||||||
|
|
||||||
with gr.Row():
|
with gr.Row():
|
||||||
|
|||||||
@@ -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;">
|
||||||
|
|||||||
+44
-37
@@ -20,6 +20,7 @@ from fastapi import (
|
|||||||
from fastapi.responses import JSONResponse, HTMLResponse, RedirectResponse, FileResponse
|
from fastapi.responses import JSONResponse, HTMLResponse, RedirectResponse, FileResponse
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
from fastapi.staticfiles import StaticFiles
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
from jinja2 import Template
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
@@ -34,9 +35,9 @@ with open(this_dir / "languages.json", encoding="utf8") as f:
|
|||||||
languages = json.load(f)
|
languages = json.load(f)
|
||||||
|
|
||||||
|
|
||||||
##############################################################
|
#################################################################
|
||||||
#### LOAD PARAMS FROM CONFIG.JSON - REQUIRED FOR BRANDING ####
|
#### LOAD PARAMS FROM confignew.json - REQUIRED FOR BRANDING ####
|
||||||
##############################################################
|
#################################################################
|
||||||
# Load config file and get settings
|
# Load config file and get settings
|
||||||
def load_config(file_path):
|
def load_config(file_path):
|
||||||
with open(file_path, "r") as configfile_path:
|
with open(file_path, "r") as configfile_path:
|
||||||
@@ -44,10 +45,10 @@ def load_config(file_path):
|
|||||||
return configfile_data
|
return configfile_data
|
||||||
|
|
||||||
|
|
||||||
# Define the path to the config.json file
|
# Define the path to the confignew.json file
|
||||||
configfile_path = this_dir / "config.json"
|
configfile_path = this_dir / "confignew.json"
|
||||||
|
|
||||||
# Load config.json and assign it to a different variable (config_data)
|
# Load confignew.json and assign it to a different variable (config_data)
|
||||||
params = load_config(configfile_path)
|
params = load_config(configfile_path)
|
||||||
# check someone hasnt enabled lowvram on a system thats not cuda enabled
|
# check someone hasnt enabled lowvram on a system thats not cuda enabled
|
||||||
params["low_vram"] = "false" if not torch.cuda.is_available() else params["low_vram"]
|
params["low_vram"] = "false" if not torch.cuda.is_available() else params["low_vram"]
|
||||||
@@ -130,7 +131,7 @@ async def setup():
|
|||||||
# Start loading the correct model as set by "tts_method_api_tts", "tts_method_api_local" or "tts_method_xtts_local" being True/False
|
# Start loading the correct model as set by "tts_method_api_tts", "tts_method_api_local" or "tts_method_xtts_local" being True/False
|
||||||
if params["tts_method_api_tts"]:
|
if params["tts_method_api_tts"]:
|
||||||
print(
|
print(
|
||||||
f"[{params['branding']}Model] \033[94mAPI TTS Loading\033[0m {params['model_name']} \033[94minto\033[93m",
|
f"[{params['branding']}Model] \033[94mAPI TTS Loading\033[0m {params['tts_model_name']} \033[94minto\033[93m",
|
||||||
device,
|
device,
|
||||||
"\033[0m",
|
"\033[0m",
|
||||||
)
|
)
|
||||||
@@ -157,8 +158,8 @@ async def setup():
|
|||||||
print(
|
print(
|
||||||
f"[{params['branding']}Model] \033[94mModel Loaded in \033[93m{generate_elapsed_time:.2f} seconds.\033[0m"
|
f"[{params['branding']}Model] \033[94mModel Loaded in \033[93m{generate_elapsed_time:.2f} seconds.\033[0m"
|
||||||
)
|
)
|
||||||
# Set "model_loaded" to true
|
# Set "tts_model_loaded" to true
|
||||||
params["model_loaded"] = True
|
params["tts_model_loaded"] = True
|
||||||
# Set the output path for wav files
|
# Set the output path for wav files
|
||||||
Path(f'{params["output_folder_wav"]}').mkdir(parents=True, exist_ok=True)
|
Path(f'{params["output_folder_wav"]}').mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
@@ -166,7 +167,7 @@ async def setup():
|
|||||||
# MODEL LOADER For "API TTS"
|
# MODEL LOADER For "API TTS"
|
||||||
async def api_load_model():
|
async def api_load_model():
|
||||||
global model
|
global model
|
||||||
model = TTS(params["model_name"]).to(device)
|
model = TTS(params["tts_model_name"]).to(device)
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
|
||||||
@@ -226,7 +227,7 @@ async def unload_model(model):
|
|||||||
del model
|
del model
|
||||||
if torch.cuda.is_available():
|
if torch.cuda.is_available():
|
||||||
torch.cuda.empty_cache()
|
torch.cuda.empty_cache()
|
||||||
params["model_loaded"] = False
|
params["tts_model_loaded"] = False
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@@ -517,10 +518,9 @@ def list_files(directory):
|
|||||||
# Create an instance of Jinja2Templates for rendering HTML templates
|
# Create an instance of Jinja2Templates for rendering HTML templates
|
||||||
templates = Jinja2Templates(directory=this_dir / "templates")
|
templates = Jinja2Templates(directory=this_dir / "templates")
|
||||||
|
|
||||||
|
|
||||||
# Create a dependency to get the current JSON data
|
# Create a dependency to get the current JSON data
|
||||||
def get_json_data():
|
def get_json_data():
|
||||||
with open(this_dir / "config.json", "r") as json_file:
|
with open(this_dir / "confignew.json", "r") as json_file:
|
||||||
data = json.load(json_file)
|
data = json.load(json_file)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@@ -555,8 +555,8 @@ async def update_settings(
|
|||||||
local_temperature: str = Form(...),
|
local_temperature: str = Form(...),
|
||||||
local_repetition_penalty: str = Form(...),
|
local_repetition_penalty: str = Form(...),
|
||||||
low_vram: bool = Form(...),
|
low_vram: bool = Form(...),
|
||||||
model_loaded: bool = Form(...),
|
tts_model_loaded: bool = Form(...),
|
||||||
model_name: str = Form(...),
|
tts_model_name: str = Form(...),
|
||||||
narrator_enabled: bool = Form(...),
|
narrator_enabled: bool = Form(...),
|
||||||
narrator_voice: str = Form(...),
|
narrator_voice: str = Form(...),
|
||||||
output_folder_wav: str = Form(...),
|
output_folder_wav: str = Form(...),
|
||||||
@@ -577,8 +577,8 @@ async def update_settings(
|
|||||||
data["local_temperature"] = local_temperature
|
data["local_temperature"] = local_temperature
|
||||||
data["local_repetition_penalty"] = local_repetition_penalty
|
data["local_repetition_penalty"] = local_repetition_penalty
|
||||||
data["low_vram"] = low_vram
|
data["low_vram"] = low_vram
|
||||||
data["model_loaded"] = model_loaded
|
data["tts_model_loaded"] = tts_model_loaded
|
||||||
data["model_name"] = model_name
|
data["tts_model_name"] = tts_model_name
|
||||||
data["narrator_enabled"] = narrator_enabled
|
data["narrator_enabled"] = narrator_enabled
|
||||||
data["narrator_voice"] = narrator_voice
|
data["narrator_voice"] = narrator_voice
|
||||||
data["output_folder_wav"] = output_folder_wav
|
data["output_folder_wav"] = output_folder_wav
|
||||||
@@ -591,7 +591,7 @@ async def update_settings(
|
|||||||
data["voice"] = voice
|
data["voice"] = voice
|
||||||
|
|
||||||
# Save the updated settings back to the JSON file
|
# Save the updated settings back to the JSON file
|
||||||
with open(this_dir / "config.json", "w") as json_file:
|
with open(this_dir / "confignew.json", "w") as json_file:
|
||||||
json.dump(data, json_file)
|
json.dump(data, json_file)
|
||||||
|
|
||||||
# Redirect to the settings page to display the updated settings
|
# Redirect to the settings page to display the updated settings
|
||||||
@@ -783,10 +783,10 @@ simple_webpage = """
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1 id="toc">AllTalk TTS for Text generation webUI</h1>
|
<h1 id="toc">AllTalk TTS for Text generation webUI</h1>
|
||||||
<p><b>Text generation webUI</b> webpage <a href="http://127.0.0.1:7860" target="_blank">here</a> and documentation <a href="https://github.com/oobabooga/text-generation-webui/wiki" target="_blank">here</a></p>
|
<p><b>Text generation webUI</b> webpage <a href="http://{{ params["ip_address"] }}:7860" target="_blank">here</a> and documentation <a href="https://github.com/oobabooga/text-generation-webui/wiki" target="_blank">here</a></p>
|
||||||
<p><b>AllTalk Github</b> <a href="https://github.com/erew123/alltalk_tts" target="_blank">here</a>
|
<p><b>AllTalk Github</b> <a href="https://github.com/erew123/alltalk_tts" target="_blank">here</a>
|
||||||
|
|
||||||
<iframe src="http://127.0.0.1:7851/settings" width="100%" height="500" frameborder="0" style="margin: 0; padding: 0;"></iframe>
|
<iframe src="http://{{ params["ip_address"] }}:{{ params["port_number"] }}/settings" width="100%" height="500" frameborder="0" style="margin: 0; padding: 0;"></iframe>
|
||||||
|
|
||||||
<h3>Table of Contents</h3>
|
<h3>Table of Contents</h3>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -815,10 +815,13 @@ simple_webpage = """
|
|||||||
<p><b>IMPORTANT Note:</b> Ensure that your RP character card has asterisks around anything for the narration and double quotes around anything spoken. There is a complication ONLY with the greeting card so, ensuring it has the correct use of quotes and asterisks will help make sure that the greeting card sounds correct. I will aim to address this issue in a future update.</p>
|
<p><b>IMPORTANT Note:</b> Ensure that your RP character card has asterisks around anything for the narration and double quotes around anything spoken. There is a complication ONLY with the greeting card so, ensuring it has the correct use of quotes and asterisks will help make sure that the greeting card sounds correct. I will aim to address this issue in a future update.</p>
|
||||||
<p>Details on how to edit your greeting card, and where I'm at with solving this, can be found here <a href="https://github.com/erew123/alltalk_tts/tree/main#the-one-thing-i-cant-easily-work-around" target="_blank">erew123's Github</a> and you can look here at an example of how text should be formatted with quotes and asterisks <a href="#text-not-inside">Text Not inside function</a></p>
|
<p>Details on how to edit your greeting card, and where I'm at with solving this, can be found here <a href="https://github.com/erew123/alltalk_tts/tree/main#the-one-thing-i-cant-easily-work-around" target="_blank">erew123's Github</a> and you can look here at an example of how text should be formatted with quotes and asterisks <a href="#text-not-inside">Text Not inside function</a></p>
|
||||||
|
|
||||||
|
<p><b>AllTalk Updating instructions</b> <a href="https://github.com/erew123/alltalk_tts?#-updating" target="_blank">here</a>
|
||||||
|
<p><b>AllTalk Help and issues</b> <a href="https://github.com/erew123/alltalk_tts?#-help-with-problems" target="_blank">here</a>
|
||||||
|
|
||||||
<h3 id="server-information">Server Information</h3>
|
<h3 id="server-information">Server Information</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Base URL: <code>http://127.0.0.1:7851</code></li>
|
<li>Base URL: <code>http://{{ params["ip_address"] }}:{{ params["port_number"] }}</code></li>
|
||||||
<li>Server Status: <code><a href="http://127.0.0.1:7851/ready">http://127.0.0.1:7851/ready</a></code></li>
|
<li>Server Status: <code><a href="http://{{ params["ip_address"] }}:{{ params["port_number"] }}/ready">http://{{ params["ip_address"] }}:{{ params["port_number"] }}/ready</a></code></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p><a href="#toc">Back to top of page</a></p>
|
<p><a href="#toc">Back to top of page</a></p>
|
||||||
|
|
||||||
@@ -914,7 +917,7 @@ simple_webpage = """
|
|||||||
|
|
||||||
<p>The temperature has been set at 0.70 here though, as it often produces a slightly better result (in my estimation).</p>
|
<p>The temperature has been set at 0.70 here though, as it often produces a slightly better result (in my estimation).</p>
|
||||||
|
|
||||||
<p>The default settings for any model are usually provided in the config.json file that comes wtih the model and this file can be found within the folder where the model is stored.</p>
|
<p>The default settings for any model are usually provided in the confignew.json file that comes wtih the model and this file can be found within the folder where the model is stored.</p>
|
||||||
<p>These default values are carefully chosen to offer a reasonable starting point for users, and adjustments can be made based on individual preferences and use cases. However, it's important to note that changing these settings or setting them to extremes may result in unexpected outcomes. Setting extremely high or low values, especially without a good understanding of their effects, may lead to flat-sounding output or very strange-sounding output. It's advisable to experiment with adjustments incrementally and observe the impact on the generated speech to find a balance that suits your desired outcome.</p>
|
<p>These default values are carefully chosen to offer a reasonable starting point for users, and adjustments can be made based on individual preferences and use cases. However, it's important to note that changing these settings or setting them to extremes may result in unexpected outcomes. Setting extremely high or low values, especially without a good understanding of their effects, may lead to flat-sounding output or very strange-sounding output. It's advisable to experiment with adjustments incrementally and observe the impact on the generated speech to find a balance that suits your desired outcome.</p>
|
||||||
<p><a href="#toc">Back to top of page</a></p>
|
<p><a href="#toc">Back to top of page</a></p>
|
||||||
|
|
||||||
@@ -989,20 +992,20 @@ simple_webpage = """
|
|||||||
<p>Currently/Officially only DeepSpeed v8.3 is installing on Windows, due to the broken installation routine by Microsoft, however, between myself and <a href="https://github.com/S95Sedan" target="_blank">S95Sedan</a> its now possible to install DeepSpeed v11.1 or v11.2 on Windows.</p>
|
<p>Currently/Officially only DeepSpeed v8.3 is installing on Windows, due to the broken installation routine by Microsoft, however, between myself and <a href="https://github.com/S95Sedan" target="_blank">S95Sedan</a> its now possible to install DeepSpeed v11.1 or v11.2 on Windows.</p>
|
||||||
|
|
||||||
<h4>DeepSpeed on Windows - <span class="option-a">Option A</span></h4>
|
<h4>DeepSpeed on Windows - <span class="option-a">Option A</span></h4>
|
||||||
<p>This is to use the pre built DeepSpeed v11.1 wheel file. This is quite a quick process and should work for 99% of people.</p>
|
<p>This is to use the pre built DeepSpeed v11.2 wheel file. This is quite a quick process and should work for 99% of people.</p>
|
||||||
|
|
||||||
<p><strong>Note:</strong> In my tests, with this method you will <strong>not</strong> need to install the Nvidia CUDA toolkit to make this work, but AllTalk may warn you when starting DeepSpeed that it doesn't see the CUDA Toolkit; however, it works fine for TTS purposes.</p>
|
<p><strong>Note:</strong> In my tests, with this method you will <strong>not</strong> need to install the Nvidia CUDA toolkit to make this work, but AllTalk may warn you when starting DeepSpeed that it doesn't see the CUDA Toolkit; however, it works fine for TTS purposes.</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Download the file <a href="https://drive.google.com/file/d/1PFsf6uSPY5Cb4o9VxiZ7DLv-j35L7Y41/view?usp=sharing" target="_blank">deepspeed-0.11.1+e9503fe-cp311-cp311-win_amd64.whl</a> by clicking the <strong>download</strong> icon at the top right of the screen and save the file it inside your <strong>text-generation-webui</strong> folder.</li>
|
<li>Download the correct wheel version for your CUDA and Python version file <a href="https://github.com/erew123/alltalk_tts/releases/tag/deepspeed" target="_blank">from here</a> and save the file it inside your <strong>text-generation-webui</strong> folder.</li>
|
||||||
|
|
||||||
<li>At a command prompt window, move into your <strong>text-generation-webui folder</strong>, you can now start the Python environment for text-generation-webui:
|
<li>At a command prompt window, move into your <strong>text-generation-webui folder</strong>, you can now start the Python environment for text-generation-webui:<br>
|
||||||
<br><code>cmd_windows.bat</code></li>
|
<br><code>cmd_windows.bat</code></li><br>
|
||||||
|
|
||||||
<li>With the file that you saved in the <strong>text-generation-webui folder</strong>, you now type the following:
|
<li>With the file that you saved in the <strong>text-generation-webui folder</strong>, you now type the following:<br>
|
||||||
<br><code>pip install "deepspeed-0.11.1+e9503fe-cp311-cp311-win_amd64.whl"</code></li>
|
<br><code>pip install "deepspeed-0.11.2+<b>yourversionhere</b>-win_amd64.whl"</code></li><br>
|
||||||
|
|
||||||
<li>This should install through cleanly and you should now have DeepSpeed v11.1 installed within the Python 3.11 environment of text-generation-webui.</li>
|
<li>This should install through cleanly and you should now have DeepSpeed v11.2 installed within the Python 3.11 environment of text-generation-webui.</li>
|
||||||
|
|
||||||
<li>When you start up text-generation-webui, and AllTalk starts, you should see <strong>[AllTalk Startup] DeepSpeed Detected</strong></li>
|
<li>When you start up text-generation-webui, and AllTalk starts, you should see <strong>[AllTalk Startup] DeepSpeed Detected</strong></li>
|
||||||
|
|
||||||
@@ -1103,7 +1106,7 @@ simple_webpage = """
|
|||||||
|
|
||||||
<h3 id="customTTSmodels">Custom TTS Models and Model path</h3>
|
<h3 id="customTTSmodels">Custom TTS Models and Model path</h3>
|
||||||
|
|
||||||
<p>Its possible to set a custom model for the <strong>API Local</strong> and<strong> XTTSv2</strong> Local methods, or ideed point it at the same model that <strong>API TTS</strong> uses (wherever it is stored on your OS of choice). Many people did not like the sound quality of the Coqui <strong>2.0.<span style="color:#e74c3c">3</span></strong> model, and as such the AllTalk tts extension downloads the <strong>2.0.<span style="color:#2980b9">2</span></strong> model seperately to the <strong>2.0.<span style="color:#e74c3c">3</span></strong> model that TTS service downloads and manages. Typically the <strong>2.0.<span style="color:#2980b9">2</span></strong> model is stored in your <strong>/extensions/alltalk_tts/models</strong> folder and it is always downloaded on first start-up of the AllTalk_tts extension. However, you may either want to use a custom model version of your choosing, or point it to a different path on your system, or even point it so that API Local and XTTSv2 <strong>both</strong> use the same model that API TTS is using.</p>
|
<p>Its possible to set a custom model for the <strong>API Local</strong> and<strong> XTTSv2</strong> Local methods, or indeed point it at the same model that <strong>API TTS</strong> uses (wherever it is stored on your OS of choice). Many people did not like the sound quality of the Coqui <strong>2.0.<span style="color:#e74c3c">3</span></strong> model, and as such the AllTalk tts extension downloads the <strong>2.0.<span style="color:#2980b9">2</span></strong> model seperately to the <strong>2.0.<span style="color:#e74c3c">3</span></strong> model that TTS service downloads and manages. Typically the <strong>2.0.<span style="color:#2980b9">2</span></strong> model is stored in your <strong>/extensions/alltalk_tts/models</strong> folder and it is always downloaded on first start-up of the AllTalk_tts extension. However, you may either want to use a custom model version of your choosing, or point it to a different path on your system, or even point it so that API Local and XTTSv2 <strong>both</strong> use the same model that API TTS is using.</p>
|
||||||
<p>If you do choose to change the location there are a couple of things to note. </p>
|
<p>If you do choose to change the location there are a couple of things to note. </p>
|
||||||
<p>- The folder you place the model in, <strong><span style="color:#e74c3c">cannot</span></strong> be called "<strong>models</strong>". This name is reserved solely for the system to identify you are or are not using a custom model.</p>
|
<p>- The folder you place the model in, <strong><span style="color:#e74c3c">cannot</span></strong> be called "<strong>models</strong>". This name is reserved solely for the system to identify you are or are not using a custom model.</p>
|
||||||
<p>- On each startup, the AllTalk tts extension will check the custom location and if it does not exist, it will create it and download the files it needs. It will also re download any missing files in that location that are needed for the model to function.</p>
|
<p>- On each startup, the AllTalk tts extension will check the custom location and if it does not exist, it will create it and download the files it needs. It will also re download any missing files in that location that are needed for the model to function.</p>
|
||||||
@@ -1138,7 +1141,7 @@ simple_webpage = """
|
|||||||
<p><a href="#toc">Back to top of page</a></p>
|
<p><a href="#toc">Back to top of page</a></p>
|
||||||
|
|
||||||
<h3 id="configuration-details"><strong>Configuration Details</strong></h3>
|
<h3 id="configuration-details"><strong>Configuration Details</strong></h3>
|
||||||
<p>Explanation of the <b>config.json</b> file:</p>
|
<p>Explanation of the <b>confignew.json</b> file:</p>
|
||||||
|
|
||||||
<code><span class="key">"activate:"</span> <span class="value">true</span>,</code><span class="key"> Used within the code, do not change.</span><br>
|
<code><span class="key">"activate:"</span> <span class="value">true</span>,</code><span class="key"> Used within the code, do not change.</span><br>
|
||||||
<code><span class="key">"autoplay:"</span> <span class="value">true</span>,</code><span class="key"> Controls whether the TTS audio plays automatically within Text generation webUI.</span><br>
|
<code><span class="key">"autoplay:"</span> <span class="value">true</span>,</code><span class="key"> Controls whether the TTS audio plays automatically within Text generation webUI.</span><br>
|
||||||
@@ -1150,8 +1153,8 @@ simple_webpage = """
|
|||||||
<code><span class="key">"low_vram:"</span> <span class="value">false</span>,</code><span class="key"> Controls whether the Low VRAM option is enabled or disabled.</span><br>
|
<code><span class="key">"low_vram:"</span> <span class="value">false</span>,</code><span class="key"> Controls whether the Low VRAM option is enabled or disabled.</span><br>
|
||||||
<code><span class="key">"local_temperature:"</span> <span class="value">"0.70"</span>,</code><span class="key"> Sets the temperature to use with the API Local and XTTSv2 Local methods.</span><br>
|
<code><span class="key">"local_temperature:"</span> <span class="value">"0.70"</span>,</code><span class="key"> Sets the temperature to use with the API Local and XTTSv2 Local methods.</span><br>
|
||||||
<code><span class="key">"local_repetition_penalty:"</span> <span class="value">"10.0"</span>,</code><span class="key"> Sets the repetition penalty to use with the API Local and XTTSv2 Local methods.</span><br>
|
<code><span class="key">"local_repetition_penalty:"</span> <span class="value">"10.0"</span>,</code><span class="key"> Sets the repetition penalty to use with the API Local and XTTSv2 Local methods.</span><br>
|
||||||
<code><span class="key">"model_loaded:"</span> <span class="value">true</span>,</code><span class="key"> Used within the code, do not change.</span><br>
|
<code><span class="key">"tts_model_loaded:"</span> <span class="value">true</span>,</code><span class="key"> Used within the code, do not change.</span><br>
|
||||||
<code><span class="key">"model_name:"</span> <span class="value">"tts_models/multilingual/multi-dataset/xtts_v2"</span>,</code><span class="key"> Specifies the model that the "API TTS" method will use for TTS generation.</span><br>
|
<code><span class="key">"tts_model_name:"</span> <span class="value">"tts_models/multilingual/multi-dataset/xtts_v2"</span>,</code><span class="key"> Specifies the model that the "API TTS" method will use for TTS generation.</span><br>
|
||||||
<code><span class="key">"narrator_enabled:"</span> <span class="value">"female_02.wav"</span>,</code><span class="key"> Specifies the default narrator voice to use for TTS.</span><br>
|
<code><span class="key">"narrator_enabled:"</span> <span class="value">"female_02.wav"</span>,</code><span class="key"> Specifies the default narrator voice to use for TTS.</span><br>
|
||||||
<code><span class="key">"narrator_voice:"</span> <span class="value">"false"</span>,</code><span class="key"> Enables and disables the narrator function.</span><br>
|
<code><span class="key">"narrator_voice:"</span> <span class="value">"false"</span>,</code><span class="key"> Enables and disables the narrator function.</span><br>
|
||||||
<code><span class="key">"port_number:"</span> <span class="value">"7851"</span>,</code><span class="key"> Specifies the default port number for the web server.</span><br>
|
<code><span class="key">"port_number:"</span> <span class="value">"7851"</span>,</code><span class="key"> Specifies the default port number for the web server.</span><br>
|
||||||
@@ -1240,18 +1243,22 @@ simple_webpage = """
|
|||||||
</html>
|
</html>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
###################################################
|
###################################################
|
||||||
#### Webserver Startup & Initial model Loading ####
|
#### Webserver Startup & Initial model Loading ####
|
||||||
###################################################
|
###################################################
|
||||||
|
# Create a Jinja2 template object
|
||||||
|
template = Template(simple_webpage)
|
||||||
|
|
||||||
|
# Render the template with the dynamic values
|
||||||
|
rendered_html = template.render(params=params)
|
||||||
|
|
||||||
@app.get("/ready")
|
@app.get("/ready")
|
||||||
async def ready():
|
async def ready():
|
||||||
return Response("Ready endpoint")
|
return Response("Ready endpoint")
|
||||||
|
|
||||||
|
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def read_root():
|
async def read_root():
|
||||||
return HTMLResponse(content=simple_webpage, status_code=200)
|
return HTMLResponse(content=rendered_html, status_code=200)
|
||||||
|
|
||||||
# Start Uvicorn Webserver
|
# Start Uvicorn Webserver
|
||||||
host_parameter = {params["ip_address"]}
|
host_parameter = {params["ip_address"]}
|
||||||
|
|||||||
Reference in new issue
Block a user