erew123 / alltalk_tts

AllTalk is based on the Coqui TTS engine, similar to the Coqui_tts extension for Text generation webUI, however supports a variety of advanced features, such as a settings page, low VRAM support, DeepSpeed, narrator, model finetuning, custom models, wav file maintenance. It can also be used with 3rd Party software via JSON calls.
GNU Affero General Public License v3.0
873 stars 101 forks source link

When installed under webui inside docker, the webserver doesn't start #100

Closed mahdiyari closed 7 months ago

mahdiyari commented 7 months ago

Describe the bug Running text-generation-webui inside the docker container and followed the instructions on how to install using the bash script under extensions. After loading the extension, the webserver for alltalk doesn't start. I did test this exact setup outside the docker and there was no problem.

To Reproduce Steps to reproduce the behaviour:

Log messages

*******************************************************************
* WARNING: You haven't downloaded any model yet.
* Once the web UI launches, head over to the "Model" tab and download one.
*******************************************************************

09:24:36-332237 INFO     Starting Text generation web UI                                                                                              
09:24:36-334669 INFO     Loading the extension "gallery"                                                                                              
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Closing server running on port: 7860
09:24:49-314515 INFO     Loading the extension "gallery"                                                                                              
09:24:49-315244 INFO     Loading the extension "alltalk_tts"                                                                                          
[2024-02-18 09:24:51,246] [INFO] [real_accelerator.py:191:get_accelerator] Setting ds_accelerator to cuda (auto detect)
[AllTalk Startup] Coqui Public Model License
[AllTalk Startup] https://coqui.ai/cpml.txt
[AllTalk Startup] Old output wav file deletion is set to disabled.
[AllTalk Startup] Checking Model is Downloaded.
[AllTalk Startup] TTS version installed: 0.22.0
[AllTalk Startup] TTS version is up to date.
[AllTalk Startup] All required files are present.
[AllTalk Startup] Running in Docker. Please wait.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
mahdiyari commented 7 months ago

Manually running Alltalk using the launch.sh script does run the webserver but when loading with webui, it doesn't.

erew123 commented 7 months ago

Hi @mahdiyari

I'm not fantastically strong on Docker. It was actually created by someone other than me, though, quite a few people have used it with success (so I'm assured).

Happy to try match your setup though. I know it shouldn't matter, however, what OS are you running this on? (windows or linux)

Thanks

mahdiyari commented 7 months ago

It was ubuntu 20.

erew123 commented 7 months ago

Hi @mahdiyari

I've just given this a go on my Ubuntu 22.04 install. After installing docker, then downloading and starting the image, I performed the following:

sudo docker ps to get the container ID of the current running image.

sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' YOUR-CONTAINERID-HERE To pull the Virtual IP address that the container is being presented on.

In my case, my container ID was a818e37accf4 so I ran:

sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' a818e37accf4

Screenshot from 2024-02-19 16-04-41

Which gave me the IP address of 172.17.0.3 and I was able to connect through on that IP address.

Screenshot from 2024-02-19 16-18-25

Would you like to check if that allows you to get to the AllTalk server within the docker?

Thanks

mahdiyari commented 7 months ago

Did you run it through text-generation-webui as an extension? The problem was text-generation-webui wouldn't launch the webserver so it couldn't generate TTS.

I run my container with --network=host so it runs on my localhost

erew123 commented 7 months ago

Hi @mahdiyari

I think I ended up at cross purposes there with you! (My fault for not reading correctly).

I think I can see what's occurring here, let me just confirm the scenario. You are using:

So what I suspect is going on, is when the Docker build of AllTalk was made (by a 3rd party) it performs a check to see if its running inside a Docker container and if it is, Docker actually takes over doing various tasks, which would be why youre not seeing the webserver start up. This may be a complicated one for me to have to figure a long term solution, as changing this would break the AllTalk Docker build......... However, I can give you what I think is a quick fix for youself.

In the script.py file, you can delete lines 251 to 256 and it should skip the docker check and continue on with loading the webserver.

# Check if we're running in docker
if os.path.isfile("/.dockerenv"):
    print(
        f"[{params['branding']}Startup] \033[94mRunning in Docker. Please wait.\033[0m"
    )
else:

image

If you arent ok to do that yourself and you need me to upload a custom file for you, let me know.

Thanks

mahdiyari commented 7 months ago

Thanks for checking into this issue. It's fine I can edit the file.