Unverified Commit f868cf73 authored by Danial Kurtumerov's avatar Danial Kurtumerov Committed by GitHub
Browse files

Fixed Wav2Vec2ProcessorWithLM decoding error (#31188)

* fix: wav2vec2_with_lm decoding error

Fixed an error where some language models could
not be loaded due to a decoding error, since it
was impossible to select the 'unigram_encoding'
value.

* fix: unexpected keyword argument

Fixed unexpected keyword argument caused by
passing kwargs directly to BeamSearchDecoderCTC.

* style: wav2vec2_with_lm

Changed single quotes to double quotes.
parent bdf36dcd
......@@ -152,7 +152,8 @@ class Wav2Vec2ProcessorWithLM(ProcessorMixin):
feature_extractor, tokenizer = super()._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs)
if os.path.isdir(pretrained_model_name_or_path) or os.path.isfile(pretrained_model_name_or_path):
decoder = BeamSearchDecoderCTC.load_from_dir(pretrained_model_name_or_path)
unigram_encoding = kwargs.get("unigram_encoding", "utf-8")
decoder = BeamSearchDecoderCTC.load_from_dir(pretrained_model_name_or_path, unigram_encoding)
else:
# BeamSearchDecoderCTC has no auto class
kwargs.pop("_from_auto", None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment