Skip to content
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

Support for torchaudio wheels #1

Closed
CubeSkyy opened this issue May 19, 2023 · 5 comments
Closed

Support for torchaudio wheels #1

CubeSkyy opened this issue May 19, 2023 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@CubeSkyy
Copy link

I was able to run Tensorflow, Torch and TorchVision with the latest release. However, Im currently trying to run a project that uses a fork of neonbjb/tortoise-tts which requires torchaudio. I tried installing the provided .whl for torch and torchvision and install torchaudio afterwards, but I'm getting an error while importing torchaudio:
OSError: libtorch_cuda.so: cannot open shared object file: No such file or directory

I assume this is because torchaudio version was not built along the custom torch/torchvision.

Do you have any plans on making a guide using torchaudio?

Also, thank you so much for the work on the TF/Torch changes!

@evshiron
Copy link
Owner

evshiron commented May 20, 2023

Hi, I am busy at the moment and if you are in a hurry, you can try building it like torchvision by yourself:

If you already have ROCm 5.5 installed, skipping scripts/prepare.sh should be totally fine.

Then you can modify scripts/build_torchvision.sh, replace torchvision stuff with torchaudio, run it and see if it compiles. The built wheels should be located in the dist dir.

I will experiment with it later and eventually have a GitHub workflow for it.

UPDATE: It's not as easy as I thought, will be back later.

@CubeSkyy
Copy link
Author

I'm not in a hurry, I will try to compile it and test If I have time. Thank you for the reply,

@evshiron
Copy link
Owner

evshiron commented May 20, 2023

torchaudio==2.0.2 is now available in this workflow, and will be moved to GitHub Releases once verified.

@evshiron
Copy link
Owner

I managed to generate voices using neonbjb/tortoise-tts, here is how:

git clone https://github.com/neonbjb/tortoise-tts
cd tortoise-tts

python3 -m venv venv
source venv/bin/activate

curl -L -O https://github.com/evshiron/rocm_lab/releases/download/v1.14.514/torch-2.0.1+gite19229c-cp310-cp310-linux_x86_64.whl
pip install torch-2.0.1+gite19229c-cp310-cp310-linux_x86_64.whl

curl -L -O https://github.com/evshiron/rocm_lab/releases/download/v1.14.514/torchaudio-2.0.2+31de77d-cp310-cp310-linux_x86_64.whl
pip install torchaudio-2.0.2+31de77d-cp310-cp310-linux_x86_64.whl

I am using Python 3.10.6 and I have to edit requirements.txt like this to avoid a lot of compiling from source (don't do this if you know how to do it correctly):

diff --git a/requirements.txt b/requirements.txt
index c1846c9..0babe68 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,13 +6,11 @@ inflect
 progressbar
 einops==0.4.1
 unidecode
-scipy==0.10.1
+scipy
 librosa==0.9.1
-numba==0.48.0
+numba
 ffmpeg
-numpy==1.20.0
-numba==0.48.0
-torchaudio
+numpy
 threadpoolctl
 llvmlite
-appdirs
\ No newline at end of file
+appdirs

Install neonbjb/tortoise-tts into venv:

pip install -r requirements.txt
python3 setup.py install

Generate voices:

python3 tortoise/do_tts.py --text "I'm going to speak this" --voice random --preset fast

The results will be located in the results dir.

Samples: results.zip

@evshiron evshiron added documentation Improvements or additions to documentation enhancement New feature or request labels May 20, 2023
@CubeSkyy
Copy link
Author

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants