AJosh commited on
Commit
9e9ea0f
·
verified ·
1 Parent(s): b45e4e1

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. alltalk_tts/.github/FUNDING.yml +1 -0
  3. alltalk_tts/.github/ISSUE_TEMPLATE/bug-report-support-request.md +33 -0
  4. alltalk_tts/.github/ISSUE_TEMPLATE/config.yml +1 -0
  5. alltalk_tts/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  6. alltalk_tts/.github/actions/docker-setup/action.yml +73 -0
  7. alltalk_tts/.github/workflows/publish-docker-v2.yml +124 -0
  8. alltalk_tts/.github/workflows/publish-docker.yml +67 -0
  9. alltalk_tts/.github/workflows/python-ci.yml +53 -0
  10. alltalk_tts/.gitignore +8 -0
  11. alltalk_tts/.vscode/settings.json +9 -0
  12. alltalk_tts/Dockerfile +20 -0
  13. alltalk_tts/LICENSE +661 -0
  14. alltalk_tts/README.md +0 -0
  15. alltalk_tts/atsetup.bat +659 -0
  16. alltalk_tts/atsetup.sh +520 -0
  17. alltalk_tts/confignew.json +25 -0
  18. alltalk_tts/diagnostics.py +325 -0
  19. alltalk_tts/docker-compose-cuda.yml +20 -0
  20. alltalk_tts/docker-compose.yml +27 -0
  21. alltalk_tts/dockerconfig.json +25 -0
  22. alltalk_tts/finetune.py +0 -0
  23. alltalk_tts/finetune/put-voice-samples-in-here/put your voice samples in here.txt +0 -0
  24. alltalk_tts/launch.sh +5 -0
  25. alltalk_tts/modeldownload.json +14 -0
  26. alltalk_tts/modeldownload.py +193 -0
  27. alltalk_tts/nvidia.Dockerfile +22 -0
  28. alltalk_tts/script.py +1086 -0
  29. alltalk_tts/system/admin.html +0 -0
  30. alltalk_tts/system/at_admin/3c6fde566d6a.jpg +3 -0
  31. alltalk_tts/system/at_admin/4abed1ca.jpg +3 -0
  32. alltalk_tts/system/at_admin/at_settings.html +261 -0
  33. alltalk_tts/system/at_admin/atandsdplugin.jpg +3 -0
  34. alltalk_tts/system/at_admin/deepspeedexample.jpg +3 -0
  35. alltalk_tts/system/at_admin/favicon.ico +0 -0
  36. alltalk_tts/system/at_admin/lowvrammode.png +3 -0
  37. alltalk_tts/system/at_admin/pythonenvironment.jpg +3 -0
  38. alltalk_tts/system/at_admin/pythonrequirementswindows.jpg +3 -0
  39. alltalk_tts/system/at_admin/textnotinside.jpg +3 -0
  40. alltalk_tts/system/at_sounds/apilocal.wav +3 -0
  41. alltalk_tts/system/at_sounds/apitts.wav +3 -0
  42. alltalk_tts/system/at_sounds/changingmodel.wav +3 -0
  43. alltalk_tts/system/at_sounds/deepspeeddisabled.wav +3 -0
  44. alltalk_tts/system/at_sounds/deepspeedenabled.wav +3 -0
  45. alltalk_tts/system/at_sounds/lowvramdisabled.wav +3 -0
  46. alltalk_tts/system/at_sounds/lowvramenabled.wav +3 -0
  47. alltalk_tts/system/at_sounds/xttsfinetuned.wav +3 -0
  48. alltalk_tts/system/at_sounds/xttslocal.wav +3 -0
  49. alltalk_tts/system/config/at_configdowngrade.json +2 -0
  50. alltalk_tts/system/config/at_configupdate.json +2 -0
.gitattributes CHANGED
@@ -57,3 +57,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
60
+ alltalk_tts/system/word_addin/AllTalk[[:space:]]Word[[:space:]]Add-in.pdf filter=lfs diff=lfs merge=lfs -text
alltalk_tts/.github/FUNDING.yml ADDED
@@ -0,0 +1 @@
 
 
1
+ ko_fi: erew123
alltalk_tts/.github/ISSUE_TEMPLATE/bug-report-support-request.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Support Request/Issue
3
+ about: Use this to create a support request or report a bug/issue
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+ 🔴 If you have installed AllTalk in a custom Python environment, I will only be able to provide limited assistance/support. AllTalk draws on a variety of scripts and libraries that are not written or managed by myself, and they may fail, error or give strange results in custom built python environments.
10
+
11
+ 🔴 Please generate a diagnostics report and upload the "diagnostics.log" as this helps me understand your configuration.
12
+
13
+ https://github.com/erew123/alltalk_tts/tree/main?#-how-to-make-a-diagnostics-report-file
14
+
15
+ **Describe the bug**
16
+ A clear and concise description of what the bug is.
17
+
18
+ **To Reproduce**
19
+ Steps to reproduce the behaviour:
20
+
21
+ **Screenshots**
22
+ If applicable, add screenshots to help explain your problem.
23
+
24
+ **Text/logs**
25
+ If applicable, copy/paste in your logs here from the console.
26
+
27
+ **Desktop (please complete the following information):**
28
+ AllTalk was updated: [approx. date]
29
+ Custom Python environment: [yes/no give details if yes]
30
+ Text-generation-webUI was updated: [approx. date]
31
+
32
+ **Additional context**
33
+ Add any other context about the problem here.
alltalk_tts/.github/ISSUE_TEMPLATE/config.yml ADDED
@@ -0,0 +1 @@
 
 
1
+ blank_issues_enabled: false
alltalk_tts/.github/ISSUE_TEMPLATE/feature_request.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Feature request
3
+ about: Use this to create a Feature request
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Please confirm you have read the current Features request list**
11
+ https://github.com/erew123/alltalk_tts/discussions/74
12
+
13
+ **Is your feature request related to a problem? Please describe.**
14
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
15
+
16
+ **Describe the solution you'd like**
17
+ A clear and concise description of what you want to happen.
18
+
19
+ **Describe alternatives you've considered**
20
+ A clear and concise description of any alternative solutions or features you've considered.
21
+
22
+ **Additional context**
23
+ Add any other context or screenshots about the feature request here.
alltalk_tts/.github/actions/docker-setup/action.yml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: 'Setting up docker'
2
+
3
+ inputs:
4
+ DOCKERHUB_USERNAME:
5
+ description: "Docker hub username"
6
+ required: true
7
+ DOCKERHUB_REPO_NAME:
8
+ description: "Docker hub repo name"
9
+ required: true
10
+ DOCKERHUB_TOKEN:
11
+ description: "Docker hub token"
12
+ required: true
13
+
14
+ runs:
15
+ using: "composite"
16
+ steps:
17
+ - name: Free Disk Space (Ubuntu)
18
+ uses: jlumbroso/free-disk-space@v1.3.1
19
+ with:
20
+ tool-cache: true
21
+ swap-storage: false
22
+ large-packages: false
23
+ - name: Read variables
24
+ shell: bash
25
+ run: |
26
+ source ./docker/variables.sh
27
+ for key in "${!ALLTALK_VARS[@]}"
28
+ do
29
+ echo "${key}=${ALLTALK_VARS[${key}]}"
30
+ echo "${key}=${ALLTALK_VARS[${key}]}" >> $GITHUB_ENV
31
+ done
32
+
33
+ - name: Extract version from Git Tag
34
+ shell: bash {0}
35
+ run: |
36
+ # Use the git tag if existing, otherwise 'latest':
37
+ DOCKER_TAG=$( echo "${{ github.ref }}" | grep -q tags | cut -d'/' -f 3 )
38
+ if [ -z "${DOCKER_TAG}" ]; then
39
+ DOCKER_TAG="latest"
40
+ fi
41
+ echo "Using DOCKER_TAG=${DOCKER_TAG}"
42
+ echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
43
+
44
+ - name: Extract Docker Hub User and Repo Name
45
+ shell: bash
46
+ env:
47
+ DOCKERHUB_USERNAME: ${{ inputs.DOCKERHUB_USERNAME }}
48
+ DOCKERHUB_REPO_NAME: ${{ inputs.DOCKERHUB_REPO_NAME }}
49
+ run: |
50
+ if [ -n "${DOCKERHUB_USERNAME}" ]; then
51
+ echo "Using Github repository variable 'DOCKERHUB_USERNAME' as Docker hub username with value: '${DOCKERHUB_USERNAME}'"
52
+ echo "DOCKERHUB_USERNAME=${DOCKERHUB_USERNAME}" >> $GITHUB_ENV
53
+ else
54
+ echo "Using Github repository name as Docker hub username"
55
+ echo "DOCKERHUB_USERNAME=$(echo ${{ github.repository }} | cut -d'/' -f 1)" >> $GITHUB_ENV
56
+ fi
57
+
58
+ if [ -n "${DOCKERHUB_REPO_NAME}" ]; then
59
+ echo "Using Github repository variable 'DOCKERHUB_REPO_NAME' as Docker hub repo name with value: '${DOCKERHUB_REPO_NAME}'"
60
+ echo "DOCKERHUB_REPO_NAME=${DOCKERHUB_REPO_NAME}" >> $GITHUB_ENV
61
+ else
62
+ echo "Using Github repository name as Docker hub repo name"
63
+ echo "DOCKERHUB_REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f 2)" >> $GITHUB_ENV
64
+ fi
65
+
66
+ - name: Set up Docker Buildx
67
+ uses: docker/setup-buildx-action@v3
68
+
69
+ - name: Login to DockerHub
70
+ uses: docker/login-action@v3
71
+ with:
72
+ username: ${{ inputs.DOCKERHUB_USERNAME }}
73
+ password: ${{ inputs.DOCKERHUB_TOKEN }}
alltalk_tts/.github/workflows/publish-docker-v2.yml ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Publish Docker v2
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types: [ published ]
7
+ push:
8
+ branches:
9
+ - 'alltalkbeta'
10
+ tags:
11
+ - 'v*'
12
+
13
+ # Limit the concurrency of entire workflow runs for a specific branch:
14
+ concurrency:
15
+ group: ${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ build_base_environment_docker_image:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - name: Checkout code
24
+ uses: actions/checkout@v4
25
+
26
+ - name: Setup docker
27
+ uses: ./.github/actions/docker-setup
28
+ with:
29
+ DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }}
30
+ DOCKERHUB_REPO_NAME: ${{ vars.DOCKERHUB_REPO_NAME }}
31
+ DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
32
+
33
+ - name: Docker meta
34
+ id: meta
35
+ uses: docker/metadata-action@v5
36
+ with:
37
+ images: |
38
+ ${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO_NAME }}_environment
39
+ tags: |
40
+ # Use sematic versioning on push tag event:
41
+ type=semver,pattern={{version}}
42
+ # set latest tag for main and alltalkbeta branch:
43
+ type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') || github.ref == format('refs/heads/{0}', 'alltalkbeta') }}
44
+
45
+ - uses: dorny/paths-filter@v3
46
+ id: changes
47
+ with:
48
+ base: 'alltalkbeta'
49
+ filters: |
50
+ docker-base:
51
+ - 'docker/variables.sh'
52
+ - 'docker/base/Dockerfile'
53
+ docker-workflow:
54
+ - '.github/workflows/publish-docker*.yml'
55
+
56
+ - name: Build and push base Docker image
57
+ if: |
58
+ steps.changes.outputs.docker-base == 'true' ||
59
+ steps.changes.outputs.docker-workflow == 'true' ||
60
+ github.event_name == 'release' ||
61
+ (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
62
+ uses: docker/build-push-action@v6
63
+ with:
64
+ context: ./docker/base
65
+ file: ./docker/base/Dockerfile
66
+ platforms: "linux/amd64"
67
+ push: true
68
+ build-args: |
69
+ CUDA_VERSION=${{ env.CUDA_VERSION }}
70
+ PYTHON_VERSION=${{ env.PYTHON_VERSION }}
71
+ tags: ${{ steps.meta.outputs.tags }}
72
+ labels: ${{ steps.meta.outputs.labels }}
73
+ cache-from: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO_NAME }}_environment:buildcache
74
+ cache-to: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO_NAME }}_environment:buildcache,mode=max
75
+
76
+ build_main_docker_image:
77
+ needs: build_base_environment_docker_image
78
+ runs-on: ubuntu-latest
79
+ strategy:
80
+ matrix:
81
+ tts: [ xtts, vits, piper ]
82
+
83
+ steps:
84
+ - name: Checkout code
85
+ uses: actions/checkout@v4
86
+
87
+ - name: Setup docker
88
+ uses: ./.github/actions/docker-setup
89
+ with:
90
+ DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }}
91
+ DOCKERHUB_REPO_NAME: ${{ vars.DOCKERHUB_REPO_NAME }}
92
+ DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
93
+
94
+ - name: Docker meta
95
+ id: meta
96
+ uses: docker/metadata-action@v5
97
+ with:
98
+ images: |
99
+ ${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO_NAME }}
100
+ flavor: |
101
+ suffix=-${{ matrix.tts }},onlatest=true
102
+ tags: |
103
+ # Use sematic versioning on push tag event:
104
+ type=semver,pattern={{version}}
105
+ # set latest tag for main and alltalkbeta branch:
106
+ type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') || github.ref == format('refs/heads/{0}', 'alltalkbeta') }}
107
+
108
+ - name: Build and push base Docker image
109
+ uses: docker/build-push-action@v6
110
+ with:
111
+ context: .
112
+ file: ./Dockerfile
113
+ platforms: "linux/amd64"
114
+ push: true
115
+ build-args: |
116
+ TTS_MODEL=${{ matrix.tts }}
117
+ ALLTALK_DIR=${{ env.ALLTALK_DIR }}
118
+ DEEPSPEED_VERSION=${{ env.DEEPSPEED_VERSION }}
119
+ DOCKER_TAG=${{ env.DOCKER_TAG }}
120
+ DOCKER_REPOSITORY=${{ env.DOCKERHUB_USERNAME }}/
121
+ tags: ${{ steps.meta.outputs.tags }}
122
+ labels: ${{ steps.meta.outputs.labels }}
123
+ cache-from: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO_NAME }}:buildcache-${{ matrix.tts }}
124
+ cache-to: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPO_NAME }}:buildcache-${{ matrix.tts }},mode=max
alltalk_tts/.github/workflows/publish-docker.yml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Publish Docker image (main branch)
2
+
3
+ on:
4
+ # push:
5
+ # branches: [main]
6
+ release:
7
+ types: [published]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ build_and_push:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ include:
16
+ - dockerfile: "Dockerfile"
17
+ platforms: "linux/amd64"
18
+ tag_name: "cpu"
19
+ - dockerfile: "nvidia.Dockerfile"
20
+ platforms: "linux/amd64"
21
+ tag_name: "cuda"
22
+ steps:
23
+ - name: Checkout code
24
+ uses: actions/checkout@v4
25
+
26
+ - name: Set up Docker Buildx
27
+ uses: docker/setup-buildx-action@v3
28
+
29
+ - name: Lowercase Actor and Extract Repo Name
30
+ run: |
31
+ echo "ACTOR_LOWER=$(echo ${{ github.actor }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
32
+ echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f 2)" >> $GITHUB_ENV
33
+
34
+ - name: Login to GitHub Container Registry
35
+ uses: docker/login-action@v3
36
+ with:
37
+ registry: ghcr.io
38
+ username: ${{ env.ACTOR_LOWER }}
39
+ password: ${{ secrets.GITHUB_TOKEN }}
40
+
41
+ - name: Login to DockerHub
42
+ uses: docker/login-action@v3
43
+ with:
44
+ username: ${{ vars.DOCKERHUB_USERNAME }}
45
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
46
+
47
+ - name: Build and push Docker image
48
+ uses: docker/build-push-action@v5
49
+ with:
50
+ context: .
51
+ file: ./${{ matrix.dockerfile }}
52
+ platforms: ${{ matrix.platforms }}
53
+ push: true
54
+ tags: |
55
+ ghcr.io/${{ env.ACTOR_LOWER }}/${{ env.REPO_NAME }}:${{ matrix.tag_name }}-${{ github.sha }}
56
+ ghcr.io/${{ env.ACTOR_LOWER }}/${{ env.REPO_NAME }}:${{ matrix.tag_name }}
57
+ ghcr.io/${{ env.ACTOR_LOWER }}/${{ env.REPO_NAME }}:latest
58
+ ${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO_NAME }}:${{ matrix.tag_name }}-${{ github.sha }}
59
+ ${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO_NAME }}:${{ matrix.tag_name }}
60
+ ${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO_NAME }}:latest
61
+
62
+ - name: Docker Hub Description
63
+ uses: peter-evans/dockerhub-description@v3.4.2
64
+ with:
65
+ username: ${{ vars.DOCKERHUB_USERNAME }}
66
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
67
+ repository: ${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO_NAME }}
alltalk_tts/.github/workflows/python-ci.yml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python CI
5
+
6
+ on: [push, pull_request]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python 3.11.9
18
+ uses: actions/setup-python@v3
19
+ if: ${{ hashFiles('./test') != '' }}
20
+ with:
21
+ python-version: "3.11.9"
22
+ - name: Install dependencies
23
+ if: ${{ hashFiles('./test') != '' }}
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ if [ -f system/requirements/requirements_unit_test.txt ]; then
27
+ pip install -r system/requirements/requirements_unit_test.txt;
28
+ fi
29
+ - name: Test with pytest
30
+ if: ${{ hashFiles('./test') != '' }}
31
+ run: |
32
+ pytest test --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
33
+ - name: Surface failing tests
34
+ if: always()
35
+ uses: pmeier/pytest-results-action@v0.6.0
36
+ with:
37
+ # A list of JUnit XML files, directories containing the former, and wildcard
38
+ # patterns to process.
39
+ # See @actions/glob for supported patterns.
40
+ path: junit/test-results.xml
41
+
42
+ # (Optional) Add a summary of the results at the top of the report
43
+ summary: true
44
+
45
+ # (Optional) Select which results should be included in the report.
46
+ # Follows the same syntax as `pytest -r`
47
+ display-options: fEX
48
+
49
+ # (Optional) Fail the workflow if no JUnit XML was found.
50
+ fail-on-empty: false
51
+
52
+ # (Optional) Title of the test results section in the workflow summary
53
+ title: Test results
alltalk_tts/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ voices/*.*
2
+ models/*.*
3
+ outputs/*.*
4
+ finetune/*.*
5
+ config.json
6
+ confignew.json
7
+ models.json
8
+ diagnostics.log
alltalk_tts/.vscode/settings.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "files.associations": {
3
+ "*.html": "jinja-html"
4
+ },
5
+ "emmet.includeLanguages": {
6
+ "jinja-html": "html",
7
+ "jinja2": "html"
8
+ },
9
+ }
alltalk_tts/Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
2
+ ENV HOST 0.0.0.0
3
+ RUN apt-get update && apt-get upgrade -y \
4
+ && apt-get install -y git build-essential portaudio19-dev \
5
+ python3 python3-pip gcc wget \
6
+ ocl-icd-opencl-dev opencl-headers clinfo \
7
+ libclblast-dev libopenblas-dev libaio-dev \
8
+ && mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd \
9
+ && ln -s /usr/bin/python3 /usr/bin/python
10
+
11
+ WORKDIR /app
12
+ ENV CUDA_DOCKER_ARCH=all
13
+ COPY system/requirements/requirements_docker.txt system/requirements/requirements_docker.txt
14
+ RUN pip install --no-cache-dir --no-deps -r system/requirements/requirements_docker.txt && \
15
+ pip install --no-cache-dir deepspeed
16
+ COPY . .
17
+
18
+ EXPOSE 7851 7852
19
+ RUN chmod +x launch.sh
20
+ ENTRYPOINT ["sh", "-c", "./launch.sh"]
alltalk_tts/LICENSE ADDED
@@ -0,0 +1,661 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
13
+
14
+ The licenses for most software and other practical works are designed
15
+ to take away your freedom to share and change the works. By contrast,
16
+ our General Public Licenses are intended to guarantee your freedom to
17
+ share and change all versions of a program--to make sure it remains free
18
+ software for all its users.
19
+
20
+ When we speak of free software, we are referring to freedom, not
21
+ price. Our General Public Licenses are designed to make sure that you
22
+ have the freedom to distribute copies of free software (and charge for
23
+ them if you wish), that you receive source code or can get it if you
24
+ want it, that you can change the software or use pieces of it in new
25
+ free programs, and that you know you can do these things.
26
+
27
+ Developers that use our General Public Licenses protect your rights
28
+ with two steps: (1) assert copyright on the software, and (2) offer
29
+ you this License which gives you legal permission to copy, distribute
30
+ and/or modify the software.
31
+
32
+ A secondary benefit of defending all users' freedom is that
33
+ improvements made in alternate versions of the program, if they
34
+ receive widespread use, become available for other developers to
35
+ incorporate. Many developers of free software are heartened and
36
+ encouraged by the resulting cooperation. However, in the case of
37
+ software used on network servers, this result may fail to come about.
38
+ The GNU General Public License permits making a modified version and
39
+ letting the public access it on a server without ever releasing its
40
+ source code to the public.
41
+
42
+ The GNU Affero General Public License is designed specifically to
43
+ ensure that, in such cases, the modified source code becomes available
44
+ to the community. It requires the operator of a network server to
45
+ provide the source code of the modified version running there to the
46
+ users of that server. Therefore, public use of a modified version, on
47
+ a publicly accessible server, gives the public access to the source
48
+ code of the modified version.
49
+
50
+ An older license, called the Affero General Public License and
51
+ published by Affero, was designed to accomplish similar goals. This is
52
+ a different license, not a version of the Affero GPL, but Affero has
53
+ released a new version of the Affero GPL which permits relicensing under
54
+ this license.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ TERMS AND CONDITIONS
60
+
61
+ 0. Definitions.
62
+
63
+ "This License" refers to version 3 of the GNU Affero General Public License.
64
+
65
+ "Copyright" also means copyright-like laws that apply to other kinds of
66
+ works, such as semiconductor masks.
67
+
68
+ "The Program" refers to any copyrightable work licensed under this
69
+ License. Each licensee is addressed as "you". "Licensees" and
70
+ "recipients" may be individuals or organizations.
71
+
72
+ To "modify" a work means to copy from or adapt all or part of the work
73
+ in a fashion requiring copyright permission, other than the making of an
74
+ exact copy. The resulting work is called a "modified version" of the
75
+ earlier work or a work "based on" the earlier work.
76
+
77
+ A "covered work" means either the unmodified Program or a work based
78
+ on the Program.
79
+
80
+ To "propagate" a work means to do anything with it that, without
81
+ permission, would make you directly or secondarily liable for
82
+ infringement under applicable copyright law, except executing it on a
83
+ computer or modifying a private copy. Propagation includes copying,
84
+ distribution (with or without modification), making available to the
85
+ public, and in some countries other activities as well.
86
+
87
+ To "convey" a work means any kind of propagation that enables other
88
+ parties to make or receive copies. Mere interaction with a user through
89
+ a computer network, with no transfer of a copy, is not conveying.
90
+
91
+ An interactive user interface displays "Appropriate Legal Notices"
92
+ to the extent that it includes a convenient and prominently visible
93
+ feature that (1) displays an appropriate copyright notice, and (2)
94
+ tells the user that there is no warranty for the work (except to the
95
+ extent that warranties are provided), that licensees may convey the
96
+ work under this License, and how to view a copy of this License. If
97
+ the interface presents a list of user commands or options, such as a
98
+ menu, a prominent item in the list meets this criterion.
99
+
100
+ 1. Source Code.
101
+
102
+ The "source code" for a work means the preferred form of the work
103
+ for making modifications to it. "Object code" means any non-source
104
+ form of a work.
105
+
106
+ A "Standard Interface" means an interface that either is an official
107
+ standard defined by a recognized standards body, or, in the case of
108
+ interfaces specified for a particular programming language, one that
109
+ is widely used among developers working in that language.
110
+
111
+ The "System Libraries" of an executable work include anything, other
112
+ than the work as a whole, that (a) is included in the normal form of
113
+ packaging a Major Component, but which is not part of that Major
114
+ Component, and (b) serves only to enable use of the work with that
115
+ Major Component, or to implement a Standard Interface for which an
116
+ implementation is available to the public in source code form. A
117
+ "Major Component", in this context, means a major essential component
118
+ (kernel, window system, and so on) of the specific operating system
119
+ (if any) on which the executable work runs, or a compiler used to
120
+ produce the work, or an object code interpreter used to run it.
121
+
122
+ The "Corresponding Source" for a work in object code form means all
123
+ the source code needed to generate, install, and (for an executable
124
+ work) run the object code and to modify the work, including scripts to
125
+ control those activities. However, it does not include the work's
126
+ System Libraries, or general-purpose tools or generally available free
127
+ programs which are used unmodified in performing those activities but
128
+ which are not part of the work. For example, Corresponding Source
129
+ includes interface definition files associated with source files for
130
+ the work, and the source code for shared libraries and dynamically
131
+ linked subprograms that the work is specifically designed to require,
132
+ such as by intimate data communication or control flow between those
133
+ subprograms and other parts of the work.
134
+
135
+ The Corresponding Source need not include anything that users
136
+ can regenerate automatically from other parts of the Corresponding
137
+ Source.
138
+
139
+ The Corresponding Source for a work in source code form is that
140
+ same work.
141
+
142
+ 2. Basic Permissions.
143
+
144
+ All rights granted under this License are granted for the term of
145
+ copyright on the Program, and are irrevocable provided the stated
146
+ conditions are met. This License explicitly affirms your unlimited
147
+ permission to run the unmodified Program. The output from running a
148
+ covered work is covered by this License only if the output, given its
149
+ content, constitutes a covered work. This License acknowledges your
150
+ rights of fair use or other equivalent, as provided by copyright law.
151
+
152
+ You may make, run and propagate covered works that you do not
153
+ convey, without conditions so long as your license otherwise remains
154
+ in force. You may convey covered works to others for the sole purpose
155
+ of having them make modifications exclusively for you, or provide you
156
+ with facilities for running those works, provided that you comply with
157
+ the terms of this License in conveying all material for which you do
158
+ not control copyright. Those thus making or running the covered works
159
+ for you must do so exclusively on your behalf, under your direction
160
+ and control, on terms that prohibit them from making any copies of
161
+ your copyrighted material outside their relationship with you.
162
+
163
+ Conveying under any other circumstances is permitted solely under
164
+ the conditions stated below. Sublicensing is not allowed; section 10
165
+ makes it unnecessary.
166
+
167
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168
+
169
+ No covered work shall be deemed part of an effective technological
170
+ measure under any applicable law fulfilling obligations under article
171
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172
+ similar laws prohibiting or restricting circumvention of such
173
+ measures.
174
+
175
+ When you convey a covered work, you waive any legal power to forbid
176
+ circumvention of technological measures to the extent such circumvention
177
+ is effected by exercising rights under this License with respect to
178
+ the covered work, and you disclaim any intention to limit operation or
179
+ modification of the work as a means of enforcing, against the work's
180
+ users, your or third parties' legal rights to forbid circumvention of
181
+ technological measures.
182
+
183
+ 4. Conveying Verbatim Copies.
184
+
185
+ You may convey verbatim copies of the Program's source code as you
186
+ receive it, in any medium, provided that you conspicuously and
187
+ appropriately publish on each copy an appropriate copyright notice;
188
+ keep intact all notices stating that this License and any
189
+ non-permissive terms added in accord with section 7 apply to the code;
190
+ keep intact all notices of the absence of any warranty; and give all
191
+ recipients a copy of this License along with the Program.
192
+
193
+ You may charge any price or no price for each copy that you convey,
194
+ and you may offer support or warranty protection for a fee.
195
+
196
+ 5. Conveying Modified Source Versions.
197
+
198
+ You may convey a work based on the Program, or the modifications to
199
+ produce it from the Program, in the form of source code under the
200
+ terms of section 4, provided that you also meet all of these conditions:
201
+
202
+ a) The work must carry prominent notices stating that you modified
203
+ it, and giving a relevant date.
204
+
205
+ b) The work must carry prominent notices stating that it is
206
+ released under this License and any conditions added under section
207
+ 7. This requirement modifies the requirement in section 4 to
208
+ "keep intact all notices".
209
+
210
+ c) You must license the entire work, as a whole, under this
211
+ License to anyone who comes into possession of a copy. This
212
+ License will therefore apply, along with any applicable section 7
213
+ additional terms, to the whole of the work, and all its parts,
214
+ regardless of how they are packaged. This License gives no
215
+ permission to license the work in any other way, but it does not
216
+ invalidate such permission if you have separately received it.
217
+
218
+ d) If the work has interactive user interfaces, each must display
219
+ Appropriate Legal Notices; however, if the Program has interactive
220
+ interfaces that do not display Appropriate Legal Notices, your
221
+ work need not make them do so.
222
+
223
+ A compilation of a covered work with other separate and independent
224
+ works, which are not by their nature extensions of the covered work,
225
+ and which are not combined with it such as to form a larger program,
226
+ in or on a volume of a storage or distribution medium, is called an
227
+ "aggregate" if the compilation and its resulting copyright are not
228
+ used to limit the access or legal rights of the compilation's users
229
+ beyond what the individual works permit. Inclusion of a covered work
230
+ in an aggregate does not cause this License to apply to the other
231
+ parts of the aggregate.
232
+
233
+ 6. Conveying Non-Source Forms.
234
+
235
+ You may convey a covered work in object code form under the terms
236
+ of sections 4 and 5, provided that you also convey the
237
+ machine-readable Corresponding Source under the terms of this License,
238
+ in one of these ways:
239
+
240
+ a) Convey the object code in, or embodied in, a physical product
241
+ (including a physical distribution medium), accompanied by the
242
+ Corresponding Source fixed on a durable physical medium
243
+ customarily used for software interchange.
244
+
245
+ b) Convey the object code in, or embodied in, a physical product
246
+ (including a physical distribution medium), accompanied by a
247
+ written offer, valid for at least three years and valid for as
248
+ long as you offer spare parts or customer support for that product
249
+ model, to give anyone who possesses the object code either (1) a
250
+ copy of the Corresponding Source for all the software in the
251
+ product that is covered by this License, on a durable physical
252
+ medium customarily used for software interchange, for a price no
253
+ more than your reasonable cost of physically performing this
254
+ conveying of source, or (2) access to copy the
255
+ Corresponding Source from a network server at no charge.
256
+
257
+ c) Convey individual copies of the object code with a copy of the
258
+ written offer to provide the Corresponding Source. This
259
+ alternative is allowed only occasionally and noncommercially, and
260
+ only if you received the object code with such an offer, in accord
261
+ with subsection 6b.
262
+
263
+ d) Convey the object code by offering access from a designated
264
+ place (gratis or for a charge), and offer equivalent access to the
265
+ Corresponding Source in the same way through the same place at no
266
+ further charge. You need not require recipients to copy the
267
+ Corresponding Source along with the object code. If the place to
268
+ copy the object code is a network server, the Corresponding Source
269
+ may be on a different server (operated by you or a third party)
270
+ that supports equivalent copying facilities, provided you maintain
271
+ clear directions next to the object code saying where to find the
272
+ Corresponding Source. Regardless of what server hosts the
273
+ Corresponding Source, you remain obligated to ensure that it is
274
+ available for as long as needed to satisfy these requirements.
275
+
276
+ e) Convey the object code using peer-to-peer transmission, provided
277
+ you inform other peers where the object code and Corresponding
278
+ Source of the work are being offered to the general public at no
279
+ charge under subsection 6d.
280
+
281
+ A separable portion of the object code, whose source code is excluded
282
+ from the Corresponding Source as a System Library, need not be
283
+ included in conveying the object code work.
284
+
285
+ A "User Product" is either (1) a "consumer product", which means any
286
+ tangible personal property which is normally used for personal, family,
287
+ or household purposes, or (2) anything designed or sold for incorporation
288
+ into a dwelling. In determining whether a product is a consumer product,
289
+ doubtful cases shall be resolved in favor of coverage. For a particular
290
+ product received by a particular user, "normally used" refers to a
291
+ typical or common use of that class of product, regardless of the status
292
+ of the particular user or of the way in which the particular user
293
+ actually uses, or expects or is expected to use, the product. A product
294
+ is a consumer product regardless of whether the product has substantial
295
+ commercial, industrial or non-consumer uses, unless such uses represent
296
+ the only significant mode of use of the product.
297
+
298
+ "Installation Information" for a User Product means any methods,
299
+ procedures, authorization keys, or other information required to install
300
+ and execute modified versions of a covered work in that User Product from
301
+ a modified version of its Corresponding Source. The information must
302
+ suffice to ensure that the continued functioning of the modified object
303
+ code is in no case prevented or interfered with solely because
304
+ modification has been made.
305
+
306
+ If you convey an object code work under this section in, or with, or
307
+ specifically for use in, a User Product, and the conveying occurs as
308
+ part of a transaction in which the right of possession and use of the
309
+ User Product is transferred to the recipient in perpetuity or for a
310
+ fixed term (regardless of how the transaction is characterized), the
311
+ Corresponding Source conveyed under this section must be accompanied
312
+ by the Installation Information. But this requirement does not apply
313
+ if neither you nor any third party retains the ability to install
314
+ modified object code on the User Product (for example, the work has
315
+ been installed in ROM).
316
+
317
+ The requirement to provide Installation Information does not include a
318
+ requirement to continue to provide support service, warranty, or updates
319
+ for a work that has been modified or installed by the recipient, or for
320
+ the User Product in which it has been modified or installed. Access to a
321
+ network may be denied when the modification itself materially and
322
+ adversely affects the operation of the network or violates the rules and
323
+ protocols for communication across the network.
324
+
325
+ Corresponding Source conveyed, and Installation Information provided,
326
+ in accord with this section must be in a format that is publicly
327
+ documented (and with an implementation available to the public in
328
+ source code form), and must require no special password or key for
329
+ unpacking, reading or copying.
330
+
331
+ 7. Additional Terms.
332
+
333
+ "Additional permissions" are terms that supplement the terms of this
334
+ License by making exceptions from one or more of its conditions.
335
+ Additional permissions that are applicable to the entire Program shall
336
+ be treated as though they were included in this License, to the extent
337
+ that they are valid under applicable law. If additional permissions
338
+ apply only to part of the Program, that part may be used separately
339
+ under those permissions, but the entire Program remains governed by
340
+ this License without regard to the additional permissions.
341
+
342
+ When you convey a copy of a covered work, you may at your option
343
+ remove any additional permissions from that copy, or from any part of
344
+ it. (Additional permissions may be written to require their own
345
+ removal in certain cases when you modify the work.) You may place
346
+ additional permissions on material, added by you to a covered work,
347
+ for which you have or can give appropriate copyright permission.
348
+
349
+ Notwithstanding any other provision of this License, for material you
350
+ add to a covered work, you may (if authorized by the copyright holders of
351
+ that material) supplement the terms of this License with terms:
352
+
353
+ a) Disclaiming warranty or limiting liability differently from the
354
+ terms of sections 15 and 16 of this License; or
355
+
356
+ b) Requiring preservation of specified reasonable legal notices or
357
+ author attributions in that material or in the Appropriate Legal
358
+ Notices displayed by works containing it; or
359
+
360
+ c) Prohibiting misrepresentation of the origin of that material, or
361
+ requiring that modified versions of such material be marked in
362
+ reasonable ways as different from the original version; or
363
+
364
+ d) Limiting the use for publicity purposes of names of licensors or
365
+ authors of the material; or
366
+
367
+ e) Declining to grant rights under trademark law for use of some
368
+ trade names, trademarks, or service marks; or
369
+
370
+ f) Requiring indemnification of licensors and authors of that
371
+ material by anyone who conveys the material (or modified versions of
372
+ it) with contractual assumptions of liability to the recipient, for
373
+ any liability that these contractual assumptions directly impose on
374
+ those licensors and authors.
375
+
376
+ All other non-permissive additional terms are considered "further
377
+ restrictions" within the meaning of section 10. If the Program as you
378
+ received it, or any part of it, contains a notice stating that it is
379
+ governed by this License along with a term that is a further
380
+ restriction, you may remove that term. If a license document contains
381
+ a further restriction but permits relicensing or conveying under this
382
+ License, you may add to a covered work material governed by the terms
383
+ of that license document, provided that the further restriction does
384
+ not survive such relicensing or conveying.
385
+
386
+ If you add terms to a covered work in accord with this section, you
387
+ must place, in the relevant source files, a statement of the
388
+ additional terms that apply to those files, or a notice indicating
389
+ where to find the applicable terms.
390
+
391
+ Additional terms, permissive or non-permissive, may be stated in the
392
+ form of a separately written license, or stated as exceptions;
393
+ the above requirements apply either way.
394
+
395
+ 8. Termination.
396
+
397
+ You may not propagate or modify a covered work except as expressly
398
+ provided under this License. Any attempt otherwise to propagate or
399
+ modify it is void, and will automatically terminate your rights under
400
+ this License (including any patent licenses granted under the third
401
+ paragraph of section 11).
402
+
403
+ However, if you cease all violation of this License, then your
404
+ license from a particular copyright holder is reinstated (a)
405
+ provisionally, unless and until the copyright holder explicitly and
406
+ finally terminates your license, and (b) permanently, if the copyright
407
+ holder fails to notify you of the violation by some reasonable means
408
+ prior to 60 days after the cessation.
409
+
410
+ Moreover, your license from a particular copyright holder is
411
+ reinstated permanently if the copyright holder notifies you of the
412
+ violation by some reasonable means, this is the first time you have
413
+ received notice of violation of this License (for any work) from that
414
+ copyright holder, and you cure the violation prior to 30 days after
415
+ your receipt of the notice.
416
+
417
+ Termination of your rights under this section does not terminate the
418
+ licenses of parties who have received copies or rights from you under
419
+ this License. If your rights have been terminated and not permanently
420
+ reinstated, you do not qualify to receive new licenses for the same
421
+ material under section 10.
422
+
423
+ 9. Acceptance Not Required for Having Copies.
424
+
425
+ You are not required to accept this License in order to receive or
426
+ run a copy of the Program. Ancillary propagation of a covered work
427
+ occurring solely as a consequence of using peer-to-peer transmission
428
+ to receive a copy likewise does not require acceptance. However,
429
+ nothing other than this License grants you permission to propagate or
430
+ modify any covered work. These actions infringe copyright if you do
431
+ not accept this License. Therefore, by modifying or propagating a
432
+ covered work, you indicate your acceptance of this License to do so.
433
+
434
+ 10. Automatic Licensing of Downstream Recipients.
435
+
436
+ Each time you convey a covered work, the recipient automatically
437
+ receives a license from the original licensors, to run, modify and
438
+ propagate that work, subject to this License. You are not responsible
439
+ for enforcing compliance by third parties with this License.
440
+
441
+ An "entity transaction" is a transaction transferring control of an
442
+ organization, or substantially all assets of one, or subdividing an
443
+ organization, or merging organizations. If propagation of a covered
444
+ work results from an entity transaction, each party to that
445
+ transaction who receives a copy of the work also receives whatever
446
+ licenses to the work the party's predecessor in interest had or could
447
+ give under the previous paragraph, plus a right to possession of the
448
+ Corresponding Source of the work from the predecessor in interest, if
449
+ the predecessor has it or can get it with reasonable efforts.
450
+
451
+ You may not impose any further restrictions on the exercise of the
452
+ rights granted or affirmed under this License. For example, you may
453
+ not impose a license fee, royalty, or other charge for exercise of
454
+ rights granted under this License, and you may not initiate litigation
455
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
456
+ any patent claim is infringed by making, using, selling, offering for
457
+ sale, or importing the Program or any portion of it.
458
+
459
+ 11. Patents.
460
+
461
+ A "contributor" is a copyright holder who authorizes use under this
462
+ License of the Program or a work on which the Program is based. The
463
+ work thus licensed is called the contributor's "contributor version".
464
+
465
+ A contributor's "essential patent claims" are all patent claims
466
+ owned or controlled by the contributor, whether already acquired or
467
+ hereafter acquired, that would be infringed by some manner, permitted
468
+ by this License, of making, using, or selling its contributor version,
469
+ but do not include claims that would be infringed only as a
470
+ consequence of further modification of the contributor version. For
471
+ purposes of this definition, "control" includes the right to grant
472
+ patent sublicenses in a manner consistent with the requirements of
473
+ this License.
474
+
475
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
476
+ patent license under the contributor's essential patent claims, to
477
+ make, use, sell, offer for sale, import and otherwise run, modify and
478
+ propagate the contents of its contributor version.
479
+
480
+ In the following three paragraphs, a "patent license" is any express
481
+ agreement or commitment, however denominated, not to enforce a patent
482
+ (such as an express permission to practice a patent or covenant not to
483
+ sue for patent infringement). To "grant" such a patent license to a
484
+ party means to make such an agreement or commitment not to enforce a
485
+ patent against the party.
486
+
487
+ If you convey a covered work, knowingly relying on a patent license,
488
+ and the Corresponding Source of the work is not available for anyone
489
+ to copy, free of charge and under the terms of this License, through a
490
+ publicly available network server or other readily accessible means,
491
+ then you must either (1) cause the Corresponding Source to be so
492
+ available, or (2) arrange to deprive yourself of the benefit of the
493
+ patent license for this particular work, or (3) arrange, in a manner
494
+ consistent with the requirements of this License, to extend the patent
495
+ license to downstream recipients. "Knowingly relying" means you have
496
+ actual knowledge that, but for the patent license, your conveying the
497
+ covered work in a country, or your recipient's use of the covered work
498
+ in a country, would infringe one or more identifiable patents in that
499
+ country that you have reason to believe are valid.
500
+
501
+ If, pursuant to or in connection with a single transaction or
502
+ arrangement, you convey, or propagate by procuring conveyance of, a
503
+ covered work, and grant a patent license to some of the parties
504
+ receiving the covered work authorizing them to use, propagate, modify
505
+ or convey a specific copy of the covered work, then the patent license
506
+ you grant is automatically extended to all recipients of the covered
507
+ work and works based on it.
508
+
509
+ A patent license is "discriminatory" if it does not include within
510
+ the scope of its coverage, prohibits the exercise of, or is
511
+ conditioned on the non-exercise of one or more of the rights that are
512
+ specifically granted under this License. You may not convey a covered
513
+ work if you are a party to an arrangement with a third party that is
514
+ in the business of distributing software, under which you make payment
515
+ to the third party based on the extent of your activity of conveying
516
+ the work, and under which the third party grants, to any of the
517
+ parties who would receive the covered work from you, a discriminatory
518
+ patent license (a) in connection with copies of the covered work
519
+ conveyed by you (or copies made from those copies), or (b) primarily
520
+ for and in connection with specific products or compilations that
521
+ contain the covered work, unless you entered into that arrangement,
522
+ or that patent license was granted, prior to 28 March 2007.
523
+
524
+ Nothing in this License shall be construed as excluding or limiting
525
+ any implied license or other defenses to infringement that may
526
+ otherwise be available to you under applicable patent law.
527
+
528
+ 12. No Surrender of Others' Freedom.
529
+
530
+ If conditions are imposed on you (whether by court order, agreement or
531
+ otherwise) that contradict the conditions of this License, they do not
532
+ excuse you from the conditions of this License. If you cannot convey a
533
+ covered work so as to satisfy simultaneously your obligations under this
534
+ License and any other pertinent obligations, then as a consequence you may
535
+ not convey it at all. For example, if you agree to terms that obligate you
536
+ to collect a royalty for further conveying from those to whom you convey
537
+ the Program, the only way you could satisfy both those terms and this
538
+ License would be to refrain entirely from conveying the Program.
539
+
540
+ 13. Remote Network Interaction; Use with the GNU General Public License.
541
+
542
+ Notwithstanding any other provision of this License, if you modify the
543
+ Program, your modified version must prominently offer all users
544
+ interacting with it remotely through a computer network (if your version
545
+ supports such interaction) an opportunity to receive the Corresponding
546
+ Source of your version by providing access to the Corresponding Source
547
+ from a network server at no charge, through some standard or customary
548
+ means of facilitating copying of software. This Corresponding Source
549
+ shall include the Corresponding Source for any work covered by version 3
550
+ of the GNU General Public License that is incorporated pursuant to the
551
+ following paragraph.
552
+
553
+ Notwithstanding any other provision of this License, you have
554
+ permission to link or combine any covered work with a work licensed
555
+ under version 3 of the GNU General Public License into a single
556
+ combined work, and to convey the resulting work. The terms of this
557
+ License will continue to apply to the part which is the covered work,
558
+ but the work with which it is combined will remain governed by version
559
+ 3 of the GNU General Public License.
560
+
561
+ 14. Revised Versions of this License.
562
+
563
+ The Free Software Foundation may publish revised and/or new versions of
564
+ the GNU Affero General Public License from time to time. Such new versions
565
+ will be similar in spirit to the present version, but may differ in detail to
566
+ address new problems or concerns.
567
+
568
+ Each version is given a distinguishing version number. If the
569
+ Program specifies that a certain numbered version of the GNU Affero General
570
+ Public License "or any later version" applies to it, you have the
571
+ option of following the terms and conditions either of that numbered
572
+ version or of any later version published by the Free Software
573
+ Foundation. If the Program does not specify a version number of the
574
+ GNU Affero General Public License, you may choose any version ever published
575
+ by the Free Software Foundation.
576
+
577
+ If the Program specifies that a proxy can decide which future
578
+ versions of the GNU Affero General Public License can be used, that proxy's
579
+ public statement of acceptance of a version permanently authorizes you
580
+ to choose that version for the Program.
581
+
582
+ Later license versions may give you additional or different
583
+ permissions. However, no additional obligations are imposed on any
584
+ author or copyright holder as a result of your choosing to follow a
585
+ later version.
586
+
587
+ 15. Disclaimer of Warranty.
588
+
589
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597
+
598
+ 16. Limitation of Liability.
599
+
600
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608
+ SUCH DAMAGES.
609
+
610
+ 17. Interpretation of Sections 15 and 16.
611
+
612
+ If the disclaimer of warranty and limitation of liability provided
613
+ above cannot be given local legal effect according to their terms,
614
+ reviewing courts shall apply local law that most closely approximates
615
+ an absolute waiver of all civil liability in connection with the
616
+ Program, unless a warranty or assumption of liability accompanies a
617
+ copy of the Program in return for a fee.
618
+
619
+ END OF TERMS AND CONDITIONS
620
+
621
+ How to Apply These Terms to Your New Programs
622
+
623
+ If you develop a new program, and you want it to be of the greatest
624
+ possible use to the public, the best way to achieve this is to make it
625
+ free software which everyone can redistribute and change under these terms.
626
+
627
+ To do so, attach the following notices to the program. It is safest
628
+ to attach them to the start of each source file to most effectively
629
+ state the exclusion of warranty; and each file should have at least
630
+ the "copyright" line and a pointer to where the full notice is found.
631
+
632
+ <one line to give the program's name and a brief idea of what it does.>
633
+ Copyright (C) <year> <name of author>
634
+
635
+ This program is free software: you can redistribute it and/or modify
636
+ it under the terms of the GNU Affero General Public License as published
637
+ by the Free Software Foundation, either version 3 of the License, or
638
+ (at your option) any later version.
639
+
640
+ This program is distributed in the hope that it will be useful,
641
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
642
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643
+ GNU Affero General Public License for more details.
644
+
645
+ You should have received a copy of the GNU Affero General Public License
646
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
647
+
648
+ Also add information on how to contact you by electronic and paper mail.
649
+
650
+ If your software can interact with users remotely through a computer
651
+ network, you should also make sure that it provides a way for users to
652
+ get its source. For example, if your program is a web application, its
653
+ interface could display a "Source" link that leads users to an archive
654
+ of the code. There are many ways you could offer source, and different
655
+ solutions will be better for different programs; see section 13 for the
656
+ specific requirements.
657
+
658
+ You should also get your employer (if you work as a programmer) or school,
659
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
660
+ For more information on this, and how to apply and follow the GNU AGPL, see
661
+ <https://www.gnu.org/licenses/>.
alltalk_tts/README.md ADDED
The diff for this file is too large to render. See raw diff
 
alltalk_tts/atsetup.bat ADDED
@@ -0,0 +1,659 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ cd /D "%~dp0"
3
+ setlocal enabledelayedexpansion
4
+ @set "PATH=%PATH%;%SystemRoot%\system32"
5
+
6
+ :: Generate the ESC character
7
+ for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
8
+
9
+ :: Standard Colors
10
+ set "BLACK=%ESC%[30m"
11
+ set "RED=%ESC%[31m"
12
+ set "GREEN=%ESC%[32m"
13
+ set "YELLOW=%ESC%[33m"
14
+ set "BLUE=%ESC%[34m"
15
+ set "MAGENTA=%ESC%[35m"
16
+ set "CYAN=%ESC%[36m"
17
+ set "WHITE=%ESC%[37m"
18
+ set "L_BLACK=%ESC%[90m"
19
+ set "L_RED=%ESC%[91m"
20
+ set "L_GREEN=%ESC%[92m"
21
+ set "L_YELLOW=%ESC%[93m"
22
+ set "L_BLUE=%ESC%[94m"
23
+ set "L_MAGENTA=%ESC%[95m"
24
+ set "L_CYAN=%ESC%[96m"
25
+ set "L_WHITE=%ESC%[97m"
26
+ set "RESET=%ESC%[0m"
27
+
28
+ echo "%CD%"| findstr /C:" " >nul && echo. && echo %L_BLUE%ALLTALK WINDOWS SETUP UTILITY%RESET% && echo. && echo. && echo You are trying to install AllTalk in a folder that has a space in the folder path e.g. && echo. && echo C:\%L_RED%program files%RESET%\alltalk_tts && echo. && echo This causes errors with Conda and Python scripts. Please follow this link for reference: && echo. && echo %L_CYAN%https://docs.anaconda.com/free/working-with-conda/reference/faq/#installing-anaconda%RESET% && echo. && echo Please use a folder path that has no spaces in it e.g. && echo. && echo C:\myfiles\alltalk_tts\ && echo. && echo. && pause && goto :end
29
+
30
+ @rem Check for special characters in installation path
31
+ set "SPCHARMESSAGE="WARNING: Special characters were detected in the installation path!" " This can cause the installation to fail!""
32
+ echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~]" >nul && (
33
+ call :PrintBigMessage %SPCHARMESSAGE%
34
+ )
35
+ set SPCHARMESSAGE=
36
+
37
+ @rem Check if curl is available
38
+ curl --version >nul 2>&1
39
+ if "%ERRORLEVEL%" NEQ "0" (
40
+ echo curl is not available on this system. Please install curl then re-run the script https://curl.se/
41
+ echo or perform a manual installation of a Conda Python environment.
42
+ goto end
43
+ )
44
+
45
+ :MainMenu
46
+ cls
47
+ echo.
48
+ echo %L_BLUE%ALLTALK WINDOWS SETUP UTILITY%RESET%
49
+ echo.
50
+ echo INSTALLATION TYPE
51
+ echo 1) I am using AllTalk as part of %L_GREEN%Text-generation-webui%RESET%
52
+ echo 2) I am using AllTalk as a %L_GREEN%Standalone Application%RESET%
53
+ echo.
54
+ echo 9) %L_RED%Exit/Quit%RESET%
55
+ echo.
56
+ set /p UserOption=" Enter your choice: "
57
+
58
+ if "%UserOption%"=="1" goto WebUIMenu
59
+ if "%UserOption%"=="2" goto StandaloneMenu
60
+ if "%UserOption%"=="9" goto End
61
+ goto MainMenu
62
+
63
+ :WebUIMenu
64
+ cls
65
+ echo.
66
+ echo %L_BLUE%TEXT-GENERATION-WEBUI SETUP%RESET%
67
+ echo.
68
+ echo Please ensure you have started your Text-generation-webui Python
69
+ echo environment. If you have NOT done this, please run %L_GREEN%cmd_windows.bat%RESET%
70
+ echo in the %L_GREEN%text-generation-webui%RESET% folder and then re-run this script.
71
+ echo.
72
+ echo BASE REQUIREMENTS
73
+ echo 1) Apply/Re-Apply the requirements for %L_GREEN%Text-generation-webui%RESET%.
74
+ echo.
75
+ echo OPTIONAL
76
+ echo 2) Git Pull the latest AllTalk updates from Github
77
+ echo.
78
+ echo DEEPSPEED FOR %L_YELLOW=%PyTorch 2.1.x%RESET%
79
+ echo 4) Install DeepSpeed v11.2 for CUDA %L_GREEN%11.8%RESET% and Python-3.11.x and %L_YELLOW%PyTorch 2.1.x%RESET%.
80
+ echo 5) Install DeepSpeed v11.2 for CUDA %L_GREEN%12.1%RESET% and Python-3.11.x and %L_YELLOW%PyTorch 2.1.x%RESET%.
81
+ echo.
82
+ echo DEEPSPEED FOR %L_YELLOW=%PyTorch 2.2.x%RESET% (March 2024 builds of Text-gen-webui and later)
83
+ echo 6) Install DeepSpeed v14.0 for CUDA %L_GREEN%12.1%RESET% and Python-3.11.x and %L_YELLOW%PyTorch 2.2.x%RESET%.
84
+ echo 7) Install DeepSpeed v14.0 for CUDA %L_GREEN%11.8%RESET% and Python-3.11.x and %L_YELLOW%PyTorch 2.2.x%RESET%.
85
+ echo.
86
+ echo U) Uninstall DeepSpeed.
87
+ echo.
88
+ echo. OTHER
89
+ echo 8) Generate a diagnostics file.
90
+ echo.
91
+ echo 9) %L_RED%Exit/Quit%RESET%
92
+ echo.
93
+ set /p WebUIOption="Enter your choice: "
94
+ if "%WebUIOption%"=="1" goto InstallNvidiaTextGen
95
+ if "%WebUIOption%"=="2" goto TGGitpull
96
+ if "%WebUIOption%"=="4" goto InstallDeepSpeed118TextGen
97
+ if "%WebUIOption%"=="5" goto InstallDeepSpeed121TextGen
98
+ if "%WebUIOption%"=="6" goto InstallDeepSpeed121TextGenPytorch221
99
+ if "%WebUIOption%"=="7" goto InstallDeepSpeed118TextGenPytorch221
100
+ if "%WebUIOption%"=="U" goto UnInstallDeepSpeed
101
+ if "%WebUIOption%"=="u" goto UnInstallDeepSpeed
102
+ if "%WebUIOption%"=="8" goto GenerateDiagsTextGen
103
+ if "%WebUIOption%"=="9" goto End
104
+ goto WebUIMenu
105
+
106
+ :StandaloneMenu
107
+ cls
108
+ echo.
109
+ echo %L_BLUE%ALLTALK STANDALONE APPLICATION SETUP%RESET%
110
+ echo.
111
+ echo BASE REQUIREMENTS
112
+ echo 1) Install AllTalk as a Standalone Application
113
+ echo.
114
+ echo OPTIONAL
115
+ echo 2) Git Pull the latest AllTalk updates from Github
116
+ echo 3) Re-Apply/Update the requirements file
117
+ echo 4) Delete AllTalk's custom Python environment
118
+ echo 5) Purge the PIP cache
119
+ echo.
120
+ echo. OTHER
121
+ echo 8) Generate a diagnostics file
122
+ echo.
123
+ echo 9) %L_RED%Exit/Quit%RESET%
124
+ echo.
125
+ set /p StandaloneOption="Enter your choice: "
126
+ if "%StandaloneOption%"=="1" goto InstallCustomStandalone
127
+ if "%StandaloneOption%"=="2" goto STGitpull
128
+ if "%StandaloneOption%"=="3" goto STReapplyrequirements
129
+ if "%StandaloneOption%"=="4" goto STDeleteCustomStandalone
130
+ if "%StandaloneOption%"=="5" goto STPurgepipcache
131
+ if "%StandaloneOption%"=="8" goto GenerateDiagsStandalone
132
+ if "%StandaloneOption%"=="9" goto EndStandalone
133
+ goto StandaloneMenu
134
+
135
+ :InstallNvidiaTextGen
136
+ pip install -r system\requirements\requirements_textgen.txt
137
+ if %ERRORLEVEL% neq 0 (
138
+ echo.
139
+ echo There was an error installing the requirements.
140
+ echo Have you started your Text-gen-webui Python environment
141
+ echo with cmd_{yourOS} before running atsetup.bat?
142
+ echo Press any key to return to the menu.
143
+ echo.
144
+ pause
145
+ goto WebUIMenu
146
+ )
147
+ Echo.
148
+ echo.
149
+ Echo Requirements installed successfully.
150
+ Echo.
151
+ pause
152
+ goto WebUIMenu
153
+
154
+ :TGGitpull
155
+ git pull
156
+ if %ERRORLEVEL% neq 0 (
157
+ echo.
158
+ echo There was an error pulling from Github.
159
+ echo Press any key to return to the menu.
160
+ echo.
161
+ pause
162
+ goto WebUIMenu
163
+ )
164
+ Echo.
165
+ echo AllTalk Updated from Github. Please re-apply
166
+ echo the latest requirements file. Option 1
167
+ Echo.
168
+ pause
169
+ goto WebUIMenu
170
+
171
+ :InstallDeepSpeed118TextGen
172
+ echo Downloading DeepSpeed...
173
+ curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
174
+ if %ERRORLEVEL% neq 0 (
175
+ echo.
176
+ echo Failed to download DeepSpeed wheel file.
177
+ echo Please check your internet connection or try again later.
178
+ echo Press any key to return to the menu.
179
+ echo.
180
+ pause
181
+ goto WebUIMenu
182
+ )
183
+ echo DeepSpeed wheel file downloaded successfully.
184
+ echo Installing DeepSpeed...
185
+ pip install deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
186
+ if %ERRORLEVEL% neq 0 (
187
+ echo.
188
+ echo Failed to install DeepSpeed.
189
+ echo Please check if the wheel file is compatible with your system.
190
+ echo Press any key to return to the menu.
191
+ echo.
192
+ pause
193
+ goto WebUIMenu
194
+ )
195
+ Echo.
196
+ echo.
197
+ Echo DeepSpeed installed successfully.
198
+ Echo.
199
+ del deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
200
+ pause
201
+ goto WebUIMenu
202
+
203
+ :InstallDeepSpeed121TextGen
204
+ echo Downloading DeepSpeed...
205
+ curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
206
+ if %ERRORLEVEL% neq 0 (
207
+ echo.
208
+ echo Failed to download DeepSpeed wheel file.
209
+ echo Please check your internet connection or try again later.
210
+ echo Press any key to return to the menu.
211
+ echo.
212
+ pause
213
+ goto WebUIMenu
214
+ )
215
+ echo DeepSpeed wheel file downloaded successfully.
216
+ echo Installing DeepSpeed...
217
+ pip install deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
218
+ if %ERRORLEVEL% neq 0 (
219
+ echo.
220
+ echo Failed to install DeepSpeed.
221
+ echo Please check if the wheel file is compatible with your system.
222
+ echo Press any key to return to the menu.
223
+ echo.
224
+ pause
225
+ goto WebUIMenu
226
+ )
227
+ Echo.
228
+ echo.
229
+ Echo DeepSpeed installed successfully.
230
+ Echo.
231
+ del deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
232
+ pause
233
+ goto WebUIMenu
234
+
235
+ :InstallDeepSpeed121TextGenPytorch221
236
+ echo Downloading DeepSpeed...
237
+ curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
238
+ if %ERRORLEVEL% neq 0 (
239
+ echo.
240
+ echo Failed to download DeepSpeed wheel file.
241
+ echo Please check your internet connection or try again later.
242
+ echo Press any key to return to the menu.
243
+ echo.
244
+ pause
245
+ goto WebUIMenu
246
+ )
247
+ echo DeepSpeed wheel file downloaded successfully.
248
+ echo Installing DeepSpeed...
249
+ pip install deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
250
+ if %ERRORLEVEL% neq 0 (
251
+ echo.
252
+ echo Failed to install DeepSpeed.
253
+ echo Please check if the wheel file is compatible with your system.
254
+ echo Press any key to return to the menu.
255
+ echo.
256
+ pause
257
+ goto WebUIMenu
258
+ )
259
+ Echo.
260
+ echo.
261
+ Echo DeepSpeed installed successfully.
262
+ Echo.
263
+ del deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
264
+ pause
265
+ goto WebUIMenu
266
+
267
+ :InstallDeepSpeed118TextGenPytorch221
268
+ echo Downloading DeepSpeed...
269
+ curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.0+cu118-cp311-cp311-win_amd64.whl
270
+ if %ERRORLEVEL% neq 0 (
271
+ echo.
272
+ echo Failed to download DeepSpeed wheel file.
273
+ echo Please check your internet connection or try again later.
274
+ echo Press any key to return to the menu.
275
+ echo.
276
+ pause
277
+ goto WebUIMenu
278
+ )
279
+ echo DeepSpeed wheel file downloaded successfully.
280
+ echo Installing DeepSpeed...
281
+ pip install deepspeed-0.14.0+cu118-cp311-cp311-win_amd64.whl
282
+ if %ERRORLEVEL% neq 0 (
283
+ echo.
284
+ echo Failed to install DeepSpeed.
285
+ echo Please check if the wheel file is compatible with your system.
286
+ echo Press any key to return to the menu.
287
+ echo.
288
+ pause
289
+ goto WebUIMenu
290
+ )
291
+ Echo.
292
+ echo.
293
+ Echo DeepSpeed installed successfully.
294
+ Echo.
295
+ del deepspeed-0.14.0+cu118-cp311-cp311-win_amd64.whl
296
+ pause
297
+ goto WebUIMenu
298
+
299
+ :UnInstallDeepSpeed
300
+ pip uninstall deepspeed
301
+ if %ERRORLEVEL% neq 0 (
302
+ echo.
303
+ echo There was an error uninstalling DeepSpeed.
304
+ echo Press any key to return to the menu.
305
+ echo.
306
+ pause
307
+ goto WebUIMenu
308
+ )
309
+ echo.
310
+ Echo DeepSpeed uninstalled successfully.
311
+ Echo.
312
+ pause
313
+ goto WebUIMenu
314
+
315
+ :GenerateDiagsTextGen
316
+ Python diagnostics.py
317
+ if %ERRORLEVEL% neq 0 (
318
+ echo.
319
+ echo There was an error running diagnostics. Have you correctly started your
320
+ echo Text-generation-webui Python environment with %L_GREEN%cmd_windows.bat%RESET%?
321
+ echo.
322
+ pause
323
+ goto WebUIMenu
324
+ )
325
+ Echo.
326
+ echo.
327
+ Echo Diagnostics.log generated. Please scroll up to look over the log.
328
+ Echo.
329
+ pause
330
+ goto WebUIMenu
331
+
332
+ :InstallCustomStandalone
333
+ set PATH=%PATH%;%SystemRoot%\system32
334
+
335
+ @rem Check if curl is available
336
+ curl --version >nul 2>&1
337
+ if "%ERRORLEVEL%" NEQ "0" (
338
+ echo curl is not available on this system. Please install curl then re-run the script https://curl.se/
339
+ echo or perform a manual installation of a Conda Python environment.
340
+ goto end
341
+ )
342
+ echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. Please correct your folder names and re-try installation. && goto exit
343
+
344
+ @rem Check for special characters in installation path
345
+ set "SPCHARMESSAGE=WARNING: Special characters were detected in the installation path! This can cause the installation to fail!"
346
+ echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~]" >nul && (
347
+ call :PrintBigMessage %SPCHARMESSAGE%
348
+ )
349
+ set SPCHARMESSAGE=
350
+
351
+ @rem fix failed install when installing to a separate drive
352
+ set TMP=%cd%\alltalk_environment
353
+ set TEMP=%cd%\alltalk_environment
354
+
355
+ @rem deactivate existing conda envs as needed to avoid conflicts
356
+ (call conda deactivate && call conda deactivate && call conda deactivate) 2>nul
357
+
358
+ @rem config
359
+ set INSTALL_DIR=%cd%\alltalk_environment
360
+ set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
361
+ set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
362
+ set MINICONDA_DOWNLOAD_URL=https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe
363
+ set conda_exists=F
364
+
365
+ @rem figure out whether git and conda need to be installed
366
+ call "%CONDA_ROOT_PREFIX%\_conda.exe" --version >nul 2>&1
367
+ if "%ERRORLEVEL%" EQU "0" (
368
+ set conda_exists=T
369
+ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
370
+ goto RunScript
371
+ )
372
+
373
+ @rem download and install conda if not installed
374
+ echo Downloading Miniconda from %MINICONDA_DOWNLOAD_URL% to %INSTALL_DIR%\miniconda_installer.exe
375
+ mkdir "%INSTALL_DIR%"
376
+ call curl -Lk "%MINICONDA_DOWNLOAD_URL%" > "%INSTALL_DIR%\miniconda_installer.exe" || ( echo. && echo Miniconda failed to download. && goto end )
377
+ echo Installing Miniconda to %CONDA_ROOT_PREFIX%
378
+ start /wait "" "%INSTALL_DIR%\miniconda_installer.exe" /InstallationType=JustMe /NoShortcuts=1 /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=%CONDA_ROOT_PREFIX%
379
+ echo Miniconda version:
380
+ call "%CONDA_ROOT_PREFIX%\_conda.exe" --version || ( echo. && echo Miniconda not found. && goto end )
381
+
382
+ @rem create the installer env
383
+ echo Packages to install: %PACKAGES_TO_INSTALL%
384
+ call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.11 || ( echo. && echo Conda environment creation failed. && goto end )
385
+
386
+ @rem check if conda environment was actually created
387
+ if not exist "%INSTALL_ENV_DIR%\python.exe" ( echo. && echo Conda environment is empty. && goto end )
388
+
389
+ @rem activate installer env
390
+ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
391
+
392
+ echo.
393
+ echo Downloading and installing PyTorch. This step can take a long time
394
+ echo depending on your internet connection and hard drive speed. Please
395
+ echo be patient.
396
+ echo.
397
+ pip install torch==2.2.2+cu121 torchaudio>=2.2.2+cu121 --upgrade --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu121
398
+ echo Installing other requirements.
399
+ echo.
400
+ pip install -r system\requirements\requirements_standalone.txt
401
+ curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
402
+ echo Installing DeepSpeed...
403
+ pip install deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
404
+ del deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
405
+
406
+
407
+ @rem Create start_environment.bat to run AllTalk environment
408
+ echo @echo off > start_environment.bat
409
+ echo cd /D "%~dp0" >> start_environment.bat
410
+ echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_environment.bat
411
+ echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_environment.bat
412
+ echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_environment.bat
413
+ @rem Create start_alltalk.bat to run AllTalk
414
+ echo @echo off > start_alltalk.bat
415
+ echo cd /D "%~dp0" >> start_alltalk.bat
416
+ echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_alltalk.bat
417
+ echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_alltalk.bat
418
+ echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_alltalk.bat
419
+ echo call python script.py >> start_alltalk.bat
420
+ @rem Create start_finetune.bat to run AllTalk
421
+ echo @echo off > start_finetune.bat
422
+ echo cd /D "%~dp0" >> start_finetune.bat
423
+ echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_finetune.bat
424
+ echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_finetune.bat
425
+ echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_finetune.bat
426
+ echo call python finetune.py >> start_finetune.bat
427
+ Echo.
428
+ Echo Run %L_YELLOW%start_alltalk.bat%RESET% to start AllTalk.
429
+ Echo Run %L_YELLOW%start_finetune.bat%RESET% to start Finetuning.
430
+ Echo Run %L_YELLOW%start_environment.bat%RESET% to start the AllTalk Python environment.
431
+ Echo.
432
+ pause
433
+ goto StandaloneMenu
434
+
435
+ :STDeleteCustomStandalone
436
+ @rem Check if the alltalk_environment directory exists
437
+ if not exist "%cd%\alltalk_environment\" (
438
+ echo.
439
+ echo %L_GREEN%alltalk_environment%RESET% directory does not exist. No need to delete.
440
+ echo.
441
+ pause
442
+ goto StandaloneMenu
443
+ )
444
+ @rem Check if a Conda environment is active
445
+ if not defined CONDA_PREFIX goto NoCondaEnvDeleteCustomStandalone
446
+ @rem Deactivate Conda environment if it's active
447
+ Echo Exiting the Conda Environment. Please run %L_GREEN%atsetup.bat%RESET% again and delete the environment.
448
+ conda deactivate
449
+ :NoCondaEnvDeleteCustomStandalone
450
+ echo Deleting "alltalk_environment". Please wait.
451
+ rd /s /q "alltalk_environment"
452
+ del start_alltalk.bat
453
+ del start_environment.bat
454
+ if %ERRORLEVEL% neq 0 (
455
+ echo.
456
+ echo Failed to delete alltalk_environment folder.
457
+ echo Please make sure it is not in use and try again.
458
+ echo.
459
+ pause
460
+ goto StandaloneMenu
461
+ )
462
+ echo.
463
+ Echo.
464
+ echo Environment %L_GREEN%alltalk_environment%RESET% deleted. Please set up the environment again.
465
+ Echo.
466
+ pause
467
+ goto StandaloneMenu
468
+
469
+ :GenerateDiagsStandalone
470
+ cd /D "%~dp0"
471
+ set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
472
+ set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
473
+ @rem Check if the Conda environment exists
474
+ if not exist "%INSTALL_ENV_DIR%\python.exe" (
475
+ echo.
476
+ echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
477
+ echo Please install the environment before proceeding.
478
+ echo.
479
+ pause
480
+ goto StandaloneMenu
481
+ )
482
+ @rem Attempt to activate the Conda environment
483
+ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
484
+ if errorlevel 1 (
485
+ echo.
486
+ echo Failed to activate the Conda environment.
487
+ echo Please check your installation and try again.
488
+ echo.
489
+ pause
490
+ goto StandaloneMenu
491
+ )
492
+ @rem Run diagnostics
493
+ Python diagnostics.py
494
+ if %ERRORLEVEL% neq 0 (
495
+ echo.
496
+ echo There was an error running diagnostics.
497
+ echo Press any key to return to the menu.
498
+ echo.
499
+ pause
500
+ goto StandaloneMenu
501
+ )
502
+ Echo.
503
+ Echo.
504
+ Echo Diagnostics.log generated. Please scroll up to look over the log.
505
+ Echo.
506
+ pause
507
+ goto StandaloneMenu
508
+
509
+ :STReapplyrequirements
510
+ cd /D "%~dp0"
511
+ set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
512
+ set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
513
+ @rem Check if the Conda environment exists
514
+ if not exist "%INSTALL_ENV_DIR%\python.exe" (
515
+ echo.
516
+ echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
517
+ echo Please install the environment before proceeding.
518
+ echo.
519
+ pause
520
+ goto StandaloneMenu
521
+ )
522
+ @rem Attempt to activate the Conda environment
523
+ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
524
+ if errorlevel 1 (
525
+ echo.
526
+ echo Failed to activate the Conda environment.
527
+ echo Please check your installation and try again.
528
+ echo.
529
+ pause
530
+ goto StandaloneMenu
531
+ )
532
+ @rem Run Reapply requirements
533
+ echo.
534
+ echo Downloading and installing PyTorch. This step can take a long time
535
+ echo depending on your internet connection and hard drive speed. Please
536
+ echo be patient.
537
+ echo.
538
+ pip install torch==2.2.2+cu121 torchaudio>=2.2.2+cu121 --upgrade --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu121
539
+ echo Installing other requirements.
540
+ echo.
541
+ pip install -r system\requirements\requirements_standalone.txt
542
+ C:/Windows/system32/curl.exe -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
543
+ echo Installing DeepSpeed...
544
+ pip install deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
545
+ del deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
546
+ if %ERRORLEVEL% neq 0 (
547
+ echo.
548
+ echo There was an error.
549
+ echo Press any key to return to the menu.
550
+ echo.
551
+ pause
552
+ goto StandaloneMenu
553
+ )
554
+ Echo.
555
+ Echo.
556
+ Echo Requirements have been re-applied/updated.
557
+ Echo.
558
+ pause
559
+ goto StandaloneMenu
560
+
561
+ :STPurgepipcache
562
+ cd /D "%~dp0"
563
+ set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
564
+ set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
565
+ @rem Check if the Conda environment exists
566
+ if not exist "%INSTALL_ENV_DIR%\python.exe" (
567
+ echo.
568
+ echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
569
+ echo Please install the environment before proceeding.
570
+ echo.
571
+ pause
572
+ goto StandaloneMenu
573
+ )
574
+ @rem Attempt to activate the Conda environment
575
+ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
576
+ if errorlevel 1 (
577
+ echo.
578
+ echo Failed to activate the Conda environment.
579
+ echo Please check your installation and try again.
580
+ echo.
581
+ pause
582
+ goto StandaloneMenu
583
+ )
584
+ @rem Clear the PIP cache
585
+ echo.
586
+ echo Purging the PIP cache of downloaded files.
587
+ echo.
588
+ pip cache purge
589
+ if %ERRORLEVEL% neq 0 (
590
+ echo.
591
+ echo There was an error.
592
+ echo Press any key to return to the menu.
593
+ echo.
594
+ pause
595
+ goto StandaloneMenu
596
+ )
597
+ Echo.
598
+ Echo The PIP cache has been purged.
599
+ Echo.
600
+ pause
601
+ goto StandaloneMenu
602
+
603
+ :STGitpull
604
+ cd /D "%~dp0"
605
+ set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
606
+ set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
607
+ @rem Check if the Conda environment exists
608
+ if not exist "%INSTALL_ENV_DIR%\python.exe" (
609
+ echo.
610
+ echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
611
+ echo Please install the environment before proceeding.
612
+ echo.
613
+ pause
614
+ goto StandaloneMenu
615
+ )
616
+ @rem Attempt to activate the Conda environment
617
+ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
618
+ if errorlevel 1 (
619
+ echo.
620
+ echo Failed to activate the Conda environment.
621
+ echo Please check your installation and try again.
622
+ echo.
623
+ pause
624
+ goto StandaloneMenu
625
+ )
626
+ @rem Pull from Github
627
+ echo.
628
+ echo Pulling the latest updates. Please re-apply
629
+ echo the latest requirements file. Option 3
630
+ echo.
631
+ git pull
632
+ if %ERRORLEVEL% neq 0 (
633
+ echo.
634
+ echo There was an error pulling from Github.
635
+ echo Press any key to return to the menu.
636
+ echo.
637
+ pause
638
+ goto StandaloneMenu
639
+ )
640
+ Echo.
641
+ echo AllTalk Updated from Github. Please re-apply
642
+ echo the latest requirements file. Option 3
643
+ Echo.
644
+ pause
645
+ goto StandaloneMenu
646
+
647
+ :EndStandalone
648
+ echo Exiting AllTalk Setup Utility...
649
+ echo.
650
+ Echo Remember, after installation you can....
651
+ Echo Run %L_YELLOW%start_alltalk.bat%RESET% to start AllTalk.
652
+ Echo Run %L_YELLOW%start_finetune.bat%RESET% to start Finetuning.
653
+ Echo Run %L_YELLOW%start_environment.bat%RESET% to start the AllTalk Python environment.
654
+ Echo.
655
+ exit /b
656
+
657
+ :End
658
+ echo Exiting AllTalk Setup Utility...
659
+ exit /b
alltalk_tts/atsetup.sh ADDED
@@ -0,0 +1,520 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # ANSI color codes
4
+ RED='\033[1;31m'
5
+ GREEN='\033[1;32m'
6
+ YELLOW='\033[1;33m'
7
+ BLUE='\033[1;34m'
8
+ CYAN='\033[1;36m'
9
+ MAGENTA='\033[1;35m'
10
+ WHITE='\033[1;37m'
11
+ L_RED='\033[1;91m'
12
+ L_GREEN='\033[1;92m'
13
+ L_YELLOW='\033[1;93m'
14
+ L_BLUE='\033[1;94m'
15
+ L_CYAN='\033[1;96m'
16
+ L_MAGENTA='\033[1;95m'
17
+ NC='\033[0m' # No Color
18
+
19
+ # Navigate to the script's directory
20
+ cd "$(dirname "$0")"
21
+
22
+ # Function to check if curl is installed
23
+ check_curl() {
24
+ if ! command -v curl &> /dev/null; then
25
+ echo "curl is not available on this system. Please install curl then re-run the script https://curl.se/"
26
+ echo "or perform a manual installation of a Conda Python environment."
27
+ exit 1
28
+ fi
29
+ }
30
+
31
+ # Check if the current directory path contains a space
32
+ containsSpace=false
33
+ currentPath=$(pwd)
34
+ if echo "$currentPath" | grep -q ' '; then
35
+ containsSpace=true
36
+ fi
37
+
38
+ if [ "$containsSpace" = true ]; then
39
+ echo
40
+ echo -e " ${L_BLUE}ALLTALK LINUX SETUP UTILITY${NC}"
41
+ echo
42
+ echo
43
+ echo -e " You are trying to install AllTalk in a folder that has a space in the"
44
+ echo -e " folder path e.g."
45
+ echo
46
+ echo -e " /home/${L_RED}program files${NC}/alltalk_tts"
47
+ echo
48
+ echo -e " This causes errors with Conda and Python scripts. Please follow this"
49
+ echo -e " link for reference:"
50
+ echo
51
+ echo -e " ${L_CYAN}https://docs.anaconda.com/free/working-with-conda/reference/faq/#installing-anaconda${NC}"
52
+ echo
53
+ echo -e " Please use a folder path that has no spaces in it e.g."
54
+ echo
55
+ echo -e " /home/myfiles/alltalk_tts/"
56
+ echo
57
+ echo
58
+ read -p "Press Enter to continue..."
59
+ exit 1
60
+ else
61
+ # Continue with the main menu
62
+ echo "Continue with the main menu."
63
+ fi
64
+
65
+ # Main Menu
66
+ main_menu() {
67
+ while true; do
68
+ clear
69
+ echo
70
+ echo -e " ${L_BLUE}ALLTALK LINUX SETUP UTILITY${NC}"
71
+ echo
72
+ echo " INSTALLATION TYPE"
73
+ echo -e " 1) I am using AllTalk as part of ${L_GREEN}Text-generation-webui${NC}"
74
+ echo -e " 2) I am using AllTalk as a ${L_GREEN}Standalone Application${NC}"
75
+ echo
76
+ echo -e " 9)${L_RED} Exit/Quit${NC}"
77
+ echo
78
+ read -p " Enter your choice: " user_option
79
+
80
+ case $user_option in
81
+ 1) webui_menu ;;
82
+ 2) standalone_menu ;;
83
+ 9) exit 0 ;;
84
+ *) echo "Invalid option"; sleep 2 ;;
85
+ esac
86
+ done
87
+ }
88
+
89
+ # Text-generation-webui Menu
90
+ webui_menu() {
91
+ while true; do
92
+ clear
93
+ echo
94
+ echo -e " ${L_BLUE}TEXT-GENERATION-WEBUI SETUP${NC}"
95
+ echo
96
+ echo -e " Please ensure you have started your Text-generation-webui Python"
97
+ echo -e " environment. If you have NOT done this, please run ${L_GREEN}/cmd_linux.sh${NC}"
98
+ echo -e " in the ${L_GREEN}text-generation-webui${NC} folder and then re-run this script."
99
+ echo
100
+ echo " BASE REQUIREMENTS"
101
+ echo -e " 1) Apply/Re-Apply the requirements for an ${L_GREEN}Text-generation-webui${NC}"
102
+ echo
103
+ echo " OPTIONAL"
104
+ echo " 2) Git Pull the latest AllTalk updates from Github"
105
+ echo
106
+ echo " DEEPSPEED"
107
+ echo " 4) Install DeepSpeed."
108
+ echo " 5) Uninstall DeepSpeed."
109
+ echo
110
+ echo " OTHER"
111
+ echo " 6) Generate a diagnostics file."
112
+ echo
113
+ echo -e " 9)${L_RED} Exit/Quit${NC}"
114
+ echo
115
+ read -p " Enter your choice: " webui_option
116
+
117
+ case $webui_option in
118
+ 1) install_nvidia_textgen ;;
119
+ 2) tg_gitpull ;;
120
+ 4) install_deepspeed ;;
121
+ 5) uninstall_deepspeed ;;
122
+ 6) generate_diagnostics_textgen ;;
123
+ 9) exit 0 ;;
124
+ *) echo "Invalid option"; sleep 2 ;;
125
+ esac
126
+ done
127
+ }
128
+
129
+ install_nvidia_textgen() {
130
+ local requirements_file="system/requirements/requirements_textgen.txt"
131
+ echo " Installing Requirements from $requirements_file..."
132
+ if ! pip install -r "$requirements_file"; then
133
+ echo
134
+ echo " There was an error pulling from Github."
135
+ echo " Please check the output for details."
136
+ read -p " Press any key to return to the menu. " -n 1
137
+ echo
138
+ return
139
+ fi
140
+ echo
141
+ echo " Requirements installed successfully."
142
+ echo
143
+ echo -e " To install ${L_YELLOW}DeepSpeed${NC} on Linux, there are additional"
144
+ echo -e " steps required. Please see the Github or documentation on DeepSeed."
145
+ echo
146
+ read -p " Press any key to continue. " -n 1
147
+ echo
148
+ }
149
+
150
+ tg_gitpull() {
151
+ echo
152
+ if ! git pull; then
153
+ echo
154
+ echo " There was an error installing the requirements."
155
+ echo " Please check the output for details."
156
+ echo
157
+ read -p " Press any key to return to the menu. " -n 1
158
+ echo
159
+ return
160
+ fi
161
+ echo
162
+ echo " AllTalk Updated from Github. Please re-apply"
163
+ echo " the latest requirements file. (Option 1)"
164
+ echo
165
+ read -p " Press any key to continue. " -n 1
166
+ echo
167
+ }
168
+
169
+ # Function to install DeepSpeed
170
+ install_deepspeed() {
171
+ clear
172
+ echo
173
+ echo -e " ${L_BLUE}DEEPSPEED INSTALLATION REQUIREMENTS${NC}"
174
+ echo
175
+ echo -e " - NVIDIA CUDA Toolkit must be installed from your ${L_GREEN}Linux package manager${NC}"
176
+ echo -e " or ${L_GREEN}https://developer.nvidia.com/cuda-toolkit-archive${NC}"
177
+ echo -e " - The environment variable ${L_GREEN}CUDA_HOME${NC} must be set in your Python env"
178
+ echo -e " e.g. export CUDA_HOME=/usr/local/cuda."
179
+ echo -e " - ${L_GREEN}libaio-dev${NC} must be installed."
180
+ echo
181
+ echo -e " See the following link for full instructions:"
182
+ echo -e " ${L_GREEN}https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options${NC}"
183
+ echo
184
+ echo -e " ${L_BLUE}Please ${L_RED}confirm${L_BLUE} that you have completed these steps before continuing"
185
+ echo -e " with the DeepSpeed installation, or the install ${L_RED}will fail.${NC}"
186
+ echo
187
+ read -p " Have you completed all the above steps? (y/n): " confirm
188
+
189
+ if [ "$confirm" != "y" ]; then
190
+ echo -e " ${RED}DeepSpeed installation cannot proceed without completing the prerequisites.${NC}"
191
+ return
192
+ fi
193
+
194
+ echo -e "\n ${GREEN}Proceeding with DeepSpeed installation...${NC}"
195
+ pip install deepspeed
196
+ if [ $? -ne 0 ]; then
197
+ echo -e " ${RED}There was an error installing DeepSpeed.${NC}"
198
+ return
199
+ fi
200
+
201
+ echo -e " ${GREEN}DeepSpeed installed successfully.${NC}"
202
+ read -p " Press any key to continue. " -n 1
203
+ echo
204
+ }
205
+
206
+ uninstall_deepspeed() {
207
+ echo "Uninstalling DeepSpeed..."
208
+ pip uninstall -y deepspeed
209
+ if [ $? -ne 0 ]; then
210
+ echo
211
+ echo " There was an error uninstalling DeepSpeed."
212
+ echo
213
+ echo " Press any key to return to the menu."
214
+ read -n 1
215
+ return
216
+ fi
217
+ echo
218
+ echo " DeepSpeed uninstalled successfully."
219
+ echo
220
+ echo " Press any key to continue."
221
+ read -n 1
222
+ }
223
+
224
+ generate_diagnostics_textgen() {
225
+ # Run diagnostics
226
+ if ! python diagnostics.py; then
227
+ echo
228
+ echo " There was an error running diagnostics."
229
+ echo
230
+ read -p " Press any key to return to the menu. " -n 1
231
+ echo
232
+ return
233
+ fi
234
+ echo
235
+ echo " Diagnostics log file generated successfully."
236
+ echo " Please see diagnostics.log"
237
+ echo
238
+ read -p " Press any key to continue. " -n 1
239
+ echo
240
+ }
241
+
242
+ # Standalone Menu
243
+ standalone_menu() {
244
+ while true; do
245
+ clear
246
+ echo
247
+ echo -e " ${L_BLUE}ALLTALK STANDALONE APPLICATION SETUP${NC}"
248
+ echo
249
+ echo " BASE REQUIREMENTS"
250
+ echo " 1) Install AllTalk as a Standalone Application"
251
+ echo
252
+ echo " OPTIONAL"
253
+ echo " 2) Git Pull the latest AllTalk updates from Github"
254
+ echo " 3) Re-Apply/Update the requirements file"
255
+ echo " 4) Delete AllTalk's custom Python environment"
256
+ echo " 5) Purge the PIP cache"
257
+ echo
258
+ echo " DEEPSPEED"
259
+ echo " 6) DeepSpeed Instructions/Install"
260
+ echo
261
+ echo " OTHER"
262
+ echo " 8) Generate a diagnostics file"
263
+ echo
264
+ echo -e " 9)${L_RED} Exit/Quit${NC}"
265
+ echo
266
+ read -p " Enter your choice: " standalone_option
267
+
268
+ case $standalone_option in
269
+ 1) install_custom_standalone ;;
270
+ 2) gitpull_standalone ;;
271
+ 3) reapply_standalone ;;
272
+ 4) delete_custom_standalone ;;
273
+ 5) pippurge_standalone ;;
274
+ 6) install_deepspeed ;;
275
+ 8) generate_diagnostics_standalone ;;
276
+ 9) exit 0 ;;
277
+ *) echo "Invalid option"; sleep 2 ;;
278
+ esac
279
+ done
280
+ }
281
+
282
+
283
+ install_custom_standalone() {
284
+ cd "$(dirname "${BASH_SOURCE[0]}")"
285
+
286
+ if [[ "$(pwd)" =~ " " ]]; then
287
+ echo "This script relies on Miniconda which can not be silently installed under a path with spaces."
288
+ exit
289
+ fi
290
+
291
+ # Deactivate existing conda envs as needed to avoid conflicts
292
+ { conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
293
+
294
+ OS_ARCH=$(uname -m)
295
+ case "${OS_ARCH}" in
296
+ x86_64*) OS_ARCH="x86_64" ;;
297
+ arm64* | aarch64*) OS_ARCH="aarch64" ;;
298
+ *) echo "Unknown system architecture: $OS_ARCH! This script runs only on x86_64 or arm64" && exit ;;
299
+ esac
300
+
301
+ # Config
302
+ INSTALL_DIR="$(pwd)/alltalk_environment"
303
+ CONDA_ROOT_PREFIX="${INSTALL_DIR}/conda"
304
+ INSTALL_ENV_DIR="${INSTALL_DIR}/env"
305
+ MINICONDA_DOWNLOAD_URL="https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Linux-${OS_ARCH}.sh"
306
+
307
+ if [ ! -x "${CONDA_ROOT_PREFIX}/bin/conda" ]; then
308
+ echo "Downloading Miniconda from $MINICONDA_DOWNLOAD_URL to ${INSTALL_DIR}/miniconda_installer.sh"
309
+ mkdir -p "${INSTALL_DIR}"
310
+ curl -L "${MINICONDA_DOWNLOAD_URL}" -o "${INSTALL_DIR}/miniconda_installer.sh"
311
+ chmod +x "${INSTALL_DIR}/miniconda_installer.sh"
312
+ bash "${INSTALL_DIR}/miniconda_installer.sh" -b -p "${CONDA_ROOT_PREFIX}"
313
+ echo "Miniconda installed."
314
+ fi
315
+
316
+ if [ ! -d "${INSTALL_ENV_DIR}" ]; then
317
+ "${CONDA_ROOT_PREFIX}/bin/conda" create -y --prefix "${INSTALL_ENV_DIR}" python=3.11
318
+ echo "Conda environment created at ${INSTALL_ENV_DIR}."
319
+ fi
320
+
321
+ # Activate the environment and install requirements
322
+ source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh"
323
+ conda activate "${INSTALL_ENV_DIR}"
324
+ echo
325
+ echo " Downloading and installing PyTorch. This step can take a long time"
326
+ echo " depending on your internet connection and hard drive speed. Please"
327
+ echo " be patient."
328
+ pip install torch==2.2.1+cu121 torchaudio==2.2.1+cu121 --upgrade --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu121
329
+ echo
330
+ echo " Installing additional requirements."
331
+ echo
332
+ pip install -r system/requirements/requirements_standalone.txt
333
+ # Create start_environment.sh to run AllTalk
334
+ cat << EOF > start_environment.sh
335
+ #!/bin/bash
336
+ cd "$(dirname "${BASH_SOURCE[0]}")"
337
+ if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi
338
+ # deactivate existing conda envs as needed to avoid conflicts
339
+ { conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
340
+ # config
341
+ CONDA_ROOT_PREFIX="$(pwd)/alltalk_environment/conda"
342
+ INSTALL_ENV_DIR="$(pwd)/alltalk_environment/env"
343
+ # environment isolation
344
+ export PYTHONNOUSERSITE=1
345
+ unset PYTHONPATH
346
+ unset PYTHONHOME
347
+ export CUDA_PATH="$INSTALL_ENV_DIR"
348
+ export CUDA_HOME="$CUDA_PATH"
349
+ export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))'`
350
+ # activate env
351
+ bash --init-file <(echo "source \"$CONDA_ROOT_PREFIX/etc/profile.d/conda.sh\" && conda activate \"$INSTALL_ENV_DIR\"")
352
+ EOF
353
+ # Create start_alltalk.sh to run AllTalk
354
+ cat << EOF > start_alltalk.sh
355
+ #!/bin/bash
356
+ export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))'`
357
+ source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh"
358
+ conda activate "${INSTALL_ENV_DIR}"
359
+ python script.py
360
+ EOF
361
+ # Create start_finetune.sh to run AllTalk
362
+ cat << EOF > start_finetune.sh
363
+ #!/bin/bash
364
+ export TRAINER_TELEMETRY=0
365
+ export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))'`
366
+ source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh"
367
+ conda activate "${INSTALL_ENV_DIR}"
368
+ python finetune.py
369
+ EOF
370
+ chmod +x start_alltalk.sh
371
+ chmod +x start_environment.sh
372
+ chmod +x start_finetune.sh
373
+ echo
374
+ echo
375
+ echo -e " Run ${L_YELLOW}./start_alltalk.sh${NC} to start AllTalk."
376
+ echo -e " Run ${L_YELLOW}./start_finetune.sh${NC} to start Finetuning."
377
+ echo -e " Run ${L_YELLOW}./start_environment.sh${NC} to start the AllTalk Python environment."
378
+ echo
379
+ echo -e " To install ${L_YELLOW}DeepSpeed${NC} on Linux, there are additional"
380
+ echo -e " steps required. Please see the Github or documentation on DeepSeed."
381
+ echo
382
+ read -p " Press any key to continue. " -n 1
383
+ }
384
+
385
+ delete_custom_standalone() {
386
+ local env_dir="$PWD/alltalk_environment"
387
+ # Check if the alltalk_environment directory exists
388
+ if [ ! -d "$env_dir" ]; then
389
+ echo " \"$env_dir\" directory does not exist. No need to delete."
390
+ read -p " Press any key to continue. " -n 1
391
+ echo
392
+ return
393
+ fi
394
+ # Check if a Conda environment is active and deactivate it
395
+ if [ -n "$CONDA_PREFIX" ]; then
396
+ echo " Exiting the Conda environment. You may need to start ./atstart.sh again"
397
+ conda deactivate
398
+ fi
399
+ echo "Deleting \"$env_dir\". Please wait."
400
+ rm -rf "$env_dir"
401
+ if [ -d "$env_dir" ]; then
402
+ echo " Failed to delete \"$env_dir\" folder."
403
+ echo " Please make sure it is not in use and try again."
404
+ else
405
+ echo " Environment \"$env_dir\" deleted successfully."
406
+ fi
407
+ read -p " Press any key to continue. " -n 1
408
+ echo
409
+ }
410
+
411
+ generate_diagnostics_standalone() {
412
+ local env_dir="$PWD/alltalk_environment"
413
+ local conda_root_prefix="${env_dir}/conda"
414
+ local install_env_dir="${env_dir}/env"
415
+ if [ ! -d "${install_env_dir}" ]; then
416
+ echo
417
+ echo " The Conda environment at '${install_env_dir}' does not exist."
418
+ echo " Please install the environment before proceeding."
419
+ echo
420
+ read -p " Press any key to return to the menu. " -n 1
421
+ echo
422
+ return
423
+ fi
424
+ source "${conda_root_prefix}/etc/profile.d/conda.sh"
425
+ conda activate "${install_env_dir}"
426
+ if ! python diagnostics.py; then
427
+ echo
428
+ echo " There was an error running diagnostics."
429
+ echo
430
+ read -p " Press any key to return to the menu. " -n 1
431
+ echo
432
+ return
433
+ fi
434
+ echo
435
+ echo " Diagnostics completed successfully."
436
+ read -p " Press any key to continue. " -n 1
437
+ echo
438
+ }
439
+
440
+ gitpull_standalone() {
441
+ local env_dir="$PWD/alltalk_environment"
442
+ local conda_root_prefix="${env_dir}/conda"
443
+ local install_env_dir="${env_dir}/env"
444
+ if [ ! -d "${install_env_dir}" ]; then
445
+ echo
446
+ echo " The Conda environment at '${install_env_dir}' does not exist."
447
+ echo " Please install the environment before proceeding."
448
+ echo
449
+ read -p " Press any key to return to the menu. " -n 1
450
+ echo
451
+ return
452
+ fi
453
+ source "${conda_root_prefix}/etc/profile.d/conda.sh"
454
+ conda activate "${install_env_dir}"
455
+ if ! git pull; then
456
+ echo
457
+ echo " There was an error pulling from Github."
458
+ echo
459
+ read -p " Press any key to return to the menu. " -n 1
460
+ echo
461
+ return
462
+ fi
463
+ echo
464
+ echo " AllTalk Updated from Github. Please re-apply."
465
+ echo " the latest requirements file. (Option 3)"
466
+ echo
467
+ read -p " Press any key to continue. " -n 1
468
+ echo
469
+ }
470
+
471
+ pippurge_standalone() {
472
+ if ! pip cache purge; then
473
+ echo
474
+ echo " There was an error."
475
+ echo
476
+ read -p " Press any key to return to the menu. " -n 1
477
+ echo
478
+ return
479
+ fi
480
+ echo
481
+ echo " The PIP cache has been purged."
482
+ echo
483
+ read -p " Press any key to continue. " -n 1
484
+ echo
485
+ }
486
+
487
+ reapply_standalone() {
488
+ local env_dir="$PWD/alltalk_environment"
489
+ local conda_root_prefix="${env_dir}/conda"
490
+ local install_env_dir="${env_dir}/env"
491
+ if [ ! -d "${install_env_dir}" ]; then
492
+ echo
493
+ echo " The Conda environment at '${install_env_dir}' does not exist."
494
+ echo " Please install the environment before proceeding."
495
+ echo
496
+ read -p " Press any key to return to the menu. " -n 1
497
+ echo
498
+ return
499
+ fi
500
+ source "${conda_root_prefix}/etc/profile.d/conda.sh"
501
+ conda activate "${install_env_dir}"
502
+ echo
503
+ echo " Downloading and installing PyTorch. This step can take a long time"
504
+ echo " depending on your internet connection and hard drive speed. Please"
505
+ echo " be patient."
506
+ pip install torch>=2.2.1+cu121 torchaudio>=2.2.1+cu121 --upgrade --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu121
507
+ echo
508
+ echo " Installing additional requirements."
509
+ echo
510
+ pip install -r system/requirements/requirements_standalone.txt
511
+ echo
512
+ echo " Requirements have been re-applied/updated."
513
+ echo
514
+ read -p " Press any key to continue. " -n 1
515
+ echo
516
+ }
517
+
518
+
519
+ # Start the main menu
520
+ main_menu
alltalk_tts/confignew.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activate": true,
3
+ "autoplay": true,
4
+ "branding": "AllTalk ",
5
+ "narrator_enabled": false,
6
+ "deepspeed_activate": false,
7
+ "delete_output_wavs": "Disabled",
8
+ "ip_address": "127.0.0.1",
9
+ "language": "English",
10
+ "low_vram": false,
11
+ "local_temperature": "0.7",
12
+ "local_repetition_penalty": "10.0",
13
+ "tts_model_loaded": true,
14
+ "tts_model_name": "tts_models/multilingual/multi-dataset/xtts_v2",
15
+ "narrator_voice": "female_01.wav",
16
+ "output_folder_wav": "extensions/alltalk_tts/outputs/",
17
+ "output_folder_wav_standalone": "outputs/",
18
+ "port_number": "7851",
19
+ "remove_trailing_dots": false,
20
+ "show_text": true,
21
+ "tts_method_api_local": false,
22
+ "tts_method_api_tts": false,
23
+ "tts_method_xtts_local": true,
24
+ "voice": "female_01.wav"
25
+ }
alltalk_tts/diagnostics.py ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ try:
2
+ import platform
3
+ import subprocess
4
+ import logging
5
+ from importlib_metadata import distributions
6
+ import torch
7
+ import os # Import the os module
8
+ import re
9
+ import sys
10
+ import glob
11
+ import site
12
+ import textwrap
13
+ import torch
14
+ import packaging.version
15
+ import packaging.specifiers
16
+ from packaging.specifiers import SpecifierSet
17
+ from packaging.specifiers import SpecifierSet
18
+ from packaging.version import parse as parse_version
19
+ from pathlib import Path
20
+ except ImportError as e:
21
+ print(f"\033[91mError importing module: {e}\033[0m\n")
22
+ print("\033[94mPlease ensure you started the Text-generation-webUI Python environment with either\033[0m")
23
+ 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")
24
+ print("\033[94mfrom the text-generation-webui directory, and then try running the diagnostics again.\033[0m")
25
+ exit(1)
26
+
27
+ this_dir = Path(__file__).parent
28
+
29
+ try:
30
+ import psutil
31
+ except ImportError:
32
+ print("psutil not found. Installing...")
33
+ subprocess.run(['pip', 'install', 'psutil'])
34
+ import psutil
35
+
36
+ def get_requirements_file():
37
+ this_dir = Path(__file__).parent # Assuming 'this_dir' is defined as the script's directory
38
+ requirements_dir = this_dir / 'system' / 'requirements'
39
+ requirements_files = list(requirements_dir.glob('requirements*.txt')) # Using pathlib for globbing
40
+
41
+ if not requirements_files:
42
+ print("\033[91mNo requirements files found.\033[0m")
43
+ return None
44
+
45
+ print("\033[94m\nSelect a requirements file to check against (or press Enter for default 'requirements.txt'):\033[0m\n")
46
+ for i, file_path in enumerate(requirements_files, start=1):
47
+ print(f" {i}. {file_path.name}") # Only print the filename
48
+
49
+ choice = input("\nEnter the number of your choice: ")
50
+ try:
51
+ choice = int(choice) - 1
52
+ return str(requirements_files[choice]) # Return the full path as a string
53
+ except (ValueError, IndexError):
54
+ return str(requirements_dir / "requirements.txt") # Return the default path as a string
55
+
56
+ # Set up logging with filemode='w'
57
+ logging.basicConfig(filename='diagnostics.log',
58
+ filemode='w',
59
+ level=logging.INFO,
60
+ format='%(message)s') # Custom format
61
+
62
+ # Function to get GPU information using subprocess
63
+ def get_gpu_info():
64
+ try:
65
+ result = subprocess.run(['nvidia-smi'], stdout=subprocess.PIPE, text=True)
66
+ return result.stdout
67
+ except FileNotFoundError:
68
+ return "NVIDIA GPU information not available"
69
+
70
+ def get_cpu_info():
71
+ cpu_info = {
72
+ 'physical_cores': psutil.cpu_count(logical=False),
73
+ 'total_cores': psutil.cpu_count(logical=True),
74
+ 'max_frequency': psutil.cpu_freq().max
75
+ }
76
+ return cpu_info
77
+
78
+ def get_disk_info():
79
+ disk_info = []
80
+ partitions = psutil.disk_partitions()
81
+ for p in partitions:
82
+ usage = psutil.disk_usage(p.mountpoint)
83
+ disk_info.append(f" Drive: {p.device} | Total: {usage.total / (1024 ** 3):.2f} GB | Used: {usage.used / (1024 ** 3):.2f} GB | Free: {usage.free / (1024 ** 3):.2f} GB | Type: {p.fstype}")
84
+ return disk_info
85
+
86
+ # Function to check if a port is in use
87
+ def is_port_in_use(port):
88
+ for conn in psutil.net_connections():
89
+ if conn.laddr.port == port:
90
+ return True
91
+ return False
92
+
93
+ def satisfies_wildcard(installed_version, required_version):
94
+ if '*' in required_version:
95
+ required_parts = required_version.split('.')
96
+ installed_parts = installed_version.split('.')
97
+ for req, inst in zip(required_parts, installed_parts):
98
+ if req != '*' and req != inst:
99
+ return False
100
+ return True
101
+ return False
102
+
103
+ def test_cuda():
104
+ cuda_available = torch.cuda.is_available()
105
+ if cuda_available:
106
+ try:
107
+ # Attempt to create a tensor on GPU
108
+ torch.tensor([1.0, 2.0]).cuda()
109
+ return "Success - CUDA is available and working."
110
+ except Exception as e:
111
+ return f"Fail - CUDA is available but not working. Error: {e}"
112
+ else:
113
+ return "Fail - CUDA is not available."
114
+
115
+ def find_files_in_path_with_wildcard(pattern):
116
+ # Get the site-packages directory of the current Python environment
117
+ site_packages_path = site.getsitepackages()
118
+ found_paths = []
119
+ # Adjust the sub-directory based on the operating system
120
+ sub_directory = "nvidia/cublas"
121
+ if platform.system() == "Linux":
122
+ sub_directory = os.path.join(sub_directory, "lib")
123
+ else:
124
+ sub_directory = os.path.join(sub_directory, "bin")
125
+ # Iterate over each site-packages directory (there can be more than one)
126
+ for directory in site_packages_path:
127
+ # Construct the search directory path
128
+ search_directory = os.path.join(directory, sub_directory)
129
+ # Use glob to find all files matching the pattern in this directory
130
+ for file_path in glob.glob(os.path.join(search_directory, pattern)):
131
+ if os.path.isfile(file_path): # Ensure it's a file
132
+ found_paths.append(file_path)
133
+ return found_paths
134
+
135
+ # Function to log and print system information
136
+ def log_system_info():
137
+ # System information
138
+ os_version = platform.system() + " " + platform.version()
139
+
140
+ # Get CUDA_HOME environment variable
141
+ cuda_home = os.environ.get('CUDA_HOME', 'N/A')
142
+
143
+ gpu_info = get_gpu_info()
144
+
145
+ # Python environment information
146
+ python_version = platform.python_version()
147
+
148
+ # Torch version
149
+ torch_version = torch.__version__
150
+ cuda_test_result = test_cuda()
151
+ cpu_info = get_cpu_info()
152
+ disk_info = get_disk_info()
153
+
154
+ # System RAM using psutil
155
+ try:
156
+ virtual_memory = psutil.virtual_memory()
157
+ total_ram = f"{virtual_memory.total / (1024 ** 3):.2f} GB"
158
+ available_ram = f"{virtual_memory.available / (1024 ** 3):.2f} GB"
159
+ system_ram = f"{available_ram} available out of {total_ram} total"
160
+ except NameError:
161
+ print("psutil is not installed. Unable to check system RAM.")
162
+ system_ram = "N/A"
163
+
164
+ # Port check (if psutil is available)
165
+ port_status = "N/A"
166
+ if 'psutil' in globals():
167
+ port_to_check = 7851
168
+ if is_port_in_use(port_to_check):
169
+ port_status = f"Port {port_to_check} is in use."
170
+ else:
171
+ port_status = f"Port {port_to_check} is available."
172
+
173
+ # Package versions using importlib_metadata
174
+ package_versions = {d.metadata['Name']: d.version for d in distributions()}
175
+
176
+ # Python environment information
177
+ python_executable = sys.executable
178
+ python_version_info = sys.version_info
179
+ python_virtual_env = os.environ.get('VIRTUAL_ENV', 'N/A')
180
+
181
+ # Conda environment information
182
+ conda_env = os.environ.get('CONDA_DEFAULT_ENV', 'N/A')
183
+
184
+ # Get Path environment information
185
+ search_path = sys.path
186
+ path_env = os.environ.get('PATH', 'N/A')
187
+
188
+ # Check for cublas
189
+ file_name = 'cublas64_11.*' if platform.system() == "Windows" else 'libcublas.so.11*'
190
+ found_paths = find_files_in_path_with_wildcard(file_name)
191
+
192
+ # Compare with requirements file
193
+ requirements_file = get_requirements_file()
194
+ if requirements_file:
195
+ required_packages = {}
196
+ installed_packages = {}
197
+
198
+ try:
199
+ with open(requirements_file, 'r') as req_file:
200
+ requirements = [line.strip() for line in req_file]
201
+ for req in requirements:
202
+ # Use regular expression to parse package name and version
203
+ match = re.match(r'([^\s>=]+)\s*([>=<]+)\s*([^,]+)', req)
204
+ if match:
205
+ package_name, operator, version_spec = match.groups()
206
+ installed_version = package_versions.get(package_name, 'Not installed')
207
+ if installed_version != 'Not installed':
208
+ required_packages[package_name] = (operator, version_spec)
209
+ installed_packages[package_name] = installed_version
210
+ except FileNotFoundError:
211
+ print(f"\n{requirements_file} not found. Skipping version checks.")
212
+ logging.info(f"NOTE {requirements_file} not found. Skipping version checks.")
213
+
214
+ # Log and print information
215
+ logging.info(f"OPERATING SYSTEM:")
216
+ logging.info(f" OS Version: {os_version}")
217
+ logging.info(f" Note: Windows 11 will list as build is 10.x.22xxx")
218
+ logging.info(f"\nHARDWARE ENVIRONMENT:")
219
+ logging.info(f" CPU: Physical Cores: {cpu_info['physical_cores']}, Total Cores: {cpu_info['total_cores']}, Max Frequency: {cpu_info['max_frequency']} MHz")
220
+ logging.info(f" System RAM: {system_ram}")
221
+ logging.info(f"\nGPU INFORMATION:{gpu_info}")
222
+ logging.info("DISK INFORMATION:")
223
+ for disk in disk_info:
224
+ logging.info(disk)
225
+ logging.info("\nNETWORK PORT:")
226
+ logging.info(f" Port Status: {port_status}")
227
+ logging.info("\nCUDA:")
228
+ logging.info(f" CUDA Working: {cuda_test_result}")
229
+ logging.info(f" CUDA_HOME: {cuda_home}")
230
+ if found_paths:
231
+ logging.info(f" Cublas64_11 Path: {', '.join(found_paths)}")
232
+ else:
233
+ logging.info(f" Cublas64_11 Path: Not found in any search path directories.")
234
+ logging.info("\nPYTHON & PYTORCH:")
235
+ logging.info(f" Torch Version: {torch_version}")
236
+ logging.info(f" Python Version: {platform.python_version()}")
237
+ logging.info(f" Python Version Info: {python_version_info}")
238
+ logging.info(f" Python Executable: {python_executable}")
239
+ logging.info(f" Python Virtual Environment: {python_virtual_env} (Should be N/A when in Text-generation-webui Conda Python environment)")
240
+ logging.info(f" Conda Environment: {conda_env}")
241
+ logging.info("\nPython Search Path:")
242
+ for path in search_path:
243
+ logging.info(f" {path}")
244
+ logging.info("\nOS SEARCHPATH ENVIRONMENT:")
245
+ for path in path_env.split(';'):
246
+ logging.info(f" {path}")
247
+ if required_packages: # Check if the dictionary is not empty
248
+ logging.info("\nPACKAGE VERSIONS vs REQUIREMENTS FILE:")
249
+ max_package_length = max(len(package) for package in required_packages.keys())
250
+ for package_name, (operator, required_version) in required_packages.items():
251
+ installed_version = installed_packages.get(package_name, 'Not installed')
252
+ logging.info(f" {package_name.ljust(max_package_length)} Required: {operator} {required_version.ljust(12)} Installed: {installed_version}")
253
+ logging.info("\nPYTHON PACKAGES:")
254
+ for package, version in package_versions.items():
255
+ logging.info(f" {package}>= {version}")
256
+
257
+ # Print to screen
258
+ print(f"\n\033[94mOS Version:\033[0m \033[92m{os_version}\033[0m")
259
+ print(f"\033[94mOS Ver note:\033[0m \033[92m(Windows 11 will say build is 10.x.22xxx)\033[0m")
260
+ print(f"\033[94mSystem RAM:\033[0m \033[92m{system_ram}\033[0m")
261
+ for disk in disk_info:
262
+ print(f"\033[94mDisk:\033[0m \033[92m{disk}\033[0m")
263
+ print(f"\033[94m\nGPU Information:\033[0m {gpu_info}")
264
+ print(f"\033[94mPort Status:\033[0m \033[92m{port_status}\033[0m\n")
265
+ if "Fail" in cuda_test_result:
266
+ print(f"\033[91mCUDA Working:\033[0m \033[91m{cuda_test_result}\033[0m")
267
+ else:
268
+ print(f"\033[94mCUDA Working:\033[0m \033[92m{cuda_test_result}\033[0m")
269
+ print(f"\033[94mCUDA_HOME:\033[0m \033[92m{cuda_home}\033[0m")
270
+ if found_paths:
271
+ print(f"\033[94mCublas64_11 Path:\033[0m \033[92m{', '.join(found_paths)}\033[0m")
272
+ else:
273
+ print(f"\033[94mCublas64_11 Path:\033[0m \033[91mNot found in any search path directories.\033[0m")
274
+ print(f"\033[94m\nTorch Version:\033[0m \033[92m{torch_version}\033[0m")
275
+ print(f"\033[94mPython Version:\033[0m \033[92m{platform.python_version()}\033[0m")
276
+ print(f"\033[94mPython Executable:\033[0m \033[92m{python_executable}\033[0m")
277
+ print(f"\033[94mConda Environment:\033[0m \033[92m{conda_env}\033[0m")
278
+ print(f"\n\033[94mPython Search Path:\033[0m")
279
+ for path in search_path:
280
+ print(f" {path}")
281
+ if required_packages: # Check if the dictionary is not empty
282
+ print("\033[94m\nRequirements file package comparison:\033[0m")
283
+ max_package_length = max(len(package) for package in required_packages.keys())
284
+
285
+ for package_name, (operator, required_version) in required_packages.items():
286
+ installed_version = installed_packages.get(package_name, 'Not installed')
287
+
288
+ # Exclude build information (e.g., +cu118) before creating the SpecifierSet
289
+ required_version_no_build = required_version.split("+")[0]
290
+
291
+ if '*' in required_version:
292
+ condition_met = satisfies_wildcard(installed_version, required_version)
293
+ else:
294
+ # Compare versions using packaging.version
295
+ required_specifier = SpecifierSet(f"{operator}{required_version_no_build}")
296
+ installed_version = parse_version(installed_version)
297
+ condition_met = installed_version in required_specifier
298
+
299
+ color_required = "\033[92m" if condition_met else "\033[91m"
300
+ color_installed = "\033[92m" if condition_met else "\033[91m"
301
+
302
+ # Print colored output
303
+ 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")
304
+
305
+ print("\nOn Nvidia Graphics cards machines, if your \033[92mInstalled\033[0m version of \033[92mTorch\033[0m and \033[92mTorchaudio\033[0m does")
306
+ print("not have \033[92m+cu118\033[0m (Cuda 11.8) or \033[92m+cu121\033[0m (Cuda 12.1) listed after them, you do not have CUDA")
307
+ print("installed for Torch or Torchaudio in this Python environment. This will cause you problems")
308
+ print("with \033[94mAllTalk\033[0m and \033[94mFinetuning.\033[0m You may have to 'pip install' a new version of torch and")
309
+ print("torchaudio, using '\033[94m--upgrade --force-reinstall\033[0m' with the correct version of PyTorch for\033[0m")
310
+ print("your Python environment.\033[0m")
311
+ print("\033[94m\nRequirements file specifier meanings:\033[0m")
312
+ explanation = textwrap.dedent("""
313
+ == Exact version != Any version except < Less than
314
+ <= Less than or equal to > Greater than >= Greater than or equal to
315
+ ~ Compatible release ; Environment marker AND Logical AND
316
+ OR Logical OR
317
+ """)
318
+ print(explanation.strip())
319
+ print("")
320
+ print(f"\033[94mDiagnostic log created:\033[0m \033[92mdiagnostics.log. \033[94mA brief summary of results is displayed above on\033[0m")
321
+ print(f"\033[94mscreen. Please see the log file for more detail.\033[0m")
322
+ print(f"\033[94m\nPlease upload the log file with any support ticket.\033[0m")
323
+
324
+ if __name__ == "__main__":
325
+ log_system_info()
alltalk_tts/docker-compose-cuda.yml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+ services:
3
+ alltalk-tts:
4
+ image: erew123/alltalk_tts:cuda
5
+ restart: unless-stopped
6
+ ports:
7
+ - "7851:7851"
8
+ volumes:
9
+ - ./outputs:/app/outputs/
10
+ - ./models:/app/models/
11
+ - ./voices:/app/voices/
12
+ - ./finetune/put-voice-samples-in-here:/app/finetune/put-voice-samples-in-here
13
+ - ./dockerconfig.json:/app/confignew.json
14
+ deploy:
15
+ resources:
16
+ reservations:
17
+ devices:
18
+ - driver: nvidia
19
+ count: all
20
+ capabilities: [ gpu ]
alltalk_tts/docker-compose.yml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+ services:
3
+ alltalk-tts:
4
+ image: ${IMAGE:-alltalk:v1-9c}
5
+ restart: unless-stopped
6
+ ports:
7
+ - "7851:7851"
8
+ - "7852:7852"
9
+ volumes:
10
+ - ./outputs:/app/outputs/
11
+ - ./models:/app/models/
12
+ - ./voices:/app/voices/
13
+ - ./finetune/put-voice-samples-in-here:/app/finetune/put-voice-samples-in-here
14
+ - ./dockerconfig.json:/app/confignew.json
15
+ healthcheck:
16
+ test: ["CMD", "wget", "-qO-", "http://localhost:7851/api/ready"]
17
+ interval: 1m30s
18
+ timeout: 30s
19
+ retries: 5
20
+ start_period: 30s
21
+ deploy:
22
+ resources:
23
+ reservations:
24
+ devices:
25
+ - driver: nvidia
26
+ count: all
27
+ capabilities: [ gpu ]
alltalk_tts/dockerconfig.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activate": true,
3
+ "autoplay": true,
4
+ "branding": "AllTalk ",
5
+ "narrator_enabled": false,
6
+ "deepspeed_activate": true,
7
+ "delete_output_wavs": "Disabled",
8
+ "ip_address": "127.0.0.1",
9
+ "language": "English",
10
+ "low_vram": false,
11
+ "local_temperature": "0.7",
12
+ "local_repetition_penalty": "10.0",
13
+ "tts_model_loaded": true,
14
+ "tts_model_name": "tts_models/multilingual/multi-dataset/xtts_v2",
15
+ "narrator_voice": "female_01.wav",
16
+ "output_folder_wav": "extensions/alltalk_tts/outputs/",
17
+ "output_folder_wav_standalone": "outputs/",
18
+ "port_number": "7851",
19
+ "remove_trailing_dots": false,
20
+ "show_text": true,
21
+ "tts_method_api_local": false,
22
+ "tts_method_api_tts": false,
23
+ "tts_method_xtts_local": true,
24
+ "voice": "female_01.wav"
25
+ }
alltalk_tts/finetune.py ADDED
The diff for this file is too large to render. See raw diff
 
alltalk_tts/finetune/put-voice-samples-in-here/put your voice samples in here.txt ADDED
File without changes
alltalk_tts/launch.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ python modeldownload.py
3
+ uvicorn tts_server:app --host 0.0.0.0 --port 7851 --workers 1 --proxy-headers &
4
+ sleep 5
5
+ python script.py
alltalk_tts/modeldownload.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "base_path": "models",
3
+ "model_path": "xttsv2_2.0.2",
4
+ "files_to_download": {
5
+ "LICENSE.txt": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/LICENSE.txt?download=true",
6
+ "README.md": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/README.md?download=true",
7
+ "config.json": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/config.json?download=true",
8
+ "model.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/model.pth?download=true",
9
+ "dvae.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/dvae.pth?download=true",
10
+ "mel_stats.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/mel_stats.pth?download=true",
11
+ "speakers_xtts.pth": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/speakers_xtts.pth?download=true",
12
+ "vocab.json": "https://huggingface.co/coqui/XTTS-v2/resolve/v2.0.2/vocab.json?download=true"
13
+ }
14
+ }
alltalk_tts/modeldownload.py ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+ from pathlib import Path
4
+ import requests
5
+ from requests.exceptions import ConnectionError
6
+ from tqdm import tqdm
7
+ import importlib.metadata as metadata
8
+ import json
9
+ from packaging import version
10
+ from datetime import datetime
11
+
12
+ #################################################################
13
+ #### LOAD PARAMS FROM confignew.json - REQUIRED FOR BRANDING ####
14
+ #################################################################
15
+ # STARTUP VARIABLE - Create "this_dir" variable as the current script directory
16
+ this_dir = Path(__file__).parent.resolve()
17
+
18
+ # load standard config file in and get settings
19
+ def load_config(file_path):
20
+ with open(file_path, "r") as config_file:
21
+ config = json.load(config_file)
22
+ return config
23
+
24
+ config_file_path = this_dir / "confignew.json"
25
+ params = load_config(config_file_path)
26
+
27
+ # Define the path to the modeldownload config file file
28
+ modeldownload_config_file_path = this_dir / "modeldownload.json"
29
+
30
+ # Check if the JSON file exists
31
+ if modeldownload_config_file_path.exists():
32
+ with open(modeldownload_config_file_path, "r") as config_file:
33
+ settings = json.load(config_file)
34
+
35
+ # Extract settings from the loaded JSON
36
+ base_path = Path(settings.get("base_path", ""))
37
+ model_path = Path(settings.get("model_path", ""))
38
+ files_to_download = settings.get("files_to_download", {})
39
+ else:
40
+ # Default settings if the JSON file doesn't exist or is empty
41
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m modeldownload.json is missing so please re-download it and save it in the coquii_tts main folder.")
42
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m API Local and XTTSv2 Local will error unless this is corrected.")
43
+
44
+ # Read the version specifier from requirements_nvidia.txt
45
+ with open(this_dir / "system" / "requirements" / "requirements_standalone.txt", "r") as req_file:
46
+ requirements = req_file.readlines()
47
+
48
+ tts_version_required = None
49
+ for req in requirements:
50
+ if req.startswith("TTS=="):
51
+ tts_version_required = req.strip().split("==")[1]
52
+ break
53
+
54
+ if tts_version_required is None:
55
+ raise ValueError(f"[{params['branding']}Startup] \033[91mWarning\033[0m Could not find TTS version specifier in requirements file")
56
+
57
+ def create_directory_if_not_exists(directory):
58
+ if not directory.exists():
59
+ directory.mkdir(parents=True)
60
+
61
+ def download_file(url, destination):
62
+ response = requests.get(url, stream=True)
63
+ total_size_in_bytes = int(response.headers.get("content-length", 0))
64
+ block_size = 1024 # 1 Kibibyte
65
+
66
+ progress_bar = tqdm(total=total_size_in_bytes, unit="iB", unit_scale=True)
67
+
68
+ with open(destination, "wb") as file:
69
+ for data in response.iter_content(block_size):
70
+ progress_bar.update(len(data))
71
+ file.write(data)
72
+
73
+ progress_bar.close()
74
+
75
+
76
+ def check_tts_version():
77
+ try:
78
+ tts_version = metadata.version("tts")
79
+ print(f"[{params['branding']}Startup] \033[92mCurrent TTS Version : \033[93m"+tts_version+"\033[0m")
80
+
81
+ if version.parse(tts_version) < version.parse(tts_version_required):
82
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS version is too old. Please upgrade to version \033[93m"+tts_version_required+"\033[0m or later.\033[0m")
83
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m At your terminal/command prompt \033[94mpip install --upgrade tts\033[0m")
84
+ else:
85
+ print(f"[{params['branding']}Startup] \033[92mCurrent TTS Version is :\033[93m Up to date\033[0m")
86
+ except metadata.PackageNotFoundError:
87
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS is not installed")
88
+
89
+ def check_torch_version():
90
+ import torch
91
+ pytorch_version = torch.__version__
92
+ cuda_version = torch.version.cuda
93
+ major, minor, micro = sys.version_info[:3]
94
+ python_version = f"{major}.{minor}.{micro}"
95
+ print(f"[{params['branding']}Startup] \033[92mCurrent Python Version :\033[93m {python_version}\033[0m")
96
+ print(f"[{params['branding']}Startup] \033[92mCurrent PyTorch Version:\033[93m {pytorch_version}\033[0m")
97
+ if cuda_version is None:
98
+ print(f"[{params['branding']}Startup] \033[92mCurrent CUDA Version :\033[91m CUDA is not available\033[0m")
99
+ else:
100
+ print(f"[{params['branding']}Startup] \033[92mCurrent CUDA Version :\033[93m {cuda_version}\033[0m")
101
+
102
+ def ordinal(n):
103
+ return "%d%s" % (n, "th" if 4 <= n % 100 <= 20 else {1: "st", 2: "nd", 3: "rd"}.get(n % 10, "th"))
104
+
105
+ def format_datetime(iso_str):
106
+ # Parse the ISO 8601 string to datetime
107
+ dt = datetime.strptime(iso_str, "%Y-%m-%dT%H:%M:%SZ")
108
+ # Format the datetime into a more readable string
109
+ return dt.strftime(f"{ordinal(dt.day)} %B %Y at %H:%M")
110
+
111
+ def fetch_latest_commit_sha_and_date(owner, repo):
112
+ url = f"https://api.github.com/repos/{owner}/{repo}/commits"
113
+ try:
114
+ response = requests.get(url)
115
+ if response.status_code == 200:
116
+ latest_commit = response.json()[0]
117
+ latest_commit_sha = latest_commit['sha']
118
+ latest_commit_date = latest_commit['commit']['committer']['date']
119
+ return latest_commit_sha, latest_commit_date
120
+ else:
121
+ print(f"[{params['branding']}Startup] \033[92m{params['branding']}Github updated :\033[91m Failed to fetch the latest commits due to an unexpected response from GitHub")
122
+ return None, None
123
+ except ConnectionError:
124
+ # This block is executed when a connection error occurs
125
+ print(f"[{params['branding']}Startup] \033[92m{params['branding']}Github updated :\033[91m Could not reach GitHub to check for updates\033[0m")
126
+ return None, None
127
+
128
+ def read_or_initialize_sha(file_path):
129
+ if os.path.exists(file_path):
130
+ with open(file_path, 'r') as file:
131
+ data = json.load(file)
132
+ return data.get("last_known_commit_sha")
133
+ else:
134
+ # File doesn't exist, fetch the latest SHA and create the file
135
+ latest_commit_sha = fetch_latest_commit_sha_and_date(github_site, github_repository)
136
+ if latest_commit_sha:
137
+ with open(file_path, 'w') as file:
138
+ json.dump({"last_known_commit_sha": latest_commit_sha}, file)
139
+ return latest_commit_sha
140
+ else:
141
+ # Handle the case where GitHub couldn't be reached
142
+ return None
143
+
144
+ def update_sha_file(file_path, new_sha):
145
+ with open(file_path, 'w') as file:
146
+ json.dump({"last_known_commit_sha": new_sha}, file)
147
+
148
+ # Check and create directories
149
+ if str(base_path) == "models":
150
+ create_directory_if_not_exists(this_dir / base_path / model_path)
151
+ else:
152
+ create_directory_if_not_exists(base_path / model_path)
153
+ print(f"[{params['branding']}Startup] \033[94mInfo\033[0m Custom path set in \033[93mmodeldownload.json\033[0m. Using the following settings:")
154
+ print(f"[{params['branding']}Startup] \033[94mInfo\033[0m Base folder Path:\033[93m",base_path,"\033[0m",)
155
+ print(f"[{params['branding']}Startup] \033[94mInfo\033[0m Model folder Path:\033[93m",model_path,"\033[0m",)
156
+ print(f"[{params['branding']}Startup] \033[94mInfo\033[0m Full Path:\033[93m",base_path / model_path,"\033[0m",)
157
+
158
+ # Download files if they don't exist
159
+ print(f"[{params['branding']}Startup] \033[92mModel is available :\033[93m Checking\033[0m")
160
+ for filename, url in files_to_download.items():
161
+ if str(base_path) == "models":
162
+ destination = this_dir / base_path / model_path / filename
163
+ else:
164
+ destination = Path(base_path) / model_path / filename
165
+ if not destination.exists():
166
+ print(f"[{params['branding']}Startup] \033[92mModel Downloading file : \033[93m" + filename + "\033[0m")
167
+ download_file(url, destination)
168
+ print(f"[{params['branding']}Startup] \033[92mModel is available :\033[93m Checked\033[0m")
169
+
170
+ github_site = "erew123"
171
+ github_repository = "alltalk_tts"
172
+
173
+ check_torch_version()
174
+ check_tts_version()
175
+ # Define the file path based on your directory structure
176
+ sha_file_path = this_dir / "system" / "config" / "at_github_sha.json"
177
+
178
+ # Read or initialize the SHA (adjusted for handling both SHA and date)
179
+ last_known_commit_sha = read_or_initialize_sha(sha_file_path) # Assuming adjustment for date
180
+
181
+ # Assuming you have fetched the latest commit SHA and date
182
+ latest_commit_sha, latest_commit_date = fetch_latest_commit_sha_and_date(github_site, github_repository)
183
+
184
+ formatted_date = format_datetime(latest_commit_date) if latest_commit_date else "an unknown date"
185
+
186
+ if latest_commit_sha and latest_commit_sha != last_known_commit_sha:
187
+ #print(f"There's an update available for alltalk_tts.")
188
+ print(f"[{params['branding']}Startup] \033[92m{params['branding']}Github updated :\033[93m {formatted_date}\033[0m")
189
+ # Update the file with the new SHA
190
+ update_sha_file(sha_file_path, latest_commit_sha)
191
+ elif latest_commit_sha == last_known_commit_sha:
192
+ #print(f"Your alltalk_tts software is up to date.")
193
+ print(f"[{params['branding']}Startup] \033[92m{params['branding']}Github updated :\033[93m {formatted_date}\033[0m")
alltalk_tts/nvidia.Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
2
+ ENV HOST 0.0.0.0
3
+ RUN apt-get update && apt-get upgrade -y \
4
+ && apt-get install -y git build-essential portaudio19-dev \
5
+ python3 python3-pip gcc wget \
6
+ ocl-icd-opencl-dev opencl-headers clinfo \
7
+ libclblast-dev libopenblas-dev \
8
+ && mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd \
9
+ && ln -s /usr/bin/python3 /usr/bin/python
10
+
11
+ RUN mkdir /app/pip_cache
12
+ ENV PIP_CACHE_DIR=/app/pip_cache
13
+
14
+ WORKDIR /app
15
+ COPY . .
16
+ ENV CUDA_DOCKER_ARCH=all
17
+ RUN pip install --no-cache-dir --no-deps -r system/requirements/requirements_standalone.txt --cache-dir=/app/pip_cache && \
18
+ pip install --no-cache-dir deepspeed --cache-dir=/app/pip_cache
19
+
20
+ EXPOSE 7851
21
+ RUN chmod +x launch.sh
22
+ ENTRYPOINT ["sh", "-c", "./launch.sh"]
alltalk_tts/script.py ADDED
@@ -0,0 +1,1086 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import html
2
+ import json
3
+ import random
4
+ import subprocess
5
+ import time
6
+ import os
7
+ import requests
8
+ import threading
9
+ import signal
10
+ import sys
11
+ import atexit
12
+ import shutil
13
+ from pathlib import Path
14
+ from datetime import datetime, timedelta
15
+ import re
16
+ import numpy as np
17
+ import soundfile as sf
18
+ import uuid
19
+ import logging
20
+ # Store the current disable level
21
+ current_disable_level = logging.getLogger().manager.disable
22
+
23
+ ######################################
24
+ #### ALLTALK ALLOWED STARTUP TIME ####
25
+ ######################################
26
+ startup_wait_time = 120
27
+
28
+ # You can change the above setting to a larger number to allow AllTAlk more time to start up. The default setting is 120 seconds (2 minutes).
29
+ # On some older systems you may need to allow AllTalk more time. So you could set it to 240 (4 minutes) which will give AllTalk more to load.
30
+
31
+ #################################################################
32
+ #### LOAD PARAMS FROM confignew.json - REQUIRED FOR BRANDING ####
33
+ #################################################################
34
+ # STARTUP VARIABLE - Create "this_dir" variable as the current script directory
35
+ this_dir = Path(__file__).parent.resolve()
36
+
37
+ # load config file in and get settings
38
+ def load_config(file_path):
39
+ with open(file_path, "r") as config_file:
40
+ config = json.load(config_file)
41
+ return config
42
+
43
+ config_file_path = this_dir / "confignew.json"
44
+ # Load the params dictionary from the confignew.json file
45
+ params = load_config(config_file_path)
46
+
47
+ print(f"[{params['branding']}Startup]\033[94m _ _ _ \033[1;35m_____ _ _ \033[0m _____ _____ ____ ")
48
+ print(f"[{params['branding']}Startup]\033[94m / \ | | |\033[1;35m_ _|_ _| | | __ \033[0m |_ _|_ _/ ___| ")
49
+ print(f"[{params['branding']}Startup]\033[94m / _ \ | | |\033[1;35m | |/ _` | | |/ / \033[0m | | | | \___ \ ")
50
+ print(f"[{params['branding']}Startup]\033[94m / ___ \| | |\033[1;35m | | (_| | | < \033[0m | | | | ___) |")
51
+ print(f"[{params['branding']}Startup]\033[94m /_/ \_\_|_|\033[1;35m |_|\__,_|_|_|\_\ \033[0m |_| |_| |____/ ")
52
+ print(f"[{params['branding']}Startup]")
53
+
54
+ ##############################################
55
+ #### Update any changes to confignew.json ####
56
+ ##############################################
57
+
58
+ update_config_path = this_dir / "system" / "config" / "at_configupdate.json"
59
+ downgrade_config_path = this_dir / "system" / "config" / "at_configdowngrade.json"
60
+
61
+ def changes_needed(main_config, update_config, downgrade_config):
62
+ """Check if there are any changes to be made to the main configuration."""
63
+ for key in downgrade_config.keys():
64
+ if key in main_config:
65
+ return True
66
+ for key, value in update_config.items():
67
+ if key not in main_config:
68
+ return True
69
+ return False
70
+
71
+ def update_config(config_file_path, update_config_path, downgrade_config_path):
72
+ try:
73
+ with open(config_file_path, 'r') as file:
74
+ main_config = json.load(file)
75
+ with open(update_config_path, 'r') as file:
76
+ update_config = json.load(file)
77
+ with open(downgrade_config_path, 'r') as file:
78
+ downgrade_config = json.load(file)
79
+
80
+ # Determine if changes are needed
81
+ if changes_needed(main_config, update_config, downgrade_config):
82
+ # Backup with timestamp to avoid overwriting
83
+ timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
84
+ backup_path = config_file_path.with_suffix(f".{timestamp}.bak")
85
+ logging.info(f"Creating backup of the main config to {backup_path}")
86
+ shutil.copy(config_file_path, backup_path)
87
+
88
+ # Proceed with updates and downgrades
89
+ for key, value in update_config.items():
90
+ if key not in main_config:
91
+ main_config[key] = value
92
+ for key in downgrade_config.keys():
93
+ if key in main_config:
94
+ del main_config[key]
95
+
96
+ # Save the updated configuration
97
+ with open(config_file_path, 'w') as file:
98
+ json.dump(main_config, file, indent=4)
99
+
100
+ print(f"[{params['branding']}Startup] \033[92mConfig file check : \033[91mUpdates applied\033[0m")
101
+ else:
102
+ print(f"[{params['branding']}Startup] \033[92mConfig file check : \033[93mNo Updates required\033[0m")
103
+
104
+ except Exception as e:
105
+ print(f"[{params['branding']}Startup] \033[92mConfig file check : \033[91mError updating\033[0m")
106
+
107
+ # Update the configuration
108
+ update_config(config_file_path, update_config_path, downgrade_config_path)
109
+ # Re-Load the params dictionary from the confignew.json file
110
+ params = load_config(config_file_path)
111
+
112
+ #########################################
113
+ #### Continue on with Startup Checks ####
114
+ #########################################
115
+
116
+ # Required for sentence splitting
117
+ try:
118
+ from TTS.api import TTS
119
+ from TTS.utils.synthesizer import Synthesizer
120
+ except ModuleNotFoundError:
121
+ # Inform the user about the missing module and suggest next steps
122
+ print(f"[{params['branding']}]\033[91mWarning\033[0m Could not find the TTS module. Make sure to install the requirements for the {params['branding']} extension.")
123
+ print(f"[{params['branding']}]\033[91mWarning\033[0m Please use the ATSetup utility or check the Github installation instructions.")
124
+ # Re-raise the ModuleNotFoundError to stop the program and print the traceback
125
+ raise
126
+
127
+ # Suppress logging
128
+ logging.disable(logging.ERROR)
129
+ try:
130
+ import deepspeed
131
+ deepspeed_installed = True
132
+ except ImportError:
133
+ deepspeed_installed = False
134
+ # Restore previous logging level
135
+ logging.disable(current_disable_level)
136
+
137
+ # Import gradio if being used within text generation webUI
138
+ try:
139
+ import gradio as gr
140
+ from modules import chat, shared, ui_chat
141
+ from modules.logging_colors import logger
142
+ from modules.ui import create_refresh_button
143
+ from modules.utils import gradio
144
+
145
+ # 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
146
+ running_in_standalone = False
147
+ output_folder_wav = params["output_folder_wav"]
148
+ print(f"[{params['branding']}Startup] \033[92m{params['branding']}startup Mode : \033[93mText-Gen-webui mode\033[0m")
149
+ except ModuleNotFoundError:
150
+ output_folder_wav = params["output_folder_wav_standalone"]
151
+ print(f"[{params['branding']}Startup] \033[92m{params['branding']}startup Mode : \033[93mStandalone mode\033[0m")
152
+ # This is set to check if the script is being run within text generation webui or as a standalone script. true means standalone
153
+ running_in_standalone = True
154
+
155
+ ###########################
156
+ #### STARTUP VARIABLES ####
157
+ ###########################
158
+ # STARTUP VARIABLE - Import languges file for Gradio to be able to display them in the interface
159
+ with open(this_dir / "system" / "config" / "languages.json", encoding="utf8") as f:
160
+ languages = json.load(f)
161
+ # Create a global lock
162
+ process_lock = threading.Lock()
163
+ # Base setting for a possible FineTuned model existing and the loader being available
164
+ tts_method_xtts_ft = False
165
+
166
+
167
+ # Gather the voice files
168
+ def get_available_voices():
169
+ return sorted([voice.name for voice in Path(f"{this_dir}/voices").glob("*.wav")])
170
+
171
+
172
+ ############################################
173
+ #### DELETE OLD OUTPUT WAV FILES IF SET ####
174
+ ############################################
175
+ def delete_old_files(folder_path, days_to_keep):
176
+ current_time = datetime.now()
177
+ print(f"[{params['branding']}Startup] \033[92mWAV file deletion :\033[93m", delete_output_wavs_setting,"\033[0m")
178
+ for file_name in os.listdir(folder_path):
179
+ file_path = os.path.join(folder_path, file_name)
180
+ if os.path.isfile(file_path):
181
+ file_creation_time = datetime.fromtimestamp(os.path.getctime(file_path))
182
+ age = current_time - file_creation_time
183
+ if age > timedelta(days=days_to_keep):
184
+ os.remove(file_path)
185
+
186
+
187
+ # Extract settings using params dictionary
188
+ delete_output_wavs_setting = params["delete_output_wavs"]
189
+ output_folder_wav = os.path.normpath(output_folder_wav)
190
+
191
+ # Check and perform file deletion
192
+ if delete_output_wavs_setting.lower() == "disabled":
193
+ print("["+ params["branding"]+"Startup] \033[92mWAV file deletion :\033[93m Disabled\033[0m")
194
+ else:
195
+ try:
196
+ days_to_keep = int(delete_output_wavs_setting.split()[0])
197
+ delete_old_files(output_folder_wav, days_to_keep)
198
+ except ValueError:
199
+ print(f"[{params['branding']}Startup] \033[92mWAV file deletion :\033[93m Invalid setting for deleting old wav files. Please use 'Disabled' or 'X Days' format\033[0m")
200
+
201
+ if deepspeed_installed:
202
+ print(f"[{params['branding']}Startup] \033[92mDeepSpeed version :\033[93m",deepspeed.__version__,"\033[0m")
203
+ else:
204
+ print(f"[{params['branding']}Startup] \033[92mDeepSpeed version :\033[91m Not Detected\033[0m")
205
+
206
+ ########################
207
+ #### STARTUP CHECKS ####
208
+ ########################
209
+ # STARTUP Checks routine
210
+ def check_required_files():
211
+ this_dir = Path(__file__).parent.resolve()
212
+ download_script_path = this_dir / "modeldownload.py"
213
+ subprocess.run(["python", str(download_script_path)])
214
+
215
+ # STARTUP Call Check routine
216
+ check_required_files()
217
+
218
+ ##################################################
219
+ #### Check to see if a finetuned model exists ####
220
+ ##################################################
221
+ # Set the path to the directory
222
+ trained_model_directory = this_dir / "models" / "trainedmodel"
223
+ # Check if the directory "trainedmodel" exists
224
+ finetuned_model = trained_model_directory.exists()
225
+ # If the directory exists, check for the existence of the required files
226
+ # If true, this will add a extra option in the Gradio interface for loading Xttsv2 FT
227
+ if finetuned_model:
228
+ required_files = ["model.pth", "config.json", "vocab.json"]
229
+ finetuned_model = all(
230
+ (trained_model_directory / file).exists() for file in required_files
231
+ )
232
+ if finetuned_model:
233
+ print(f"[{params['branding']}Startup] \033[92mFinetuned model :\033[93m Detected\033[0m")
234
+
235
+ ####################################################
236
+ #### SET GRADIO BUTTONS BASED ON confignew.json ####
237
+ ####################################################
238
+
239
+ if params["tts_method_api_tts"] == True:
240
+ gr_modelchoice = "API TTS"
241
+ elif params["tts_method_api_local"] == True:
242
+ gr_modelchoice = "API Local"
243
+ elif params["tts_method_xtts_local"] == True:
244
+ gr_modelchoice = "XTTSv2 Local"
245
+
246
+ # Set the default for Narrated text without asterisk or quotes to be Narrator
247
+ non_quoted_text_is = True
248
+
249
+ ######################
250
+ #### GRADIO STUFF ####
251
+ ######################
252
+ def remove_tts_from_history(history):
253
+ for i, entry in enumerate(history["internal"]):
254
+ history["visible"][i] = [history["visible"][i][0], entry[1]]
255
+ return history
256
+
257
+
258
+ def toggle_text_in_history(history):
259
+ for i, entry in enumerate(history["visible"]):
260
+ visible_reply = entry[1]
261
+ if visible_reply.startswith("<audio"):
262
+ if params["show_text"]:
263
+ reply = history["internal"][i][1]
264
+ history["visible"][i] = [
265
+ history["visible"][i][0],
266
+ f"{visible_reply.split('</audio>')[0]}</audio>\n\n{reply}",
267
+ ]
268
+ else:
269
+ history["visible"][i] = [
270
+ history["visible"][i][0],
271
+ f"{visible_reply.split('</audio>')[0]}</audio>",
272
+ ]
273
+ return history
274
+
275
+
276
+ def history_modifier(history):
277
+ # Remove autoplay from the last reply
278
+ if len(history["internal"]) > 0:
279
+ history["visible"][-1] = [
280
+ history["visible"][-1][0],
281
+ history["visible"][-1][1].replace("controls autoplay>", "controls>"),
282
+ ]
283
+
284
+ return history
285
+
286
+
287
+ ######################################
288
+ #### SUBPROCESS/WEBSERVER STARTUP ####
289
+ ######################################
290
+ base_url = f"http://{params['ip_address']}:{params['port_number']}"
291
+ script_path = this_dir / "tts_server.py"
292
+
293
+
294
+ def signal_handler(sig, frame):
295
+ print(f"[{params['branding']}Shutdown] \033[94mReceived Ctrl+C, terminating subprocess\033[92m")
296
+ if process.poll() is None:
297
+ process.terminate()
298
+ process.wait() # Wait for the subprocess to finish
299
+ sys.exit(0)
300
+
301
+
302
+ # Attach the signal handler to the SIGINT signal (Ctrl+C)
303
+ signal.signal(signal.SIGINT, signal_handler)
304
+ # Check if we're running in docker
305
+ if os.path.isfile("/.dockerenv"):
306
+ print(
307
+ f"[{params['branding']}Startup] \033[94mRunning in Docker. Please wait.\033[0m"
308
+ )
309
+ else:
310
+ # Start the subprocess
311
+ process = subprocess.Popen(["python", script_path])
312
+ # Check if the subprocess has started successfully
313
+ if process.poll() is None:
314
+ print(f"[{params['branding']}Startup] \033[92mTTS Subprocess :\033[93m Starting up\033[0m")
315
+ print(f"[{params['branding']}Startup]")
316
+ print(
317
+ f"[{params['branding']}Startup] \033[94m{params['branding']}Settings & Documentation:\033[00m",
318
+ f"\033[92mhttp://{params['ip_address']}:{params['port_number']}\033[00m",
319
+ )
320
+ print(f"[{params['branding']}Startup]")
321
+ else:
322
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess Webserver failing to start process")
323
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m It could be that you have something on port:",params["port_number"],)
324
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m Or you have not started in a Python environement with all the necesssary bits installed")
325
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m Check you are starting Text-generation-webui with either the start_xxxxx file or the Python environment with cmd_xxxxx file.")
326
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m xxxxx is the type of OS you are on e.g. windows, linux or mac.")
327
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m Alternatively, you could check no other Python processes are running that shouldnt be e.g. Restart your computer is the simple way.")
328
+ # Cleanly kill off this script, but allow text-generation-webui to keep running, albeit without this alltalk_tts
329
+ sys.exit(1)
330
+
331
+ timeout = startup_wait_time # Gather timeout setting from startup_wait_time
332
+
333
+ # Introduce a delay before starting the check loop
334
+ time.sleep(26) # Wait 26 secs before checking if the tts_server.py has started up.
335
+ start_time = time.time()
336
+ while time.time() - start_time < timeout:
337
+ try:
338
+ response = requests.get(f"{base_url}/ready")
339
+ if response.status_code == 200:
340
+ break
341
+ except requests.RequestException as e:
342
+ # Print the exception for debugging purposes
343
+ print(f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess has NOT started up yet, Will keep trying for {timeout} seconds maximum. Please wait.")
344
+ time.sleep(5)
345
+ else:
346
+ print(f"\n[{params['branding']}Startup] Startup timed out. Full help available here \033[92mhttps://github.com/erew123/alltalk_tts#-help-with-problems\033[0m")
347
+ print(f"[{params['branding']}Startup] On older system you may wish to open and edit \033[94mscript.py\033[0m with a text editor and changing the")
348
+ print(f"[{params['branding']}Startup] \033[94mstartup_wait_time = 120\033[0m setting to something like \033[94mstartup_wait_time = 240\033[0m as this will allow")
349
+ print(f"[{params['branding']}Startup] AllTalk more time to try load the model into your VRAM. Otherise please visit the Github for")
350
+ print(f"[{params['branding']}Startup] a list of other possible troubleshooting options.")
351
+ # Cleanly kill off this script, but allow text-generation-webui to keep running, albeit without this alltalk_tts
352
+ sys.exit(1)
353
+
354
+
355
+ #####################################
356
+ #### MODEL LOADING AND UNLOADING ####
357
+ #####################################
358
+ # MODEL - Swap model based on Gradio selection API TTS, API Local, XTTSv2 Local
359
+ def send_reload_request(tts_method):
360
+ global tts_method_xtts_ft
361
+ try:
362
+ params["tts_model_loaded"] = False
363
+ url = f"{base_url}/api/reload"
364
+ payload = {"tts_method": tts_method}
365
+ response = requests.post(url, params=payload)
366
+ response.raise_for_status() # Raises an HTTPError for bad responses
367
+ json_response = response.json()
368
+ # Check if the reload operation was successful
369
+ if json_response.get("status") == "model-success":
370
+ # Update tts_tts_model_loaded to True if the reload was successful
371
+ params["tts_model_loaded"] = True
372
+ # Update local script parameters based on the tts_method
373
+ if tts_method == "API TTS":
374
+ params["tts_method_api_local"] = False
375
+ params["tts_method_xtts_local"] = False
376
+ params["tts_method_api_tts"] = True
377
+ params["deepspeed_activate"] = False
378
+ audio_path = this_dir / "system" / "at_sounds" / "apitts.wav"
379
+ tts_method_xtts_ft = False
380
+ elif tts_method == "API Local":
381
+ params["tts_method_api_tts"] = False
382
+ params["tts_method_xtts_local"] = False
383
+ params["tts_method_api_local"] = True
384
+ params["deepspeed_activate"] = False
385
+ audio_path = this_dir / "system" / "at_sounds" / "apilocal.wav"
386
+ tts_method_xtts_ft = False
387
+ elif tts_method == "XTTSv2 Local":
388
+ params["tts_method_api_tts"] = False
389
+ params["tts_method_api_local"] = False
390
+ params["tts_method_xtts_local"] = True
391
+ audio_path = this_dir / "system" / "at_sounds" / "xttslocal.wav"
392
+ tts_method_xtts_ft = False
393
+ elif tts_method == "XTTSv2 FT":
394
+ params["tts_method_api_tts"] = False
395
+ params["tts_method_api_local"] = False
396
+ params["tts_method_xtts_local"] = False
397
+ audio_path = this_dir / "system" / "at_sounds" / "xttsfinetuned.wav"
398
+ tts_method_xtts_ft = True
399
+ return f'<audio src="file/{audio_path}" controls autoplay></audio>'
400
+ except requests.exceptions.RequestException as e:
401
+ # Handle the HTTP request error
402
+ print(f"[{params['branding']}Server] \033[91mWarning\033[0m Error during request to webserver process: {e}")
403
+ return {"status": "error", "message": str(e)}
404
+
405
+
406
+ ##################
407
+ #### LOW VRAM ####
408
+ ##################
409
+ # LOW VRAM - Gradio Checkbox handling
410
+ def send_lowvram_request(low_vram):
411
+ try:
412
+ params["tts_model_loaded"] = False
413
+ if low_vram:
414
+ audio_path = this_dir / "system" / "at_sounds" / "lowvramenabled.wav"
415
+ else:
416
+ audio_path = this_dir / "system" / "at_sounds" / "lowvramdisabled.wav"
417
+ url = f"{base_url}/api/lowvramsetting?new_low_vram_value={low_vram}"
418
+ headers = {"Content-Type": "application/json"}
419
+ response = requests.post(url, headers=headers)
420
+ response.raise_for_status() # Raises an HTTPError for bad responses
421
+ json_response = response.json()
422
+ # Check if the low VRAM request was successful
423
+ if json_response.get("status") == "lowvram-success":
424
+ # Update any relevant variables or perform other actions on success
425
+ params["tts_model_loaded"] = True
426
+ return f'<audio src="file/{audio_path}" controls autoplay></audio>'
427
+ except requests.exceptions.RequestException as e:
428
+ # Handle the HTTP request error
429
+ print(f"[{params['branding']}Server] \033[91mWarning\033[0m Error during request to webserver process: {e}")
430
+ return {"status": "error", "message": str(e)}
431
+
432
+
433
+ ###################
434
+ #### DeepSpeed ####
435
+ ###################
436
+ # DEEPSPEED - Reload the model when DeepSpeed checkbox is enabled/disabled
437
+ def send_deepspeed_request(deepspeed_param):
438
+ try:
439
+ params["tts_model_loaded"] = False
440
+ if deepspeed_param:
441
+ audio_path = this_dir / "system" / "at_sounds" / "deepspeedenabled.wav"
442
+ else:
443
+ audio_path = this_dir / "system" / "at_sounds" / "deepspeeddisabled.wav"
444
+ url = f"{base_url}/api/deepspeed?new_deepspeed_value={deepspeed_param}"
445
+ headers = {"Content-Type": "application/json"}
446
+ response = requests.post(url, headers=headers)
447
+ response.raise_for_status() # Raises an HTTPError for bad responses
448
+ json_response = response.json()
449
+ # Check if the deepspeed request was successful
450
+ if json_response.get("status") == "deepspeed-success":
451
+ # Update any relevant variables or perform other actions on success
452
+ params["tts_model_loaded"] = True
453
+ return f'<audio src="file/{audio_path}" controls autoplay></audio>'
454
+ except requests.exceptions.RequestException as e:
455
+ # Handle the HTTP request error
456
+ print(f"[{params['branding']}Server] \033[91mWarning\033[0m Error during request to webserver process: {e}")
457
+ return {"status": "error", "message": str(e)}
458
+
459
+
460
+ # DEEPSPEED - Display DeepSpeed Checkbox Yes or No
461
+ deepspeed_condition = params["tts_method_xtts_local"] == "True" and deepspeed_installed
462
+
463
+
464
+ #############################################################
465
+ #### TTS STRING CLEANING & PROCESSING PRE SENDING TO TTS ####
466
+ #############################################################
467
+ def new_split_into_sentences(self, text):
468
+ sentences = self.seg.segment(text)
469
+ if params["remove_trailing_dots"]:
470
+ sentences_without_dots = []
471
+ for sentence in sentences:
472
+ if sentence.endswith(".") and not sentence.endswith("..."):
473
+ sentence = sentence[:-1]
474
+
475
+ sentences_without_dots.append(sentence)
476
+
477
+ return sentences_without_dots
478
+ else:
479
+ return sentences
480
+
481
+
482
+ Synthesizer.split_into_sentences = new_split_into_sentences
483
+
484
+
485
+ # Check model is loaded and string isnt empty, before sending a TTS request.
486
+ def before_audio_generation(string, params):
487
+ # Check Model is loaded into cuda or cpu and error if not
488
+ if not params["tts_model_loaded"]:
489
+ print(f"[{params['branding']}Model] \033[91mWarning\033[0m Model is still loading, please wait before trying to generate TTS")
490
+ return
491
+ string = html.unescape(string) or random_sentence()
492
+ if string == "":
493
+ return "*Empty string*"
494
+ return string
495
+
496
+
497
+ ##################
498
+ #### Narrator ####
499
+ ##################
500
+ def combine(audio_files, output_folder, state):
501
+ audio = np.array([])
502
+
503
+ for audio_file in audio_files:
504
+ audio_data, sample_rate = sf.read(audio_file)
505
+ # Ensure all audio files have the same sample rate
506
+ if audio.size == 0:
507
+ audio = audio_data
508
+ else:
509
+ audio = np.concatenate((audio, audio_data))
510
+
511
+ # Save the combined audio to a file with a specified sample rate
512
+ if "character_menu" in state:
513
+ output_file_path = os.path.join(output_folder, f'{state["character_menu"]}_{int(time.time())}_combined.wav')
514
+ else:
515
+ output_file_path = os.path.join(output_folder, f"TTSOUT_{int(time.time())}_combined.wav")
516
+ sf.write(output_file_path, audio, samplerate=sample_rate)
517
+ # Clean up unnecessary files
518
+ for audio_file in audio_files:
519
+ os.remove(audio_file)
520
+
521
+ return output_file_path
522
+
523
+
524
+ ################################
525
+ #### TTS PREVIEW GENERATION ####
526
+ ################################
527
+ # PREVIEW VOICE - Generate Random Sentence if Voice Preview box is empty
528
+ def random_sentence():
529
+ with open(this_dir / "system" / "config" / "harvard_sentences.txt") as f:
530
+ return random.choice(list(f))
531
+
532
+
533
+ # PREVIEW VOICE- Generate TTS Function
534
+ def voice_preview(string):
535
+ if not params["activate"]:
536
+ return string
537
+ # Clean the string, capture model not loaded, and move model to cuda if needed
538
+ cleaned_string = before_audio_generation(string, params)
539
+ if cleaned_string is None:
540
+ return
541
+ string = cleaned_string
542
+ # Setup the output file
543
+ output_file = Path(params["output_folder_wav"]) / "voice_preview.wav"
544
+ # Generate the audio
545
+ language_code = languages.get(params["language"])
546
+ temperature = params["local_temperature"]
547
+ repetition_penalty = params["local_repetition_penalty"]
548
+ # Convert the WindowsPath object to a string before using it in JSON payload
549
+ output_file_str = output_file.as_posix()
550
+ # Lock before making the generate request
551
+ with process_lock:
552
+ generate_response = send_generate_request(
553
+ string,
554
+ params["voice"],
555
+ language_code,
556
+ temperature,
557
+ repetition_penalty,
558
+ output_file_str,
559
+ )
560
+ # Check if lock is already acquired
561
+ if process_lock.locked():
562
+ print(f"[{params['branding']}Model] \033[91mWarning\033[0m Audio generation is already in progress. Please wait.")
563
+ return
564
+ if generate_response.get("status") == "generate-success":
565
+ # Handle Gradio and playback
566
+ autoplay = "autoplay" if params["autoplay"] else ""
567
+ return f'<audio src="file/{output_file_str}?{int(time.time())}" controls {autoplay}></audio>'
568
+ else:
569
+ # Handle the case where audio generation was not successful
570
+ return f"[{params['branding']}Server] Audio generation failed. Status: {generate_response.get('status')}"
571
+
572
+
573
+ #######################
574
+ #### TEXT CLEANING ####
575
+ #######################
576
+
577
+ def process_text(text):
578
+ # Normalize HTML encoded quotes
579
+ text = html.unescape(text)
580
+
581
+ # Replace ellipsis with a single dot
582
+ text = re.sub(r"\.{3,}", ".", text)
583
+
584
+ # Pattern to identify combined narrator and character speech
585
+ combined_pattern = r'(\*[^*"]+\*|"[^"*]+")'
586
+
587
+ # List to hold parts of speech along with their type
588
+ ordered_parts = []
589
+
590
+ # Track the start of the next segment
591
+ start = 0
592
+
593
+ # Find all matches
594
+ for match in re.finditer(combined_pattern, text):
595
+ # Add the text before the match, if any, as ambiguous
596
+ if start < match.start():
597
+ ambiguous_text = text[start : match.start()].strip()
598
+ if ambiguous_text:
599
+ ordered_parts.append(("ambiguous", ambiguous_text))
600
+
601
+ # Add the matched part as either narrator or character
602
+ matched_text = match.group(0)
603
+ if matched_text.startswith("*") and matched_text.endswith("*"):
604
+ ordered_parts.append(("narrator", matched_text.strip("*").strip()))
605
+ elif matched_text.startswith('"') and matched_text.endswith('"'):
606
+ ordered_parts.append(("character", matched_text.strip('"').strip()))
607
+ else:
608
+ # In case of mixed or improperly formatted parts
609
+ if "*" in matched_text:
610
+ ordered_parts.append(("narrator", matched_text.strip("*").strip('"')))
611
+ else:
612
+ ordered_parts.append(("character", matched_text.strip('"').strip("*")))
613
+
614
+ # Update the start of the next segment
615
+ start = match.end()
616
+
617
+ # Add any remaining text after the last match as ambiguous
618
+ if start < len(text):
619
+ ambiguous_text = text[start:].strip()
620
+ if ambiguous_text:
621
+ ordered_parts.append(("ambiguous", ambiguous_text))
622
+
623
+ return ordered_parts
624
+
625
+
626
+ ########################
627
+ #### IMAGE CLEANING ####
628
+ ########################
629
+
630
+ img_pattern = r'<img[^>]*src\s*=\s*["\'][^"\'>]+["\'][^>]*>'
631
+
632
+ def extract_and_remove_images(text):
633
+ """
634
+ Extracts all image data from the text and removes it for clean TTS processing.
635
+ Returns the cleaned text and the extracted image data.
636
+ """
637
+ img_matches = re.findall(img_pattern, text)
638
+ img_info = "\n".join(img_matches) # Store extracted image data
639
+ cleaned_text = re.sub(img_pattern, '', text) # Remove images from text
640
+ return cleaned_text, img_info
641
+
642
+ def reinsert_images(text, img_info):
643
+ """
644
+ Reinserts the previously extracted image data back into the text.
645
+ """
646
+ if img_info: # Check if there are images to reinsert
647
+ text += f"\n\n{img_info}"
648
+ return text
649
+
650
+ #################################
651
+ #### TTS STANDARD GENERATION ####
652
+ #################################
653
+ # STANDARD VOICE - Generate TTS Function
654
+ def output_modifier(string, state):
655
+ if not params["activate"]:
656
+ return string
657
+ img_info = ""
658
+ cleaned_text, img_info = extract_and_remove_images(string)
659
+ # print("Cleaned STRING IS:", cleaned_text)
660
+ cleaned_string = before_audio_generation(cleaned_text, params)
661
+ if cleaned_string is None:
662
+ return
663
+ language_code = languages.get(params["language"])
664
+ temperature = params["local_temperature"]
665
+ repetition_penalty = params["local_repetition_penalty"]
666
+ # Create a list to store generated audio paths
667
+ audio_files = []
668
+ if process_lock.acquire(blocking=False):
669
+ try:
670
+ if params["narrator_enabled"]:
671
+ processed_parts = process_text(cleaned_string)
672
+
673
+ audio_files_all_paragraphs = []
674
+ for part_type, part in processed_parts:
675
+ # Skip parts that are too short
676
+ if len(part.strip()) <= 3:
677
+ continue
678
+
679
+ # Determine the voice to use based on the part type
680
+ if part_type == "narrator":
681
+ voice_to_use = params["narrator_voice"]
682
+ print(f"[{params['branding']}TTSGen] \033[92mNarrator\033[0m") # Green
683
+ elif part_type == "character":
684
+ voice_to_use = params["voice"]
685
+ print(f"[{params['branding']}TTSGen] \033[36mCharacter\033[0m") # Yellow
686
+ else:
687
+ # Handle ambiguous parts based on user preference
688
+ voice_to_use = (
689
+ params["voice"]
690
+ if non_quoted_text_is
691
+ else params["narrator_voice"]
692
+ )
693
+ voice_description = (
694
+ "\033[36mCharacter (Text-not-inside)\033[0m"
695
+ if non_quoted_text_is
696
+ else "\033[92mNarrator (Text-not-inside)\033[0m"
697
+ )
698
+ print(f"[{params['branding']}TTSGen] {voice_description}")
699
+
700
+ # Replace multiple exclamation marks, question marks, or other punctuation with a single instance
701
+ cleaned_part = re.sub(r"([!?.\u3002\uFF1F\uFF01\uFF0C])\1+", r"\1", part)
702
+ # Replace "Chinese ellipsis" with a single dot
703
+ cleaned_part = re.sub(r"\u2026{1,2}", ". ", cleaned_part)
704
+ # Further clean to remove any other unwanted characters
705
+ cleaned_part = re.sub(r'[^a-zA-Z0-9\s.,;:!?\-\'"$\u0400-\u04FF\u00C0-\u00FF\u0150\u0151\u0170\u0171\u0900-\u097F\u2018\u2019\u201C\u201D\u3001\u3002\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF\uAC00-\uD7A3\u1100-\u11FF\u3130-\u318F\uFF01\uFF0c\uFF1A\uFF1B\uFF1F]', '', cleaned_part)
706
+ # Remove all newline characters (single or multiple)
707
+ cleaned_part = re.sub(r"\n+", " ", cleaned_part)
708
+
709
+ # Generate TTS and output to a file
710
+ output_filename = get_output_filename(state)
711
+ generate_response = send_generate_request(
712
+ cleaned_part,
713
+ voice_to_use,
714
+ language_code,
715
+ temperature,
716
+ repetition_penalty,
717
+ output_filename,
718
+ )
719
+ audio_path = generate_response.get("data", {}).get("audio_path")
720
+ audio_files_all_paragraphs.append(audio_path)
721
+
722
+ # Combine audio files across paragraphs
723
+ final_output_file = combine(
724
+ audio_files_all_paragraphs, params["output_folder_wav"], state
725
+ )
726
+ else:
727
+ # Decode HTML entities first
728
+ cleaned_part = html.unescape(cleaned_string)
729
+ # Replace multiple instances of certain punctuation marks with a single instance
730
+ cleaned_part = re.sub(r"([!?.\u3002\uFF1F\uFF01\uFF0C])\1+", r"\1", cleaned_part)
731
+ # Replace "Chinese ellipsis" with a single dot
732
+ cleaned_part = re.sub(r"\u2026{1,2}", ". ", cleaned_part)
733
+ # Further clean to remove any other unwanted characters
734
+ cleaned_part = re.sub(r'[^a-zA-Z0-9\s.,;:!?\-\'"$\u0400-\u04FF\u00C0-\u00FF\u0150\u0151\u0170\u0171\u0900-\u097F\u2018\u2019\u201C\u201D\u3001\u3002\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF\uAC00-\uD7A3\u1100-\u11FF\u3130-\u318F\uFF01\uFF0c\uFF1A\uFF1B\uFF1F]', '', cleaned_part)
735
+ # Remove all newline characters (single or multiple)
736
+ cleaned_part = re.sub(r"\n+", " ", cleaned_part)
737
+ # Process the part and give it a non-character name if being used vai API or standalone.
738
+ if "character_menu" in state:
739
+ output_file = Path(
740
+ f'{params["output_folder_wav"]}/{state["character_menu"]}_{int(time.time())}.wav'
741
+ )
742
+ else:
743
+ output_file = Path(
744
+ f'{params["output_folder_wav"]}/TTSOUT_{int(time.time())}.wav'
745
+ )
746
+ output_file_str = output_file.as_posix()
747
+ output_file = get_output_filename(state)
748
+ generate_response = send_generate_request(
749
+ cleaned_part,
750
+ params["voice"],
751
+ language_code,
752
+ temperature,
753
+ repetition_penalty,
754
+ output_file_str,
755
+ )
756
+ audio_path = generate_response.get("data", {}).get("audio_path")
757
+ final_output_file = audio_path
758
+ finally:
759
+ # Always release the lock, whether an exception occurs or not
760
+ process_lock.release()
761
+ else:
762
+ # The lock is already acquired
763
+ print(
764
+ f"[{params['branding']}Model] \033[91mWarning\033[0m Audio generation is already in progress. Please wait."
765
+ )
766
+ return
767
+
768
+ if generate_response.get("status") == "generate-success":
769
+ audio_path = generate_response.get("data", {}).get("audio_path")
770
+ if audio_path:
771
+ # Handle Gradio and playback
772
+ autoplay = "autoplay" if params["autoplay"] else ""
773
+ string = (f'<audio src="file/{final_output_file}" controls {autoplay}></audio>')
774
+ if params["show_text"]:
775
+ string += reinsert_images(cleaned_string, img_info)
776
+ shared.processing_message = "*Is typing...*"
777
+ return string
778
+ else:
779
+ print(f"[{params['branding']}Server] \033[91mWarning\033[0m No audio path in the response.")
780
+ else:
781
+ print(f"[{params['branding']}Server] \033[91mWarning\033[0m Audio generation failed. Status:", generate_response.get("message"),)
782
+
783
+ def get_output_filename(state):
784
+ if "character_menu" in state:
785
+ return Path(
786
+ f'{params["output_folder_wav"]}/{state["character_menu"]}_{str(uuid.uuid4())[:8]}.wav'
787
+ ).as_posix()
788
+ else:
789
+ return Path(
790
+ f'{params["output_folder_wav"]}/TTSOUT_{str(uuid.uuid4())[:8]}.wav'
791
+ ).as_posix()
792
+
793
+
794
+ ###############################################
795
+ #### SEND GENERATION REQUEST TO TTS ENGINE ####
796
+ ###############################################
797
+ def send_generate_request(
798
+ text, voice, language, temperature, repetition_penalty, output_file
799
+ ):
800
+ url = f"{base_url}/api/generate"
801
+ payload = {
802
+ "text": text,
803
+ "voice": voice,
804
+ "language": language,
805
+ "temperature": temperature,
806
+ "repetition_penalty": repetition_penalty,
807
+ "output_file": output_file,
808
+ }
809
+ headers = {"Content-Type": "application/json"}
810
+ response = requests.post(url, json=payload, headers=headers)
811
+ return response.json()
812
+
813
+
814
+ ################################
815
+ #### SUBPORCESS TERMINATION ####
816
+ ################################
817
+ # Register the termination code to be executed at exit
818
+ atexit.register(lambda: process.terminate() if process.poll() is None else None)
819
+
820
+
821
+ ######################
822
+ #### GRADIO STUFF ####
823
+ ######################
824
+ def state_modifier(state):
825
+ if not params["activate"]:
826
+ return state
827
+
828
+ state["stream"] = False
829
+ return state
830
+
831
+
832
+ def update_narrator_enabled(value):
833
+ if value == "Enabled":
834
+ params["narrator_enabled"] = True
835
+ elif value == "Disabled":
836
+ params["narrator_enabled"] = False
837
+
838
+
839
+ def update_non_quoted_text_is(value):
840
+ global non_quoted_text_is
841
+ if value == "Narrator":
842
+ non_quoted_text_is = False
843
+ elif value == "Char":
844
+ non_quoted_text_is = True
845
+
846
+
847
+ def input_modifier(string, state):
848
+ if not params["activate"]:
849
+ return string
850
+
851
+ shared.processing_message = "*Is recording a voice message...*"
852
+ return string
853
+
854
+
855
+ def ui():
856
+ with gr.Accordion(params["branding"] + " TTS (XTTSv2)"):
857
+ # Activate alltalk_tts, Enable autoplay, Show text
858
+ with gr.Row():
859
+ activate = gr.Checkbox(value=params["activate"], label="Enable TTS")
860
+ autoplay = gr.Checkbox(value=params["autoplay"], label="Autoplay TTS")
861
+ show_text = gr.Checkbox(value=params["show_text"], label="Show Text")
862
+
863
+ # Low vram enable, Deepspeed enable, Remove trailing dots
864
+ with gr.Row():
865
+ low_vram = gr.Checkbox(
866
+ value=params["low_vram"], label="Enable Low VRAM Mode"
867
+ )
868
+ low_vram_play = gr.HTML(visible=False)
869
+ deepspeed_checkbox = gr.Checkbox(
870
+ value=params["deepspeed_activate"],
871
+ label="Enable DeepSpeed",
872
+ visible=deepspeed_installed,
873
+ )
874
+ deepspeed_checkbox_play = gr.HTML(visible=False)
875
+ remove_trailing_dots = gr.Checkbox(
876
+ value=params["remove_trailing_dots"], label='Remove trailing "."'
877
+ )
878
+
879
+ # TTS method, Character voice selection
880
+ with gr.Row():
881
+ model_loader_choices = ["API TTS", "API Local", "XTTSv2 Local"]
882
+ if finetuned_model:
883
+ model_loader_choices.append("XTTSv2 FT")
884
+ tts_radio_buttons = gr.Radio(
885
+ choices=model_loader_choices,
886
+ label="TTS Method (Each method sounds slightly different)",
887
+ value=gr_modelchoice, # Set the default value
888
+ )
889
+ tts_radio_buttons_play = gr.HTML(visible=False)
890
+ with gr.Row():
891
+ available_voices = get_available_voices()
892
+ default_voice = params[
893
+ "voice"
894
+ ] # Check if the default voice is in the list of available voices
895
+
896
+ if default_voice not in available_voices:
897
+ default_voice = available_voices[
898
+ 0
899
+ ] # Choose the first available voice as the default
900
+ # Add allow_custom_value=True to the Dropdown
901
+ voice = gr.Dropdown(
902
+ available_voices,
903
+ label="Character Voice",
904
+ value=default_voice,
905
+ allow_custom_value=True,
906
+ )
907
+ create_refresh_button(
908
+ voice,
909
+ lambda: None,
910
+ lambda: {
911
+ "choices": get_available_voices(),
912
+ "value": params["voice"],
913
+ },
914
+ "refresh-button",
915
+ )
916
+
917
+ # Language, Narrator voice
918
+ with gr.Row():
919
+ language = gr.Dropdown(
920
+ languages.keys(), label="Language", value=params["language"]
921
+ )
922
+ with gr.Row():
923
+ narrator_voice_gr = gr.Dropdown(
924
+ get_available_voices(),
925
+ label="Narrator Voice",
926
+ allow_custom_value=True,
927
+ value=params["narrator_voice"],
928
+ )
929
+ create_refresh_button(
930
+ narrator_voice_gr,
931
+ lambda: None,
932
+ lambda: {
933
+ "choices": get_available_voices(),
934
+ "value": params["narrator_voice"],
935
+ },
936
+ "refresh-button",
937
+ )
938
+
939
+ # Temperature, Repetition Penalty
940
+ with gr.Row():
941
+ local_temperature_gr = gr.Slider(
942
+ minimum=0.05,
943
+ maximum=1,
944
+ step=0.05,
945
+ label="Temperature",
946
+ value=params["local_temperature"],
947
+ )
948
+ local_repetition_penalty_gr = gr.Slider(
949
+ minimum=0.5,
950
+ maximum=20,
951
+ step=0.5,
952
+ label="Repetition Penalty",
953
+ value=params["local_repetition_penalty"],
954
+ )
955
+
956
+ # Narrator enable, Non quoted text, Explanation text
957
+ with gr.Row():
958
+ with gr.Row():
959
+ narrator_enabled_gr = gr.Radio(
960
+ choices={"Enabled": "true", "Disabled": "false"},
961
+ label="Narrator",
962
+ value="Enabled" if params.get("narrator_enabled") else "Disabled",
963
+ )
964
+ non_quoted_text_is_gr = gr.Radio(
965
+ choices={"Character": "true", "Narrator": "false"},
966
+ label='Unmarked text NOT inside of * or " is',
967
+ value="Character" if non_quoted_text_is else "Narrator",
968
+ )
969
+ explanation_text = gr.HTML(
970
+ f"<p>⚙️ <a href='http://{params['ip_address']}:{params['port_number']}'>Settings and Documentation Page</a><a href='http://{params['ip_address']}:{params['port_number']}'></a>⚙️<br>- Low VRAM Mode and Deepspeed take 15 seconds to be enabled or disabled.<br>- The DeepSpeed checkbox is only visible if DeepSpeed is present.</p>"
971
+ )
972
+
973
+ # Preview speech
974
+ with gr.Row():
975
+ preview_text = gr.Text(
976
+ show_label=False,
977
+ placeholder="Preview text",
978
+ elem_id="silero_preview_text",
979
+ )
980
+ preview_play = gr.Button("Preview")
981
+ preview_audio = gr.HTML(visible=False)
982
+
983
+ with gr.Row():
984
+ convert = gr.Button("Permanently replace audios with the message texts")
985
+ convert_cancel = gr.Button("Cancel", visible=False)
986
+ convert_confirm = gr.Button(
987
+ "Confirm (cannot be undone)", variant="stop", visible=False
988
+ )
989
+
990
+ # Convert history with confirmation
991
+ convert_arr = [convert_confirm, convert, convert_cancel]
992
+ convert.click(
993
+ lambda: [
994
+ gr.update(visible=True),
995
+ gr.update(visible=False),
996
+ gr.update(visible=True),
997
+ ],
998
+ None,
999
+ convert_arr,
1000
+ )
1001
+ convert_confirm.click(
1002
+ lambda: [
1003
+ gr.update(visible=False),
1004
+ gr.update(visible=True),
1005
+ gr.update(visible=False),
1006
+ ],
1007
+ None,
1008
+ convert_arr,
1009
+ ).then(remove_tts_from_history, gradio("history"), gradio("history")).then(
1010
+ chat.save_history,
1011
+ gradio("history", "unique_id", "character_menu", "mode"),
1012
+ None,
1013
+ ).then(
1014
+ chat.redraw_html, gradio(ui_chat.reload_arr), gradio("display")
1015
+ )
1016
+
1017
+ convert_cancel.click(
1018
+ lambda: [
1019
+ gr.update(visible=False),
1020
+ gr.update(visible=True),
1021
+ gr.update(visible=False),
1022
+ ],
1023
+ None,
1024
+ convert_arr,
1025
+ )
1026
+
1027
+ # Toggle message text in history
1028
+ show_text.change(lambda x: params.update({"show_text": x}), show_text, None).then(
1029
+ toggle_text_in_history, gradio("history"), gradio("history")
1030
+ ).then(
1031
+ chat.save_history,
1032
+ gradio("history", "unique_id", "character_menu", "mode"),
1033
+ None,
1034
+ ).then(
1035
+ chat.redraw_html, gradio(ui_chat.reload_arr), gradio("display")
1036
+ )
1037
+
1038
+ # Event functions to update the parameters in the backend
1039
+ activate.change(lambda x: params.update({"activate": x}), activate, None)
1040
+ autoplay.change(lambda x: params.update({"autoplay": x}), autoplay, None)
1041
+ low_vram.change(lambda x: params.update({"low_vram": x}), low_vram, None)
1042
+ low_vram.change(lambda x: send_lowvram_request(x), low_vram, low_vram_play, None)
1043
+ tts_radio_buttons.change(
1044
+ send_reload_request, tts_radio_buttons, tts_radio_buttons_play, None
1045
+ )
1046
+ deepspeed_checkbox.change(
1047
+ send_deepspeed_request, deepspeed_checkbox, deepspeed_checkbox_play, None
1048
+ )
1049
+ remove_trailing_dots.change(
1050
+ lambda x: params.update({"remove_trailing_dots": x}), remove_trailing_dots, None
1051
+ )
1052
+ voice.change(lambda x: params.update({"voice": x}), voice, None)
1053
+ language.change(lambda x: params.update({"language": x}), language, None)
1054
+
1055
+ # TSS Settings
1056
+ local_temperature_gr.change(
1057
+ lambda x: params.update({"local_temperature": x}), local_temperature_gr, None
1058
+ )
1059
+ local_repetition_penalty_gr.change(
1060
+ lambda x: params.update({"local_repetition_penalty": x}),
1061
+ local_repetition_penalty_gr,
1062
+ None,
1063
+ )
1064
+
1065
+ # Narrator selection actions
1066
+ narrator_enabled_gr.change(update_narrator_enabled, narrator_enabled_gr, None)
1067
+ non_quoted_text_is_gr.change(update_non_quoted_text_is, non_quoted_text_is_gr, None)
1068
+ narrator_voice_gr.change(
1069
+ lambda x: params.update({"narrator_voice": x}), narrator_voice_gr, None
1070
+ )
1071
+
1072
+ # Play preview
1073
+ preview_text.submit(voice_preview, preview_text, preview_audio)
1074
+ preview_play.click(voice_preview, preview_text, preview_audio)
1075
+
1076
+
1077
+ ##########################################
1078
+ #### STANDALONE MODE LOOP TERMINATION ####
1079
+ ##########################################
1080
+ ## Loop to keep the script from exiting out if its being run as a standalone script and not part of text-generation-webui
1081
+ if running_in_standalone:
1082
+ while True:
1083
+ try:
1084
+ time.sleep(1) # Add a small delay to avoid high CPU usage
1085
+ except KeyboardInterrupt:
1086
+ break # Allow graceful exit on Ctrl+C
alltalk_tts/system/admin.html ADDED
The diff for this file is too large to render. See raw diff
 
alltalk_tts/system/at_admin/3c6fde566d6a.jpg ADDED

Git LFS Details

  • SHA256: dd5802badb1ce41ba7169d88f4a14dfcc8e88ac756200966bad3b4a2005954c4
  • Pointer size: 130 Bytes
  • Size of remote file: 99.7 kB
alltalk_tts/system/at_admin/4abed1ca.jpg ADDED

Git LFS Details

  • SHA256: 6851a764f4ada5f6147be649b0a84504df5ce27a8daac4adc3e775ec986a8563
  • Pointer size: 130 Bytes
  • Size of remote file: 11.3 kB
alltalk_tts/system/at_admin/at_settings.html ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>AllTalk Startup Settings</title>
8
+ <style>
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ margin: 5px;
12
+ padding: 5px;
13
+ background-color: #f4f4f4;
14
+ }
15
+
16
+ h1 {
17
+ color: #333;
18
+ margin-bottom: 10px;
19
+ }
20
+
21
+ h1,
22
+ h2,
23
+ h3 {
24
+ text-decoration: underline;
25
+ margin-bottom: 10px;
26
+ }
27
+
28
+ form {
29
+ max-width: 975px;
30
+ margin: 0 auto;
31
+ display: grid;
32
+ grid-template-columns: repeat(4, 1fr);
33
+ gap: 5px;
34
+ /* Adjusted the gap to create more space */
35
+ justify-content: start;
36
+ }
37
+
38
+ .radio-group {
39
+ grid-column: span 2;
40
+ /* Span both columns */
41
+ display: grid;
42
+ grid-template-columns: repeat(2, 1fr);
43
+ gap: 10px;
44
+ }
45
+
46
+ label {
47
+ display: block;
48
+ margin-top: 2px;
49
+ color: #555;
50
+ }
51
+
52
+ select,
53
+ input,
54
+ button {
55
+ width: 100%;
56
+ padding: 3px;
57
+ margin-top: 1px;
58
+ margin-bottom: 3px;
59
+ box-sizing: border-box;
60
+ font-size: 11px;
61
+ }
62
+
63
+ button {
64
+ background-color: #4caf50;
65
+ color: white;
66
+ border: none;
67
+ padding: 5px;
68
+ cursor: pointer;
69
+ font-size: 12px;
70
+ grid-column: span 4;
71
+ }
72
+
73
+ .warning {
74
+ grid-column: span 4;
75
+ /* Span all 4 columns */
76
+ text-align: center;
77
+ /* Center-align the text */
78
+ color: red;
79
+ /* Adjusted color for emphasis */
80
+ font-weight: bold;
81
+ /* Make the text bold */
82
+ margin-top: 10px;
83
+ /* Add some space between the button and the warning */
84
+ }
85
+ </style>
86
+ </head>
87
+
88
+ <body>
89
+ <h3>AllTalk Startup Settings</h3><br>
90
+ <form action="/update-settings" method="post">
91
+
92
+ <label for="activate" style="color: #b273fa;">TG-webui Activate TTS:</label>
93
+ <select id="activate" name="activate" required="">
94
+ <option {% if data.activate %}selected{% endif %} value="true">True</option>
95
+ <option {% if not data.activate %}selected{% endif %} value="false">False</option>
96
+ </select>
97
+
98
+ <label for="autoplay" style="color: #b273fa;">&nbsp; &nbsp; TG-webui Autoplay TTS:</label>
99
+ <select id="autoplay" name="autoplay" required="">
100
+ <option {% if data.autoplay %}selected{% endif %} value="true">True</option>
101
+ <option {% if not data.autoplay %}selected{% endif %} value="false">False</option>
102
+ </select>
103
+
104
+ <label for="show_text" style="color: #b273fa;">TG-webui Show Text:</label>
105
+ <select id="show_text" name="show_text" required="">
106
+ <option {% if data.show_text %}selected{% endif %} value="true">True</option>
107
+ <option {% if not data.show_text %}selected{% endif %} value="false">False</option>
108
+ </select>
109
+
110
+ <label for="voice" style="color: #b273fa;">&nbsp; &nbsp; TG-webui Default voice:</label>
111
+ <select id="voice" name="voice" required="">
112
+ {% for file in wav_files %}
113
+ <option value="{{ file }}" {% if data.voice==file %}selected{% endif %}>{{ file }}</option>
114
+ {% endfor %}
115
+ </select>
116
+
117
+
118
+ <label for="language" style="color: #b273fa;">TG-webui Default Language:</label>
119
+ <select id="language" name="language" required="">
120
+ <option value="Arabic" {% if data.language=='Arabic' %}selected{% endif %}>Arabic</option>
121
+ <option value="Chinese" {% if data.language=='Chinese' %}selected{% endif %}>Chinese</option>
122
+ <option value="Czech" {% if data.language=='Czech' %}selected{% endif %}>Czech</option>
123
+ <option value="Dutch" {% if data.language=='Dutch' %}selected{% endif %}>Dutch</option>
124
+ <option value="English" {% if data.language=='English' %}selected{% endif %}>English</option>
125
+ <option value="French" {% if data.language=='French' %}selected{% endif %}>French</option>
126
+ <option value="German" {% if data.language=='German' %}selected{% endif %}>German</option>
127
+ <option value="Hindi" {% if data.language=='Hindi' %}selected{% endif %}>Hindi</option>
128
+ <option value="Hungarian" {% if data.language=='Hungarian' %}selected{% endif %}>Hungarian</option>
129
+ <option value="Italian" {% if data.language=='Italian' %}selected{% endif %}>Italian</option>
130
+ <option value="Japanese" {% if data.language=='Japanese' %}selected{% endif %}>Japanese</option>
131
+ <option value="Korean" {% if data.language=='Korean' %}selected{% endif %}>Korean</option>
132
+ <option value="Polish" {% if data.language=='Polish' %}selected{% endif %}>Polish</option>
133
+ <option value="Portuguese" {% if data.language=='Portuguese' %}selected{% endif %}>Portuguese</option>
134
+ <option value="Russian" {% if data.language=='Russian' %}selected{% endif %}>Russian</option>
135
+ <option value="Spanish" {% if data.language=='Spanish' %}selected{% endif %}>Spanish</option>
136
+ <option value="Turkish" {% if data.language=='Turkish' %}selected{% endif %}>Turkish</option>
137
+ </select>
138
+
139
+ <label for="narrator_voice" style="color: #b273fa;">&nbsp; &nbsp; TG-webui Narrator voice:</label>
140
+ <select id="narrator_voice" name="narrator_voice" required="">
141
+ {% for file in wav_files %}
142
+ <option value="{{ file }}" {% if data.narrator_voice==file %}selected{% endif %}>{{ file }}</option>
143
+ {% endfor %}
144
+ </select>
145
+
146
+ <label for="remove_trailing_dots" style="color: #b273fa;">TG-webui Remove Trailing Dots:</label>
147
+ <select id="remove_trailing_dots" name="remove_trailing_dots" required="">
148
+ <option {% if data.remove_trailing_dots %}selected{% endif %} value="true">True</option>
149
+ <option {% if not data.remove_trailing_dots %}selected{% endif %} value="false">False</option>
150
+ </select>
151
+
152
+ <label for="narrator_enabled" style="color: #b273fa;">&nbsp; &nbsp; TG-webui Narrator enabled:</label>
153
+ <select id="narrator_enabled" name="narrator_enabled" required="">
154
+ <option {% if data.narrator_enabled %}selected{% endif %} value="true">True</option>
155
+ <option {% if not data.narrator_enabled %}selected{% endif %} value="false">False</option>
156
+ </select>
157
+
158
+ <label for="delete_output_wavs" style="color: #33cc33;">Del WAV's older than:</label>
159
+ <select id="delete_output_wavs" name="delete_output_wavs" required="">
160
+ <option value="Disabled" {% if data.delete_output_wavs=='Disabled' %}selected{% endif %}>Disabled</option>
161
+ <option value="1 Day" {% if data.delete_output_wavs=='1 Day' %}selected{% endif %}>1 Day</option>
162
+ <option value="2 Days" {% if data.delete_output_wavs=='2 Days' %}selected{% endif %}>2 Days</option>
163
+ <option value="3 Days" {% if data.delete_output_wavs=='3 Days' %}selected{% endif %}>3 Days</option>
164
+ <option value="4 Day" {% if data.delete_output_wavs=='4 Days' %}selected{% endif %}>4 Days</option>
165
+ <option value="5 Day" {% if data.delete_output_wavs=='5 Days' %}selected{% endif %}>5 Days</option>
166
+ <option value="6 Day" {% if data.delete_output_wavs=='6 Days' %}selected{% endif %}>6 Days</option>
167
+ <option value="7 Days" {% if data.delete_output_wavs=='7 Days' %}selected{% endif %}>7 Days</option>
168
+ <option value="14 Days" {% if data.delete_output_wavs=='14 Days' %}selected{% endif %}>14 Days</option>
169
+ <option value="21 Days" {% if data.delete_output_wavs=='21 Days' %}selected{% endif %}>21 Days</option>
170
+ <option value="28 Days" {% if data.delete_output_wavs=='28 Days' %}selected{% endif %}>28 Days</option>
171
+ </select>
172
+
173
+
174
+ <label for="low_vram" style="color: #33cc33;">&nbsp; &nbsp; Low VRAM:</label>
175
+ <select id="low_vram" name="low_vram" required="">
176
+ <option {% if data.low_vram %}selected{% endif %} value="true">True</option>
177
+ <option {% if not data.low_vram %}selected{% endif %} value="false">False</option>
178
+ </select>
179
+
180
+ <label for="local_temperature" style="color: red;">Local Model temperature:</label>
181
+ <select id="local_temperature" name="local_temperature" required="">
182
+ {% for temp in range(0, 101, 5) %}
183
+ <option value="{{ temp/100 }}" {% if data.local_temperature|float == temp/100 %}selected{% endif %}>{{ "{:.2f}".format(temp/100) }}</option>
184
+ {% endfor %}
185
+ </select>
186
+
187
+ <label for="local_repetition_penalty" style="color: red;">&nbsp; &nbsp; Local Model repetition penalty:</label>
188
+ <select id="local_repetition_penalty" name="local_repetition_penalty" required="">
189
+ {% for repetition in range(10, 210, 10) %}
190
+ <option value="{{ repetition/10 }}" {% if data.local_repetition_penalty|float == repetition/10 %}selected{% endif %}>{{ repetition/10 }}</option>
191
+ {% endfor %}
192
+ </select>
193
+
194
+ <label for="deepspeed_activate" style="color: red;">DeepSpeed Activate:</label>
195
+ <select id="deepspeed_activate" name="deepspeed_activate" required="">
196
+ <option {% if data.deepspeed_activate %}selected{% endif %} value="true">True</option>
197
+ <option {% if not data.deepspeed_activate %}selected{% endif %} value="false">False</option>
198
+ </select>
199
+
200
+ <label for="output_folder_wav" style="color: red;">&nbsp; &nbsp; WAV Output Folder:</label>
201
+ <input id="output_folder_wav" name="output_folder_wav" required="" type="text"
202
+ value="{{ data.output_folder_wav }}" />
203
+
204
+
205
+ <input type="hidden" id="tts_model_loaded" name="tts_model_loaded" value="{{ data.tts_model_loaded }}" />
206
+
207
+ <!-- Continue updating other dropdowns and inputs in a similar manner -->
208
+
209
+ <label for="tts_model_name" style="color: red;"> API TTS Model Name:</label>
210
+ <input id="tts_model_name" name="tts_model_name" required="" type="text" value="{{ data.tts_model_name }}" />
211
+
212
+ <label for="model_version"
213
+ style="color: red; font-size: 16px; line-height: 1; vertical-align: bottom; margin-bottom: 0;">&nbsp;
214
+ &nbsp;&nbsp;API Local Model Folder:</label>
215
+ <span style="font-size: 14px; vertical-align: bottom; margin-bottom: 0; margin-top: 2px;">{{
216
+ modeldownload_model_path }}</span>
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+ <label for="ip_address" style="color: red;"> IP Address:</label>
229
+ <input id="ip_address" name="ip_address" required="" type="text" value="{{ data.ip_address }}" />
230
+
231
+ <label for="port_number" style="color: red;"> &nbsp; &nbsp; Port Number:</label>
232
+ <input id="port_number" name="port_number" required="" type="text" value="{{ data.port_number }}" />
233
+
234
+ <div class="radio-group">
235
+ <label for="tts_method_api_local" style="color: #33cc33;">Model: <span
236
+ style="color: black; font-weight: normal;">API Local</span>:</label>
237
+ <input id="tts_method_api_local_true" {% if data.tts_method_api_local %}checked{% endif %} name="tts_method"
238
+ type="radio" value="api_local" />
239
+ </div>
240
+
241
+ <div class="radio-group">
242
+ <label for="tts_method_api_tts" style="color: #33cc33;">&nbsp; &nbsp;&nbsp;Model: <span
243
+ style="color: black; font-weight: normal;">API TTS</span>:</label>
244
+ <input id="tts_method_api_tts_true" {% if data.tts_method_api_tts %}checked{% endif %} name="tts_method"
245
+ type="radio" value="api_tts" />
246
+ </div>
247
+
248
+ <div class="radio-group">
249
+ <label for="tts_method_xtts_local" style="color: #33cc33;">Model: <span
250
+ style="color: black; font-weight: normal;">XTTS Local</span>:</label>
251
+ <input id="tts_method_xtts_local_true" {% if data.tts_method_xtts_local %}checked{% endif %}
252
+ name="tts_method" type="radio" value="xtts_local" />
253
+ </div>
254
+ <button type="submit">Update Settings</button>
255
+ </form>
256
+ <p class="warning">WARNING: Changing RED items or setting DeepSpeed to True on a system without DeepSpeed installed,
257
+ may cause errors.</p>
258
+
259
+ </body>
260
+
261
+ </html>
alltalk_tts/system/at_admin/atandsdplugin.jpg ADDED

Git LFS Details

  • SHA256: 395e6bfc5ea7a7b0908ebbf4dfb112583be6c08e3fca8c590e052a66032d6502
  • Pointer size: 131 Bytes
  • Size of remote file: 222 kB
alltalk_tts/system/at_admin/deepspeedexample.jpg ADDED

Git LFS Details

  • SHA256: f7c048cb0c80f95ed90839c9e8d8a2fb744ba0442d16680dc9af1c20dbbe0566
  • Pointer size: 131 Bytes
  • Size of remote file: 177 kB
alltalk_tts/system/at_admin/favicon.ico ADDED
alltalk_tts/system/at_admin/lowvrammode.png ADDED

Git LFS Details

  • SHA256: 9ec8eabf1fa4a1aaa9616783173a134df396ec76d04975da44cd01bbe2c8a75a
  • Pointer size: 130 Bytes
  • Size of remote file: 58.8 kB
alltalk_tts/system/at_admin/pythonenvironment.jpg ADDED

Git LFS Details

  • SHA256: 6b8e307301cf6e211e6b088850a4ba0188b2bbba8a9f8de23e07038df8ad72b1
  • Pointer size: 130 Bytes
  • Size of remote file: 60.4 kB
alltalk_tts/system/at_admin/pythonrequirementswindows.jpg ADDED

Git LFS Details

  • SHA256: c734f36f1014bfe43e02bb8a0156cf6303e389322ed67a6ad77f2593c70dbc1e
  • Pointer size: 130 Bytes
  • Size of remote file: 92.8 kB
alltalk_tts/system/at_admin/textnotinside.jpg ADDED

Git LFS Details

  • SHA256: 91536f492cae25a76d767de5b5a1471be0b6b6843f547200709d753d2d68c35c
  • Pointer size: 130 Bytes
  • Size of remote file: 53.7 kB
alltalk_tts/system/at_sounds/apilocal.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c2ab70ebabb0d4c335435723f9a0380b31fb907dd213f833d6b0c5f75079126
3
+ size 169040
alltalk_tts/system/at_sounds/apitts.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d3886158dbb19769d4992828f3c8af65cfc844cf7d42b866239adb80ab4b346
3
+ size 218192
alltalk_tts/system/at_sounds/changingmodel.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:68c0081645657f9ca40f6fa834d03d7fcea321f038472e1171d01d0e2e9eea9c
3
+ size 182352
alltalk_tts/system/at_sounds/deepspeeddisabled.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba5623f2fe0b5b729e61e35a601b725dbad5b5b78e79ab221417b0dcf3cfe866
3
+ size 119888
alltalk_tts/system/at_sounds/deepspeedenabled.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e2d93dcd95c559cbbd839f6c3392b9b29c513d0e3aae44a1906588f86718ec5
3
+ size 102480
alltalk_tts/system/at_sounds/lowvramdisabled.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:040baf99d290c163a3ebbcfa711a1e40e38f57110b11136f08493bea7988f441
3
+ size 151632
alltalk_tts/system/at_sounds/lowvramenabled.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:842c9f53f6dda611e775f8f8a0357ee6d5c43571a9ba9dc096f585d1020f2ebd
3
+ size 106576
alltalk_tts/system/at_sounds/xttsfinetuned.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d769ad94ac7690082d6cf6b88a69394021d926026635882022ce167cc0c2b1f8
3
+ size 204880
alltalk_tts/system/at_sounds/xttslocal.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:635d9727a3821acb8cb5297f1451ee3c17e050decd12cefbedafdabfa1d64b30
3
+ size 204880
alltalk_tts/system/config/at_configdowngrade.json ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {
2
+ }
alltalk_tts/system/config/at_configupdate.json ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {
2
+ }