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

NameError: name 'CriterionType' is not defined #86

Open
mukherjeesougata opened this issue Apr 2, 2024 · 1 comment
Open

NameError: name 'CriterionType' is not defined #86

mukherjeesougata opened this issue Apr 2, 2024 · 1 comment
Labels
question Further information is requested

Comments

@mukherjeesougata
Copy link

I am trying to decode a fine-tuned ASR model,fine-tuned using the vakyansh toolkit using the this script and the following command line:-

python ../../utils/inference/infer.py ${data_path} --task audio_pretraining
--nbest 1 --path ${checkpoint_path} --gen-subset ${subset} --results-path ${result_path} --w2l-decoder viterbi
--lm-weight 2 --word-score -1 --sil-weight 0 --criterion ctc --labels ltr --max-tokens 6000000
--post-process letter --model-overrides "{'w2v_path':'${pretrained_model_path}'}"
But it is showing the following error:-

Traceback (most recent call last):
File "../../utils/inference/infer.py", line 428, in
cli_main()
File "../../utils/inference/infer.py", line 424, in cli_main
main(args)
File "../../utils/inference/infer.py", line 283, in main
generator = build_generator(args)
File "../../utils/inference/infer.py", line 268, in build_generator
return W2lViterbiDecoder(args, task.target_dictionary)
File "/data/Sougata/vakyansh_latest/vakyansh-wav2vec2-experimentation/wav2vec/fairseq/examples/speech_recognition/w2l_decoder.py", line 115, in init
super().init(args, tgt_dict)
File "/data/Sougata/vakyansh_latest/vakyansh-wav2vec2-experimentation/wav2vec/fairseq/examples/speech_recognition/w2l_decoder.py", line 56, in init
self.criterion_type = CriterionType.CTC
NameError: name 'CriterionType' is not defined
Flashlight-text was installed using these set of commands and Flashlight-sequence using these set of commands.
I have also tried installing flashlight-text and flashlight-sequence using the command python -m pip install flashlight-text, but still it is giving the same error.
I have run from flashlight.lib.text.decoder import CriterionType, it is working.

@mukherjeesougata mukherjeesougata added the question Further information is requested label Apr 2, 2024
@mukherjeesougata mukherjeesougata changed the title [Question title here] NameError: name 'CriterionType' is not defined Apr 2, 2024
@Lalaramarya
Copy link

@tlikhomanenko, I am also facing the same problem. Can you please suggest a solution to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants