benob / recasepunc

Model for recasing and repunctuating ASR transcripts
BSD 3-Clause "New" or "Revised" License
126 stars 20 forks source link

While running pretrained German model: AttributeError: Can't get attribute 'Trie' on <module 'transformers.tokenization_utils' #10

Open alihashaam opened 2 years ago

alihashaam commented 2 years ago

I am trying to use pretrained German model:

https://alphacephei.com/vosk/models/vosk-recasepunc-de-0.21.zip

and as mentioned in readme file, I run:

python example.py de-test.txt

but I keep getting following error:

AttributeError: Can't get attribute 'Trie' on <module 'transformers.tokenization_utils' from '/home/ali/ali_initos_work/internal/data_science/speech_to_text/vosk/vosk_env/lib/python3.7/site-packages/transformers/tokenization_utils.py'>

Any idea if the model itself is wrong?

benob commented 2 years ago

This typically happens when you have a different version of transformers installed compared to the one the model was trained with. I don't know about vosk, but the models provided on this github are trained with the version specified in requirements.txt

szeidner commented 1 year ago

I had to use transformers==4.22.1 to use the German model from Vosk and transformers==4.10.0 to use the French model from this github repo. Is there a list somewhere of all the trained models using the same transformers version?