Vaibhavs10 / insanely-fast-whisper

Apache License 2.0
6.94k stars 505 forks source link

pipx install failed on BetterTransformer #135

Closed Utopiah closed 6 months ago

Utopiah commented 6 months ago

Should a working default be supported so that pipx install "just works"?

cf log

fabien@fabien-CORSAIR-ONE-i160:~$ insanely-fast-whisper --file-name 2023-12-11\ 10-23-40.mkv 
config.json: 100%|█████████████████████████████████████████████████████████████████████████| 1.27k/1.27k [00:00<00:00, 2.83MB/s]
model.safetensors: 100%|███████████████████████████████████████████████████████████████████| 3.09G/3.09G [04:31<00:00, 11.4MB/s]
generation_config.json: 100%|██████████████████████████████████████████████████████████████| 3.87k/3.87k [00:00<00:00, 9.05MB/s]
tokenizer_config.json: 100%|█████████████████████████████████████████████████████████████████| 283k/283k [00:00<00:00, 2.78MB/s]
vocab.json: 100%|██████████████████████████████████████████████████████████████████████████| 1.04M/1.04M [00:00<00:00, 11.0MB/s]
tokenizer.json: 100%|██████████████████████████████████████████████████████████████████████| 2.48M/2.48M [00:00<00:00, 4.83MB/s]
merges.txt: 100%|████████████████████████████████████████████████████████████████████████████| 494k/494k [00:00<00:00, 1.86MB/s]
normalizer.json: 100%|█████████████████████████████████████████████████████████████████████| 52.7k/52.7k [00:00<00:00, 19.1MB/s]
added_tokens.json: 100%|███████████████████████████████████████████████████████████████████| 34.6k/34.6k [00:00<00:00, 48.2MB/s]
special_tokens_map.json: 100%|█████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 4.87MB/s]
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
preprocessor_config.json: 100%|█████████████████████████████████████████████████████████████████| 340/340 [00:00<00:00, 925kB/s]
Traceback (most recent call last):
  File "/home/fabien/.local/bin/insanely-fast-whisper", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/fabien/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/insanely_fast_whisper/cli.py", line 89, in main
    pipe.model = pipe.model.to_bettertransformer()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fabien/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/transformers/modeling_utils.py", line 4302, in to_bettertransformer
    return BetterTransformer.transform(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/fabien/.local/pipx/venvs/insanely-fast-whisper/lib/python3.11/site-packages/optimum/bettertransformer/transformation.py", line 228, in transform
    raise NotImplementedError(
NotImplementedError: The model type whisper is not yet supported to be used with BetterTransformer. Feel free to open an issue at https://github.com/huggingface/optimum/issues if you would like this model type to be supported. Currently supported models are: dict_keys(['albert', 'bark', 'bart', 'bert', 'bert-generation', 'blenderbot', 'bloom', 'camembert', 'blip-2', 'clip', 'codegen', 'data2vec-text', 'deit', 'distilbert', 'electra', 'ernie', 'fsmt', 'gpt2', 'gptj', 'gpt_neo', 'gpt_neox', 'hubert', 'layoutlm', 'm2m_100', 'marian', 'markuplm', 'mbart', 'opt', 'pegasus', 'rembert', 'prophetnet', 'roberta', 'roc_bert', 'roformer', 'splinter', 'tapas', 't5', 'vilt', 'vit', 'vit_mae', 'vit_msn', 'wav2vec2', 'xlm-roberta', 'yolos']).
yusodew commented 6 months ago

I'm having the same problem right now, yesterday it was working and today I started getting this error. Did you find a solution?

Vaibhavs10 commented 6 months ago

Looking into this, looks like something broke with the latest update to Transformers.

Vaibhavs10 commented 6 months ago

Hi @Utopiah & @yusodew - I patched it in the most recent patch.

The issue crept up due to an update in optimum: https://github.com/huggingface/optimum/pull/1590 Make sure to get the most recent version of insanely-fast-whisper:

  1. pipx uninstall insanely-fast-whisper
  2. pipx install insanely-fast-whisper==0.0.13 --force
yusodew commented 6 months ago

I tried and it worked. Congratulations for the quick solution

Utopiah commented 6 months ago

Getting

fabien@fabien-CORSAIR-ONE-i160:~$ pipx uninstall insanely-fast-whisper
uninstalled insanely-fast-whisper! ✨ 🌟 ✨
fabien@fabien-CORSAIR-ONE-i160:~$ pipx install insanely-fast-whisper==0.0.13 --force
Fatal error from pip prevented installation. Full pip output in file:
    /home/fabien/.local/pipx/logs/cmd_2023-12-16_07.27.17_pip_errors.log

Some possibly relevant errors from pip install:
    ERROR: Ignored the following versions that require a different python version: 0.0.10 Requires-Python <=3.11,>=3.8; 0.0.11 Requires-Python <=3.11,>=3.8; 0.0.12 Requires-Python <=3.11,>=3.8; 0.0.13 Requires-Python <=3.11,>=3.8; 0.0.9 Requires-Python <=3.11,>=3.8
    ERROR: Could not find a version that satisfies the requirement insanely-fast-whisper==0.0.13 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5b0, 0.0.5b1, 0.0.5b2, 0.0.5b3, 0.0.5, 0.0.6, 0.0.7, 0.0.8)
    ERROR: No matching distribution found for insanely-fast-whisper==0.0.13

Error installing insanely-fast-whisper from spec 'insanely-fast-whisper==0.0.13'.

but I imagine it's due to my version of Python. Will try in a venv.

Vaibhavs10 commented 6 months ago

yeah, try it like this: pipx install insanely-fast-whisper==0.0.13 --python python3.10 --force

(feel free to reopen this issue if it doesn't work)