-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install fails on Windows // Deepspeed fails to install, No module named 'TTS' , piper-phonemize~=1.0.0 not available #24
Comments
deepspeed is probably being removed from default installations next release, you can comment it out of requirements.txt and reinstall. thanks for the report! Update: pip remove deepspeed |
if you need deepspeed you also need to install the cuda-toolkit for your os, which is perhaps more complex than installing the rest of the software... |
I do not really need deepspeed, I commented it out, and I am still getting the same 'no Module named TTS' when trying to run speech.py And something else to note. On windows, piper-tts seems not to be able to be installed because of piper-phonemize
But this is an issue with piper-phonemize on Windows, looking at their github. |
Is this install in wsl2? I'm not much help with windows, sorry, but if you can use them, the docker images should work for you with docker desktop + wsl2. |
No, I m trying to use it standalone, on Windows, no docker, no anything like that, for 2 reasons.
I ll see if I can find a solution. It might be a me issue |
I managed to get it to start - thanks chatGPT, by adding
Now it starts, without any arguments, but then, after connecting to Open WebUI, and trying TTS, I get some more errors:
Now trying to run speech.py with arguments, for example --xtts_device cpu --preload xtts, I m getting:
At this point, I m pretty sure I m doing something wrong. |
it may need to be fixed to run piper.exe instead of piper, but honestly I think you're the first to try directly in windows. |
Try making sure you're using python 3.11, piper-phonemize does not work with python 3.12 yet. |
Any update here? I'll close the issue if you don't have any more to add, I still highly recommend you try the docker setup. |
Hello, we do have a strong appeal, directly installed on Windows, because you are very familiar with the overall architecture, could you provide some ideas directly installed on Windows? Thank you very much! |
@ryanull24 did you manage to get it working on windows without docker?/ Thanks |
I gave up. Look at my comment above. I had it start apparently, but it would throw errors in Open WebUI so I gave up on it. I am by no means familiar with coding, and I did not know where to start looking into things. |
Thanks @ryanull24 Yes I saw your comment. |
Well, I didn't try this but you may be able to install a piper.exe binary directly without using pip, not sure if this will work either though, but it might get farther. |
@matatonic thanks for the quick reply. Really appreciate it. Where can I get my hands on a piper.exe file? Do you have one around? I'd be happy to report the feedback, |
HI @matatonic Thanks again for the file. Unfortunately, it didn't work. I tried the piper, piper-phonemize, and piper-phonemize-crossover repos to go back to the roots. Aside from trying to compile the whole thing from scratch, there are absolutely no solutions for Windows 11 OS. It sucks that this amazing project doesn't work on Windows 11 :( |
This is due to
startup.bat @echo off
@REM set /p < speech.env
set TTS_HOME=voices
set HF_HOME=voices
@REM call download_voices_tts-1.bat
@REM call download_voices_tts-1-hd.bat %PRELOAD_MODEL%
if defined PRELOAD_MODEL (
set "preload=--preload"
)
python speech.py %preload% %PRELOAD_MODEL% %EXTRA_ARGS%
speech.py # line 226, remove the first arg which is "piper"
tts_args = ["--model", str(piper_model), "--data-dir", "voices", "--download-dir", "voices", "--output-raw"]
# line 232, add executable parameter
tts_proc = subprocess.Popen(tts_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, executable="absolute path to piper.exe") Now it should work running startup.bat |
You are a legend @seancheung ! . I'll let you know how it goes after Ive given it a go! |
I have written a one-click-run windows batch script: run.bat @echo off
setlocal enabledelayedexpansion
cd /D "%~dp0"
@rem test the conda binary
echo Miniconda version:
call conda --version || ( echo. && echo Miniconda not found. && goto end )
@rem deactivate existing conda envs as needed to avoid conflicts
(call conda deactivate && call conda deactivate && call conda deactivate) 2>nul
set CONDA_DIR=%cd%\.conda
set PYTHON_VER=3.11
@rem create the installer env
if not exist "%CONDA_DIR%" (
echo Packages to install: %PACKAGES_TO_INSTALL%
call conda create --no-shortcuts -y -k --prefix "%CONDA_DIR%" python=%PYTHON_VER% || ( echo. && echo Conda environment creation failed. && goto end )
)
@rem check if conda environment was actually created
if not exist "%CONDA_DIR%\python.exe" ( echo. && echo Conda environment is empty. && goto end )
@rem environment isolation
set PYTHONNOUSERSITE=1
set PYTHONPATH=
set PYTHONHOME=
set "CUDA_PATH=%CONDA_DIR%"
set "CUDA_HOME=%CUDA_PATH%"
set TTS_DIR=openedai-speech
if not exist "%cd%\%TTS_DIR%" (
echo Cloning repo...
where git || ( echo. && echo git not found. && goto end )
git clone "https://github.com/matatonic/openedai-speech.git" openedai-speech
)
@rem activate installer env
call conda activate "%CONDA_DIR%" || ( echo. && echo Miniconda env not found. && goto end )
echo Conda env set to: %CONDA_PREFIX%
set "PIPER_URL=https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_windows_amd64.zip"
set "PIPER_TMP_FILE=%cd%\piper_windows_amd64.zip"
if not exist "%cd%\piper" (
echo Downloading piper...
where curl || ( echo. && echo curl not found. && goto end )
where tar || ( echo. && echo tar not found. && goto end )
curl -L -o "%PIPER_TMP_FILE%" "%PIPER_URL%"
tar -xf "%PIPER_TMP_FILE%"
if exist "%PIPER_TMP_FILE%" del "%PIPER_TMP_FILE%"
)
set INIT_LOCKFILE=%cd%\.lock
if not exist "%INIT_LOCKFILE%" (
echo Installing dependencies...
@REM Remove piper-tts from requirements.txt
findstr /v /c:"piper-tts" "%cd%\%TTS_DIR%\requirements.txt" > "%cd%\%TTS_DIR%\requirements-win.txt"
@REM Install torch with cuda
call pip install torch==2.5.1+cu121 torchaudio==2.5.1+cu121 --extra-index-url https://download.pytorch.org/whl/cu121
call pip install -r "%cd%\%TTS_DIR%\requirements-win.txt"
echo. 2>"%INIT_LOCKFILE%"
)
@rem launch
set TTS_HOME=voices
set HF_HOME=voices
set TTS_PORT=8001
set "PATH=%PATH%;%cd%\piper;"
cd /D "%~dp0\%TTS_DIR%"
call python speech.py --port %TTS_PORT% --log-level DEBUG
:end
pause Just copy this file to a empty folder, and double click it. It will clone this repo, download piper and make required modifications. The folder will look like this after a successful initialization: Notice:
Edit |
@seancheung Awesome, thank you! |
Thanks so much @seancheung . However it didn't work for me. My setup: Windows 11, Python 3.10 and 3.11 installed, Cuda 11.8, Cuda 12.4, CUDNN 9, Conda, pytorch. I did exactly what you mentioned above. Here were the errors: Can I give you any other info or screenshots to provide some guidance? Thanks again |
You were requesting with a wrong url ("GET /v1/audio/tts HTTP/1.1"), which gave you 404 error. The correct request is "POST /v1/audio/speech" as addressed in the repo's homepage. You also need to download voice models(you interested in) from https://github.com/rhasspy/piper/blob/master/VOICES.md and put them in voices(default) folder: Then copy pre_process_map.default.yaml and voice_to_speaker.default.yaml to config folder and rename them: When using To do a test: curl http://localhost:8001/v1/audio/speech -H "Content-Type: application/json" -d '{"input": "The quick brown fox jumped over the lazy dog.","voice":"alloy","model":"tts-1","response_format":"mp3"}' -o speech.mp3 You should see successful info logs in the console like the following: As for voice clone, use |
When trying to run speech. py I am getting this error:
I am on Windows 11 with python 3.11.9
I really don t have a lot of experience with python and running programs, but what I did was:
git clone repo
create a virtual environment .venv
activate said virtual environment .venv\Scripts\Activate
pip install -r requirements.txt
run speech.py - getting TTS module error
go back to virtual environment and install TTS
get above error
Also an error when installing deepspeed with pip install -r requirements.txt
I made sure torch was installed under the same virtual environment.
The text was updated successfully, but these errors were encountered: