Atinoda / text-generation-webui-docker

Docker variants of oobabooga's text-generation-webui, including pre-built images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to load coqui_tts

FKouhai opened this issue · comments

Environment

  • docker version: 24.0.7, build afdd53b4e3
  • kernel version: 6.6.7-arch1-1
  • OS: EndeavourOS
  • nvidia-container-toolkit version: 1.13.5

Docker images used

  • atinoda/text-generation-webui:latest
  • atinoda/text-generation-webui:latest-nightly
  • atinoda/text-generation-webui:default

Setting BUILD_EXTENSIONS_LIVE="coqui_tts" does not build them live and need to be enabled manually on the webui

When enabling coqui_tts in the webui it expects user input

docker-compose log

text-generation-webui  | 2023-12-15 22:33:07 INFO:Loading the extension "coqui_tts"...
text-generation-webui  | [XTTS] Loading XTTS...
text-generation-webui  |  > You must agree to the terms of service to use this model.
text-generation-webui  |  | > Please see the terms of service at https://coqui.ai/cpml.txt
text-generation-webui  |  | > "I have read, understood and agreed to the Terms and Conditions." - [y/n]
text-generation-webui  | 2023-12-15 22:33:15 ERROR:Failed to load the extension "coqui_tts".
text-generation-webui  | Traceback (most recent call last):
text-generation-webui  |   File "/app/modules/extensions.py", line 41, in load_extensions
text-generation-webui  |     extension.setup()
text-generation-webui  |   File "/app/extensions/coqui_tts/script.py", line 180, in setup
text-generation-webui  |     model = load_model()
text-generation-webui  |   File "/app/extensions/coqui_tts/script.py", line 76, in load_model
text-generation-webui  |     model = TTS(params["model_name"]).to(params["device"])
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/api.py", line 81, in __init__
text-generation-webui  |     self.load_tts_model_by_name(model_name, gpu)
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/api.py", line 195, in load_tts_model_by_name
text-generation-webui  |     model_path, config_path, vocoder_path, vocoder_config_path, model_dir = self.download_model_by_name(
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/api.py", line 149, in download_model_by_name
text-generation-webui  |     model_path, config_path, model_item = self.manager.download_model(model_name)
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/utils/manage.py", line 433, in download_model
text-generation-webui  |     self.create_dir_and_download_model(model_name, model_item, output_path)
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/utils/manage.py", line 359, in create_dir_and_download_model
text-generation-webui  |     if not self.ask_tos(output_path):
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/utils/manage.py", line 338, in ask_tos
text-generation-webui  |     answer = input(" | | > ")
text-generation-webui  | EOFError: EOF when reading a line
text-generation-webui  |  | | > Running on local URL:  http://0.0.0.0:7860
text-generation-webui  | 
text-generation-webui  | To create a public link, set `share=True` in `launch()`.

After doing some digging seems like a known problem that has already been fixed in oobabooga, refer to this issue

How to reproduce

docker-compose.yml

version: "3"
services:
  text-generation-webui-docker:
    image: atinoda/text-generation-webui:default-nightly # Specify variant as the :tag
    container_name: text-generation-webui
    environment:
      - EXTRA_LAUNCH_ARGS="--listen --verbose" # Custom launch args (e.g., --model MODEL_NAME)
      - BUILD_EXTENSIONS_LIVE="coqui_tts" # Install named extensions during every container launch. THIS WILL SIGNIFICANLTLY SLOW LAUNCH TIME.
    ports:
      - 7860:7860  # Default web port
      - 5000:5000  # Default API port
      - 5005:5005  # Default streaming port
      - 5001:5001  # Default OpenAI API extension port
    volumes:
      - ./config/characters:/app/characters
      - ./config/loras:/app/loras
      - ./config/models:/app/models
      - ./config/presets:/app/presets
      - ./config/prompts:/app/prompts
      - ./config/training:/app/training
      - ./config/extensions:/app/extensions  # Persist all extensions
#      - ./config/extensions/silero_tts:/app/extensions/silero_tts  # Persist a single extension
    logging:
      driver:  json-file
      options:
        max-file: "3"   # number of files or file count
        max-size: '10m'
    deploy:
        resources:
          reservations:
            devices:
              - driver: nvidia
                device_ids: ['0']
                capabilities: [gpu]
docker-compose up -d

Access the webui on port 7860 -> enable coqui_tts from the session tab
Run docker-compose logs

Hi @FKouhai , thank you for the detailed report and links to the upstream issue. I see that the fix has been merged into the dev branch of text-generation-webui and I expect that it will appear in the next snapshot release.

After looking at the fix (https://github.com/oobabooga/text-generation-webui/pull/4905/files), I suggest that you can try adding - COQUI_TOS_AGREED="1" to your docker-compose.yml environment mapping. This may fix the problem immediately.

Hey @Atinoda , thanks for the fast reply.

I just tried and doesnt seem to work, but no biggie I will just wait for their next release

@FKouhai - The latest snapshot build has been pushed to the stable images, and the release notes indicate that this fix was merged into it. Please check it out, and let me know! If all is good then you can close the issue.

Hey @Atinoda Ive tried snapshot-2023-12-17 and got the same result

text-generation-webui  |  > You must agree to the terms of service to use this model.
text-generation-webui  |  | > Please see the terms of service at https://coqui.ai/cpml.txt
text-generation-webui  |  | > "I have read, understood and agreed to the Terms and Conditions." - [y/n]
text-generation-webui  | 2023-12-18 18:56:11 ERROR:Failed to load the extension "coqui_tts".
text-generation-webui  | Traceback (most recent call last):
text-generation-webui  |   File "/app/modules/extensions.py", line 41, in load_extensions
text-generation-webui  |     extension.setup()
text-generation-webui  |   File "/app/extensions/coqui_tts/script.py", line 180, in setup
text-generation-webui  |     model = load_model()
text-generation-webui  |   File "/app/extensions/coqui_tts/script.py", line 76, in load_model
text-generation-webui  |     model = TTS(params["model_name"]).to(params["device"])
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/api.py", line 81, in __init__
text-generation-webui  |     self.load_tts_model_by_name(model_name, gpu)
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/api.py", line 195, in load_tts_model_by_name
text-generation-webui  |     model_path, config_path, vocoder_path, vocoder_config_path, model_dir = self.download_model_by_name(
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/api.py", line 149, in download_model_by_name
text-generation-webui  |     model_path, config_path, model_item = self.manager.download_model(model_name)
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/utils/manage.py", line 433, in download_model
text-generation-webui  |     self.create_dir_and_download_model(model_name, model_item, output_path)
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/utils/manage.py", line 359, in create_dir_and_download_model
text-generation-webui  |     if not self.ask_tos(output_path):
text-generation-webui  |   File "/venv/lib/python3.10/site-packages/TTS/utils/manage.py", line 338, in ask_tos
text-generation-webui  |     answer = input(" | | > ")
text-generation-webui  | EOFError: EOF when reading a line

one thing that Ive noticed which is kind of misleading is that it appears to be enabled in the webui, Im pretty positive ooga frontend doesnt keep any sort of actual state regarding the loaded modules

imagen

That's odd that it doesn't work. I'm planning to do The Big Refactor over the Christmas period and I will make a point of testing this and fixing the issue during that work. If the extension is a half-decent FOSS TTS then I have a project in mind that I want to use it for - so I have some personal motivation in that regard!

thats great, if you need some help with that lmk I will be happy to help you out with that

This has been tested and should be fixed with the latest updates - thanks for reporting!