| 12345678910111213141516171819202122232425262728293031323334353637 |
- # coding=utf-8
- import io
- from typing import Dict
- from models_provider.base_model_provider import MaxKBBaseModel
- from models_provider.impl.base_stt import BaseSpeechToText
- class TencentSpeechToText(MaxKBBaseModel, BaseSpeechToText):
- secret_id: str
- secret_key: str
- model: str
- @staticmethod
- def is_cache_model():
- return False
- def __init__(self, **kwargs):
- super().__init__(**kwargs)
- self.secret_id = kwargs.get('secret_id')
- self.secret_key = kwargs.get('secret_key')
- self.model = kwargs.get('model')
- @staticmethod
- def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
- return TencentSpeechToText(
- model=model_name,
- secret_id=model_credential.get('secret_id'),
- secret_key=model_credential.get('secret_key'),
- **model_kwargs,
- )
- def check_auth(self):
- pass
- def speech_to_text(self, audio_file):
- return "Tencent STT not implemented"
|