-
Notifications
You must be signed in to change notification settings - Fork 303
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
NameError: name 'torch' is not defined #1503
Comments
Have you tried ct2-transformers-converter --model simonl0909/whisper-large-v2-cantonese --output_dir fast_canton --copy_files tokenizer_config.json --quantization float16 |
G:>ct2-transformers-converter --model simonl0909/whisper-large-v2-cantonese --output_dir fast_canton --copy_files tokenizer_config.json --quantization float16 Traceback (most recent call last): |
Can you do pip install torch |
Just for your information, I try it one more time on my Mac instead of the Windows that you saw above, same result temp3 % ct2-transformers-converter --model simonl0909/whisper-large-v2-cantonese --output_dir fast_canton --copy_files tokenizer_config.json --quantization float16 Traceback (most recent call last): goten@Gotens-Mac-Studio-116 temp3 % aiohttp 3.8.4 |
|
Please use a proper Python virtual environment like |
thanks for help, I eventually use my Mac to convert the file into .bin that can be used by faster-whisper. I wonder if something can be converted that is used by Whisper OpenAI that takes .py file? Sorry keep asking silly question as I am no programmer. |
No, it's not possible. |
a bit late but make sure you use the correct version of pytorch and that transformers and huggingface-hub are installed. if it still doesn't work add with this: |
I am trying to convert using the following command
ct2-transformers-converter --model g:\whisper-large-v2-cantonese\pytorch_model.bin --output_dir fast_canton --copy_files tokenizer_config.json --quantization float16
from this model https://huggingface.co/simonl0909/whisper-large-v2-cantonese
I got error like this
PS G:> ct2-transformers-converter --model g:\whisper-large-v2-cantonese\pytorch_model.bin --output_dir fast_canton --copy_files tokenizer_config.json --quantization float16
Traceback (most recent call last):
File "D:\Program Files\Python\Phthon3.10.6\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\Program Files\Python\Phthon3.10.6\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\Program Files\Python\Phthon3.10.6\Scripts\ct2-transformers-converter.exe_main.py", line 7, in
File "D:\Program Files\Python\Phthon3.10.6\lib\site-packages\ctranslate2\converters\transformers.py", line 1771, in main
converter.convert_from_args(args)
File "D:\Program Files\Python\Phthon3.10.6\lib\site-packages\ctranslate2\converters\converter.py", line 50, in convert_from_args
return self.convert(
File "D:\Program Files\Python\Phthon3.10.6\lib\site-packages\ctranslate2\converters\converter.py", line 89, in convert
model_spec = self._load()
File "D:\Program Files\Python\Phthon3.10.6\lib\site-packages\ctranslate2\converters\transformers.py", line 97, in _load
with torch.no_grad():
NameError: name 'torch' is not defined
The text was updated successfully, but these errors were encountered: