You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ~/miniconda3/envs/speech_recognition/lib/python3.9/site-packages/transformers/pipelines/base.py:894, in Pipeline.init(self, model, tokenizer, feature_extractor, image_processor, modelcard, framework, task, args_parser, device, torch_dtype, binary_output, **kwargs) 892 self._batch_size = kwargs.pop("batch_size", None) 893 self._num_workers = kwargs.pop("num_workers", None)
--> 894 self._preprocess_params, self._forward_params, self._postprocess_params = self._sanitize_parameters(**kwargs) 896 # Pipelines calling generate: if the tokenizer has a pad token but the model doesn't, set it in the 897 # forward params so that generate is aware of the pad token. 898 if ( 899 self.tokenizer is not None 900 and self.model.can_generate() 901 and self.tokenizer.pad_token_id is not None 902 and self.model.generation_config.pad_token_id is None 903 ):
TypeError: _sanitize_parameters() got an unexpected keyword argument 'low_cpu_mem_usage'stion is.
The text was updated successfully, but these errors were encountered:
Describe the Question
Please provide a clear and concise description of what the que---------------------------------------------------------------------------
运行例子时遇到了这个错误,应该如何解决
TypeError Traceback (most recent call last)
Cell In[1], line 5
1 from parrots import SpeechRecognition
4 if name == 'main':
----> 5 m = SpeechRecognition('/app/pretrained_models/Belle-distilwhisper-large-v2-zh', low_cpu_mem_usage=False)
6 r = m.recognize_speech_from_file('./output.wav')
7 print('[提示] 语音识别结果:', r)
File /app/project/ASR-TTS/parrots/asr.py:81, in SpeechRecognition.init(self, model_name_or_path, use_cuda, cuda_device, max_new_tokens, chunk_length_s, batch_size, torch_dtype, use_flash_attention_2, language, **kwargs)
78 self.model.to(self.device)
80 self.processor = AutoProcessor.from_pretrained(model_name_or_path)
---> 81 self.pipe = pipeline(
82 "automatic-speech-recognition",
83 model=self.model,
84 tokenizer=self.processor.tokenizer,
85 feature_extractor=self.processor.feature_extractor,
86 device=self.device,
87 torch_dtype=torch_dtype,
88 max_new_tokens=max_new_tokens,
89 batch_size=batch_size,
90 chunk_length_s=chunk_length_s,
91 **kwargs
92 )
93 if language == 'zh':
94 self.pipe.model.config.forced_decoder_ids = (
95 self.pipe.tokenizer.get_decoder_prompt_ids(
96 language=language,
97 task="transcribe"
98 )
99 )
File ~/miniconda3/envs/speech_recognition/lib/python3.9/site-packages/transformers/pipelines/init.py:1108, in pipeline(task, model, config, tokenizer, feature_extractor, image_processor, framework, revision, use_fast, token, device, device_map, torch_dtype, trust_remote_code, model_kwargs, pipeline_class, **kwargs)
1105 if device is not None:
1106 kwargs["device"] = device
-> 1108 return pipeline_class(model=model, framework=framework, task=task, **kwargs)
File ~/miniconda3/envs/speech_recognition/lib/python3.9/site-packages/transformers/pipelines/automatic_speech_recognition.py:220, in AutomaticSpeechRecognitionPipeline.init(self, model, feature_extractor, tokenizer, decoder, device, torch_dtype, **kwargs)
217 else:
218 self.type = "ctc"
--> 220 super().init(model, tokenizer, feature_extractor, device=device, torch_dtype=torch_dtype, **kwargs)
File ~/miniconda3/envs/speech_recognition/lib/python3.9/site-packages/transformers/pipelines/base.py:894, in Pipeline.init(self, model, tokenizer, feature_extractor, image_processor, modelcard, framework, task, args_parser, device, torch_dtype, binary_output, **kwargs)
892 self._batch_size = kwargs.pop("batch_size", None)
893 self._num_workers = kwargs.pop("num_workers", None)
--> 894 self._preprocess_params, self._forward_params, self._postprocess_params = self._sanitize_parameters(**kwargs)
896 # Pipelines calling
generate
: if the tokenizer has a pad token but the model doesn't, set it in the897 # forward params so that
generate
is aware of the pad token.898 if (
899 self.tokenizer is not None
900 and self.model.can_generate()
901 and self.tokenizer.pad_token_id is not None
902 and self.model.generation_config.pad_token_id is None
903 ):
TypeError: _sanitize_parameters() got an unexpected keyword argument 'low_cpu_mem_usage'stion is.
The text was updated successfully, but these errors were encountered: