mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: add TTS model credential and general parameters form
This commit is contained in:
parent
7674804f38
commit
a0118ca397
|
|
@ -9,6 +9,25 @@ from common.exception.app_exception import AppApiException
|
|||
from common.forms import BaseForm, TooltipLabel
|
||||
from models_provider.base_model_provider import BaseModelCredential, ValidCode
|
||||
|
||||
class SiliconCloudTTSModelGeneralParams(BaseForm):
|
||||
# alloy, echo, fable, onyx, nova, shimmer
|
||||
voice = forms.SingleSelect(
|
||||
TooltipLabel('Voice',
|
||||
_('Try out the different sounds (Alloy, Echo, Fable, Onyx, Nova, and Sparkle) to find one that suits your desired tone and audience. The current voiceover is optimized for English.')),
|
||||
required=True, default_value='alloy',
|
||||
text_field='value',
|
||||
value_field='value',
|
||||
option_list=[
|
||||
{'text': 'alex', 'value': 'fnlp/MOSS-TTSD-v0.5:alex'},
|
||||
{'text': 'anna', 'value': 'fnlp/MOSS-TTSD-v0.5:anna'},
|
||||
{'text': 'bella', 'value': 'fnlp/MOSS-TTSD-v0.5:bella'},
|
||||
{'text': 'charles', 'value': 'fnlp/MOSS-TTSD-v0.5:charles'},
|
||||
{'text': 'benjamin', 'value': 'fnlp/MOSS-TTSD-v0.5:benjamin'},
|
||||
{'text': 'claire', 'value': 'fnlp/MOSS-TTSD-v0.5:claire'},
|
||||
{'text': 'david', 'value': 'fnlp/MOSS-TTSD-v0.5:david'},
|
||||
{'text': 'diana', 'value': 'fnlp/MOSS-TTSD-v0.5:diana'},
|
||||
])
|
||||
|
||||
|
||||
class SiliconCloudTTSModelCredential(BaseForm, BaseModelCredential):
|
||||
api_base = forms.TextInputField('API URL', required=True)
|
||||
|
|
@ -46,3 +65,6 @@ class SiliconCloudTTSModelCredential(BaseForm, BaseModelCredential):
|
|||
def encryption_dict(self, model: Dict[str, object]):
|
||||
return {**model, 'api_key': super().encryption(model.get('api_key', ''))}
|
||||
|
||||
|
||||
def get_model_params_setting_form(self, model_name):
|
||||
return SiliconCloudTTSModelGeneralParams()
|
||||
|
|
@ -11,7 +11,6 @@ import os
|
|||
from common.utils.common import get_file_content
|
||||
from models_provider.base_model_provider import IModelProvider, ModelProvideInfo, ModelInfo, \
|
||||
ModelTypeConst, ModelInfoManage
|
||||
from models_provider.impl.openai_model_provider.openai_model_provider import openai_tts_model_credential
|
||||
from models_provider.impl.siliconCloud_model_provider.credential.embedding import \
|
||||
SiliconCloudEmbeddingCredential
|
||||
from models_provider.impl.siliconCloud_model_provider.credential.llm import SiliconCloudLLMModelCredential
|
||||
|
|
@ -19,6 +18,7 @@ from models_provider.impl.siliconCloud_model_provider.credential.reranker import
|
|||
from models_provider.impl.siliconCloud_model_provider.credential.stt import SiliconCloudSTTModelCredential
|
||||
from models_provider.impl.siliconCloud_model_provider.credential.tti import \
|
||||
SiliconCloudTextToImageModelCredential
|
||||
from models_provider.impl.siliconCloud_model_provider.credential.tts import SiliconCloudTTSModelCredential
|
||||
from models_provider.impl.siliconCloud_model_provider.model.embedding import SiliconCloudEmbeddingModel
|
||||
from models_provider.impl.siliconCloud_model_provider.model.llm import SiliconCloudChatModel
|
||||
from models_provider.impl.siliconCloud_model_provider.model.reranker import SiliconCloudReranker
|
||||
|
|
@ -32,6 +32,7 @@ openai_llm_model_credential = SiliconCloudLLMModelCredential()
|
|||
openai_stt_model_credential = SiliconCloudSTTModelCredential()
|
||||
openai_reranker_model_credential = SiliconCloudRerankerCredential()
|
||||
openai_tti_model_credential = SiliconCloudTextToImageModelCredential()
|
||||
openai_tts_model_credential = SiliconCloudTTSModelCredential()
|
||||
model_info_list = [
|
||||
ModelInfo('deepseek-ai/DeepSeek-R1-Distill-Llama-8B', '', ModelTypeConst.LLM,
|
||||
openai_llm_model_credential, SiliconCloudChatModel
|
||||
|
|
|
|||
Loading…
Reference in New Issue