benob / recasepunc

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

Can't do inference #7

Closed MatFrancois closed 2 years ago

MatFrancois commented 2 years ago

Hello, I'm trying to use example.py on a french model (fr.22000 or fr-txt.large.19000) But I have this error: raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for Model: Unexpected key(s) in state_dict: "bert.position_ids". I also tried with the following command, same error in output. python recasepunc.py predict fr.22000 < toto.txt > output.txt Do you have any advice? Thanks

Enescigdem commented 2 years ago

Hello , I have the same issue with French model

benob commented 2 years ago

It is likely a version mismatch of the transformers module. Are you using transformers==4.10.0?

MatFrancois commented 2 years ago

Indeed it works better like that. Thank you