from speechbrain.pretrained import EncoderASR
asr_model = EncoderASR.from_hparams(source="speechbrain/asr-wav2vec2-commonvoice-fr", savedir="pretrained_models/asr-wav2vec2-commonvoice-fr")
The model pass to downloading the weights but even after that I can’t use it offline! If anyone has an idea about this, I would really appreciate the help!
After banging my head on it for an hour, I think it’s not a transformers issue, but a speechbrain issue.
transformers has ways of saying “only use local files”, either using the TRANSFORMERS_OFFLINE=1 environment variable, or using the local_files_only=True parameter to .from_pretrained(). Both of these don’t work on EncoderASR.from_hparams().
According to the documentation, and this issue, once you’ve downloaded the model, speechbrain won’t try to download it again. However, it seems that it always does a network request using the HuggingFace Hub, and I couldn’t get around that.