从新提交到gitee 仓库

This commit is contained in:
qcloud
2025-02-06 23:34:26 +08:00
parent e678819f70
commit c88312a914
62 changed files with 211935 additions and 7500 deletions

View File

@@ -140,6 +140,7 @@ class TenantLLMService(CommonService):
if llm_type == LLMType.TTS:
if model_config["llm_factory"] not in TTSModel:
return
# 初始化 tts model cyx
return TTSModel[model_config["llm_factory"]](
model_config["api_key"],
model_config["llm_name"],
@@ -201,6 +202,8 @@ class LLMBundle(object):
assert self.mdl, "Can't find model for {}/{}/{}".format(
tenant_id, llm_type, llm_name)
self.max_length = 8192
if llm_type == LLMType.TTS:
logging.info(f"dale--TTS model {tenant_id} {llm_type} {llm_name}")
for lm in LLMService.query(llm_name=llm_name):
self.max_length = lm.max_tokens
break
@@ -245,7 +248,7 @@ class LLMBundle(object):
"LLMBundle.transcription can't update token usage for {}/SEQUENCE2TXT used_tokens: {}".format(self.tenant_id, used_tokens))
return txt
def tts(self, text):
def tts(self, text): # tts 调用 cyx
for chunk in self.mdl.tts(text):
if isinstance(chunk,int):
if not TenantLLMService.increase_usage(
@@ -253,7 +256,10 @@ class LLMBundle(object):
logging.error(
"LLMBundle.tts can't update token usage for {}/TTS".format(self.tenant_id))
return
yield chunk
yield chunk
def end_tts(self): # 结束 tts流式 调用 cyx
self.mdl.end_tts()
def chat(self, system, history, gen_conf):
txt, used_tokens = self.mdl.chat(system, history, gen_conf)