L6_Automatic_Speech_Recognition error with command asr(example["audio"]["array"])

I get the error ‘GenerationConfig’ object has no attribute ‘lang_to_id’
When I look into the GenerationConfig file, I downloaded from the website https://s172-31-8-94p20714.lab-aws-production.deeplearning.ai/tree/models/distil-whisper/distil-small.en, there is no lang_to_id parameter.
So the error seems correct.

Who can help me out?
Kind regards,
Marcel

Stack trace:

AttributeError Traceback (most recent call last)
Cell In[22], line 1
----> 1 asr(example[“audio”][“array”])

File ~/anaconda3/lib/python3.11/site-packages/transformers/pipelines/automatic_speech_recognition.py:285, in AutomaticSpeechRecognitionPipeline.call(self, inputs, **kwargs)
222 def call(
223 self,
224 inputs: Union[np.ndarray, bytes, str],
225 **kwargs,
226 ):
227 “”"
228 Transcribe the audio sequence(s) given as inputs to text. See the [AutomaticSpeechRecognitionPipeline]
229 documentation for more information.
(…)
283 "".join(chunk["text"] for chunk in output["chunks"]).
284 “”"
→ 285 return super().call(inputs, **kwargs)

File ~/anaconda3/lib/python3.11/site-packages/transformers/pipelines/base.py:1188, in Pipeline.call(self, inputs, num_workers, batch_size, *args, **kwargs)
1186 return self.iterate(inputs, preprocess_params, forward_params, postprocess_params)
1187 elif self.framework == “pt” and isinstance(self, ChunkPipeline):
→ 1188 return next(
1189 iter(
1190 self.get_iterator(
1191 [inputs], num_workers, batch_size, preprocess_params, forward_params, postprocess_params
1192 )
1193 )
1194 )
1195 else:
1196 return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)

File ~/anaconda3/lib/python3.11/site-packages/transformers/pipelines/pt_utils.py:124, in PipelineIterator.next(self)
121 return self.loader_batch_item()
123 # We’re out of items within a batch
→ 124 item = next(self.iterator)
125 processed = self.infer(item, **self.params)
126 # We now have a batch of “inferred things”.

File ~/anaconda3/lib/python3.11/site-packages/transformers/pipelines/pt_utils.py:266, in PipelinePackIterator.next(self)
263 return accumulator
265 while not is_last:
→ 266 processed = self.infer(next(self.iterator), **self.params)
267 if self.loader_batch_size is not None:
268 if isinstance(processed, torch.Tensor):

File ~/anaconda3/lib/python3.11/site-packages/transformers/pipelines/base.py:1102, in Pipeline.forward(self, model_inputs, **forward_params)
1100 with inference_context():
1101 model_inputs = self._ensure_tensor_on_device(model_inputs, device=self.device)
→ 1102 model_outputs = self._forward(model_inputs, **forward_params)
1103 model_outputs = self._ensure_tensor_on_device(model_outputs, device=torch.device(“cpu”))
1104 else:

File ~/anaconda3/lib/python3.11/site-packages/transformers/pipelines/automatic_speech_recognition.py:498, in AutomaticSpeechRecognitionPipeline._forward(self, model_inputs, return_timestamps, generate_kwargs)
495 else:
496 generate_kwargs[“encoder_outputs”] = encoder(inputs, attention_mask=attention_mask)
→ 498 tokens = self.model.generate(
499 attention_mask=attention_mask,
500 **generate_kwargs,
501 )
502 if return_timestamps == “word” and self.type == “seq2seq_whisper”:
503 out = {“tokens”: tokens[“sequences”], “token_timestamps”: tokens[“token_timestamps”]}

File ~/anaconda3/lib/python3.11/site-packages/transformers/models/whisper/generation_whisper.py:533, in WhisperGenerationMixin.generate(self, input_features, generation_config, logits_processor, stopping_criteria, prefix_allowed_tokens_fn, synced_gpus, return_timestamps, task, language, is_multilingual, prompt_ids, prompt_condition_type, condition_on_prev_tokens, temperature, compression_ratio_threshold, logprob_threshold, no_speech_threshold, num_segment_frames, attention_mask, time_precision, return_token_timestamps, return_segments, return_dict_in_generate, **kwargs)
527 self._set_prompt_condition_type(
528 generation_config=generation_config,
529 prompt_condition_type=prompt_condition_type,
530 )
532 # pass self.config for backward compatibility
→ 533 init_tokens = self._retrieve_init_tokens(
534 input_features,
535 generation_config=generation_config,
536 config=self.config,
537 num_segment_frames=num_segment_frames,
538 kwargs=kwargs,
539 )
540 # TODO(Sanchit) - passing decoder_input_ids is deprecated. One should use prompt_ids instead
541 # This function should be be removed in v4.39
542 self._check_decoder_input_ids(
543 prompt_ids=prompt_ids, init_tokens=init_tokens, is_shortform=is_shortform, kwargs=kwargs
544 )

File ~/anaconda3/lib/python3.11/site-packages/transformers/models/whisper/generation_whisper.py:1134, in WhisperGenerationMixin._retrieve_init_tokens(self, input_features, generation_config, config, num_segment_frames, kwargs)
1132 is_lang_id_undefined = len(init_tokens) <= 1 or (len(init_tokens) > 1 and init_tokens[1] is None)
1133 if language is not None:
→ 1134 if language in generation_config.lang_to_id.keys():
1135 language_token = language
1136 elif language in TO_LANGUAGE_CODE.keys():

AttributeError: ‘GenerationConfig’ object has no attribute ‘lang_to_id’

Error with latest sentence-transformers library - Short Courses / Open Source Models with Hugging Face - DeepLearning.AI