I’m trying to load the ASR model ‘facebook/wav2vec2-large-xlsr-53’ so I made this simple script to test:
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
# Define the model name
model_name = "facebook/wav2vec2-large-xlsr-53"
# Download the processor and the model
processor = Wav2Vec2Processor.from_pretrained(model_name)
processor.save_pretrained("wav2vec2_model")
model = Wav2Vec2ForCTC.from_pretrained(model_name)
model.save_pretrained("wav2vec2_model")
print("Model and processor downloaded and saved locally.")
But I kept getting this error:
OSError: Can't load tokenizer for 'facebook/wav2vec2-large-xlsr-53'.
If you were trying to load it from 'https://huggingface.co/models',
make sure you don't have a local directory with the same name. Otherwise,
make sure 'facebook/wav2vec2-large-xlsr-53' is the correct path to a
directory containing all relevant files for a Wav2Vec2CTCTokenizer tokenizer.
I’ve tried clearing the cache and tried using ‘AutoProcessor’ instead of ‘Wav2Vec2Processor’, but the issue still persists. Has anyone seen this error and know how to resolve this issue?
New contributor
Bobby Miller is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.