-
Notifications
You must be signed in to change notification settings - Fork 176
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
AttributeError: module 'torch' has no attribute 'compile' #85
Comments
Installed latest pip3 version using pip3 install -U WhisperSpeech, Cuda 12.2 |
Are you using a custom script? Can you try using the example script I uploaded to the "examples" folder? |
I am using just the example code from here: https://huggingface.co/spaces/collabora/WhisperSpeech from whisperspeech.pipeline import Pipeline pipe = Pipeline(torch_compile=True) |
Good luck! |
LOL - there is no fix? |
I already suggested you try the script that I created in the examples folder, and if you do, I can possibly offer some insight. |
Oh your script worked perfectly :) May I ask where is the option to use my own voice in the code? I can see it on Huggingface but not in the script/readme. |
You posted your message while I was writing this...but I'm going to finish it because I believe it might still be useful to troubleshoot why the web-based script you gave didn't work. Here goes... First, here's what chatgpt says based on the error print you initially provided: I am personally using CUDA 11.8 and Pytorch version 2.1.2 on Windows. Therefore, I can't help directly troubleshoot Linux, but here's what I'd recommend.
If your GPU is Nvidia you'll need to use the following commands (python 3.10):
If you are using an AMD gpu on Linux, know that Pytorch only supports gpu-acceleration based on AMD gpus on Linux, not on Windows. Moreover, it requires a different pytorch installation and a prerequisite of "rocM." I can't test because I don't use Linux nor AMD gpus, but here are the pip installs assuming you get rocM working:
THIS ASSUMES ROCM VERSION 5.6. There are different commands for 5.5. You can explore any and all links to wheels at these links: https://download.pytorch.org/whl/cu118 If you plan on using Pytorch 2.2.2 the proper commands can be obtained here: https://pytorch.org/get-started/locally/ Note that the only available rocM specified is 5.7 though so...Pytorch only gives you the nice fancy calculator of the proper commands for it's latest stable version (2.2.2) and its "nightly" version. Follow my instructions for the slightly older commands or you can also go here: https://pytorch.org/get-started/previous-versions/ However, I've noticed that sometimes these don't work as well as locating the specific wheels yourself. Also, make sure and install pytorch after you install whisperspeech...I think a dependency of WhisperSpeech - "speechbrain" perhaps - also installs pytorch, but it installs a cpu versionl...anyways, reinstalling with the proper command should override that... |
Python 3.10.10 (main, Mar 23 2023, 03:59:34) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
Failed to load the T2S model:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/whisperspeech/pipeline.py", line 49, in init
if optimize: self.t2s.optimize(torch_compile=torch_compile)
File "/usr/local/lib/python3.10/site-packages/whisperspeech/t2s_up_wds_mlang_enclm.py", line 383, in optimize
self.generate_next = torch.compile(self.generate_next, mode="reduce-overhead", fullgraph=True)
AttributeError: module 'torch' has no attribute 'compile'
Failed to load the S2A model:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/whisperspeech/pipeline.py", line 57, in init
if optimize: self.s2a.optimize(torch_compile=torch_compile)
File "/usr/local/lib/python3.10/site-packages/whisperspeech/s2a_delar_mup_wds_mlang.py", line 452, in optimize
self.generate_next = torch.compile(self.generate_next, mode="reduce-overhead", fullgraph=True)
AttributeError: module 'torch' has no attribute 'compile'
The text was updated successfully, but these errors were encountered: