debug backend API for TAB 'search' (#2389)

### What problem does this PR solve?
#2247

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Kevin Hu
2024-09-12 17:51:20 +08:00
committed by GitHub
parent 68d0210e92
commit 4730145696
6 changed files with 30 additions and 20 deletions

View File

@ -218,7 +218,7 @@ def chat(dialog, messages, stream=True, **kwargs):
for ans in chat_mdl.chat_streamly(prompt, msg[1:], gen_conf):
answer = ans
delta_ans = ans[len(last_ans):]
if num_tokens_from_string(delta_ans) < 12:
if num_tokens_from_string(delta_ans) < 16:
continue
last_ans = answer
yield {"answer": answer, "reference": {}, "audio_binary": tts(tts_mdl, delta_ans)}
@ -404,7 +404,6 @@ def rewrite(tenant_id, llm_id, question):
def tts(tts_mdl, text):
return
if not tts_mdl or not text: return
bin = b""
for chunk in tts_mdl.tts(text):