Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError 'en' #868

Open
pr-data-port opened this issue Aug 27, 2024 · 0 comments
Open

KeyError 'en' #868

pr-data-port opened this issue Aug 27, 2024 · 0 comments

Comments

@pr-data-port
Copy link

I am getting this error when trying to align english model with whisperx:

KeyError                                  Traceback (most recent call last)
Cell In[22], line 1
----> 1 result_aligned = whisperx.align(
      2     result["segments"], 
      3     model_a, 
      4     metadata, 
      5     audio_resampled, 
      6     device, 
      7     return_char_alignments=False)

File /data/anaconda3/envs/vsep/lib/python3.9/site-packages/whisperx/alignment.py:129, in align(transcript, model, align_model_metadata, audio, device, interpolate_method, return_char_alignments, print_progress, combined_progress, preprocess)
    126 # Load align model Huggingface processor for audio feature extraction (Normalization)
    127 if preprocess and model_type == 'huggingface':
    128     processor = Wav2Vec2Processor.from_pretrained(
--> 129         DEFAULT_ALIGN_MODELS_HF[model_lang])
    131 # 1. Preprocess to keep only characters in dictionary
    132 total_segments = len(transcript)

KeyError: 'en'

the whisperx align model I use:

model_a, metadata = whisperx.load_align_model(
    model_name='jonatasgrosman/wav2vec2-large-xlsr-53-english', 
    language_code=result["language"], 
    device=device)

result_aligned = whisperx.align(
    result["segments"], 
    model_a, 
    metadata, 
    audio_resampled, 
    device, 
    return_char_alignments=False)    

has anyone had any similar issue?

@github-staff github-staff deleted a comment from yiweifengyan Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant