MahmoudAshraf97 / whisper-diarization

Automatic Speech Recognition with Speaker Diarization based on OpenAI Whisper
BSD 2-Clause "Simplified" License
3.77k stars 331 forks source link

problem in unpacking load_alignment_model #224

Closed 01Ashish closed 2 months ago

01Ashish commented 2 months ago

having issue while unpacking load_alignment_model

ValueError: not enough values to unpack (expected 3, got 2) Traceback: File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling result = func() File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec exec(code, module.dict) File "/content/app-streamlit.py", line 262, in main() File "/content/app-streamlit.py", line 239, in main transcript = transcribe(temp_file_path) File "/content/app-streamlit.py", line 89, in transcribe alignment_model, alignment_tokenizer,alignment_dictionary = load_alignment_model(

in ctc forced aligner repo you can check for this function 
ctc_forced_aligner/alignment_utils.py

load_alignment_model returning 2 values
but get_alignments function using 3 very same values received from the above mentioned function 
Please somebody guide me  
01Ashish commented 2 months ago

I am using this https://github.com/MahmoudAshraf97/whisper-diarization/blob/main/Whisper_Transcription_%2B_NeMo_Diarization.ipynb

01Ashish commented 2 months ago

I have fixed this issue by removing var alignment dictionary and instead of passing alignment_ditionary pass alignment_tokenizer in get_alignments() function

alignment_model, alignment_tokenizer = load_alignment_model(

segments, scores, blank_id = get_alignments( emissions, tokens_starred, alignment_tokenizer, )