152334H / tortoise-tts-fast

Fast TorToiSe inference (5x or your money back!)
GNU Affero General Public License v3.0
759 stars 177 forks source link

streamlit - cannot import name MODELS_DIR #84

Closed gruevy closed 1 year ago

gruevy commented 1 year ago

EDIT - it looks like this is because my CUDA for torchaudio doesn't match the CUDA i have installed. Not sure how to go about fixing that.

I moved the script app.py into the base tortoise-tts-fast directory and ran it, and the UI crashes before it gets very far. This is what it says:

ImportError: cannot import name 'MODELS_DIR' from 'tortoise.api' (D:\stablediffusion\tortoise-tts-fast\tortoise\api.py) Traceback: File "C:\Users\Ryan\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.dict) File "D:\stablediffusion\tortoise-tts-fast\app.py", line 8, in from tortoise.api import MODELS_DIR

In the console, it printed all this:

PS D:\stablediffusion\tortoise-tts-fast> streamlit run app.py

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501 Network URL: http://192.168.0.63:8501

2023-05-08 20:47:30.477 Uncaught app exception Traceback (most recent call last): File "C:\Users\Ryan\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.dict) File "D:\stablediffusion\tortoise-tts-fast\app.py", line 8, in from tortoise.api import MODELS_DIR File "D:\stablediffusion\tortoise-tts-fast\tortoise\api.py", line 9, in import torchaudio File "C:\Users\Ryan\AppData\Local\Programs\Python\Python310\lib\site-packages\torchaudio__init.py", line 1, in from torchaudio import ( # noqa: F401 File "C:\Users\Ryan\AppData\Local\Programs\Python\Python310\lib\site-packages\torchaudio_extension__init__.py", line 47, in _check_cuda_version() File "C:\Users\Ryan\AppData\Local\Programs\Python\Python310\lib\site-packages\torchaudio_extension\utils.py", line 119, in _check_cuda_version raise RuntimeError( RuntimeError: Detected that PyTorch and TorchAudio were compiled with different CUDA versions. PyTorch has CUDA version 11.8 whereas TorchAudio has CUDA version 11.7. Please install the TorchAudio version that matches your PyTorch version. 2023-05-08 20:47:30.478 Uncaught app exception Traceback (most recent call last): File "C:\Users\Ryan\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.dict__) File "D:\stablediffusion\tortoise-tts-fast\app.py", line 8, in from tortoise.api import MODELS_DIR ImportError: cannot import name 'MODELS_DIR' from 'tortoise.api' (D:\stablediffusion\tortoise-tts-fast\tortoise\api.py) 2023-05-08 20:47:30.478 Uncaught app exception Traceback (most recent call last): File "C:\Users\Ryan\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.dict) File "D:\stablediffusion\tortoise-tts-fast\app.py", line 8, in from tortoise.api import MODELS_DIR ImportError: cannot import name 'MODELS_DIR' from 'tortoise.api' (D:\stablediffusion\tortoise-tts-fast\tortoise\api.py)