fix: Whisper stt model
parent
e8c6e75a09
commit
a568cfe893
|
|
@ -13,7 +13,7 @@ from models_provider.base_model_provider import BaseModelCredential, ValidCode
|
||||||
|
|
||||||
class VLLMWhisperModelParams(BaseForm):
|
class VLLMWhisperModelParams(BaseForm):
|
||||||
Language = forms.TextInputField(
|
Language = forms.TextInputField(
|
||||||
TooltipLabel(_('Language'),
|
TooltipLabel(_('language'),
|
||||||
_("If not passed, the default value is 'zh'")),
|
_("If not passed, the default value is 'zh'")),
|
||||||
required=True,
|
required=True,
|
||||||
default_value='zh',
|
default_value='zh',
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,11 @@ class VllmWhisperSpeechToText(MaxKBBaseModel, BaseSpeechToText):
|
||||||
api_key=self.api_key,
|
api_key=self.api_key,
|
||||||
base_url=base_url
|
base_url=base_url
|
||||||
)
|
)
|
||||||
|
buf = audio_file.read()
|
||||||
filter_params = {k: v for k, v in self.params.items() if k not in {'model_id', 'use_local', 'streaming'}}
|
filter_params = {k: v for k, v in self.params.items() if k not in {'model_id', 'use_local', 'streaming'}}
|
||||||
transcription_params = {
|
transcription_params = {
|
||||||
'model': self.model,
|
'model': self.model,
|
||||||
'file': audio_file,
|
'file': buf,
|
||||||
'language': 'zh',
|
'language': 'zh',
|
||||||
}
|
}
|
||||||
result = client.audio.transcriptions.create(
|
result = client.audio.transcriptions.create(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue