Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -36,12 +36,8 @@ def respond(
|
|
36 |
for val in history:
|
37 |
if val[0] and val[1]:
|
38 |
messages.append({"Role": "user", "Content": val[0]})
|
39 |
-
pure_response = val[1].split("
|
40 |
messages.append({"Role": "assistant", "Content": pure_response})
|
41 |
-
if message in ["aaaaa", "bbbbb", "ccccc"]:
|
42 |
-
print("pure_response:" + pure_response)
|
43 |
-
print("val[0]:" + val[0])
|
44 |
-
print("val[1]" + val[1])
|
45 |
|
46 |
|
47 |
messages.append({"Role": "user", "Content": message})
|
@@ -60,8 +56,6 @@ def respond(
|
|
60 |
|
61 |
|
62 |
for event in completion:
|
63 |
-
if message in ["aaaaa", "bbbbb", "ccccc"]:
|
64 |
-
print(f"event:{event}")
|
65 |
if hasattr(event.choices[0].delta, 'reasoning_content'):
|
66 |
if is_reasoning_start:
|
67 |
response += '> **Start thinking**\n\n'
|
@@ -99,7 +93,7 @@ demo = gr.ChatInterface(respond,
|
|
99 |
title="Hunyuan T1",
|
100 |
examples=example_prompts,
|
101 |
chatbot=chatbot,
|
102 |
-
description="当前体验demo为非联网Hunyuan-T1
|
103 |
|
104 |
)
|
105 |
|
|
|
36 |
for val in history:
|
37 |
if val[0] and val[1]:
|
38 |
messages.append({"Role": "user", "Content": val[0]})
|
39 |
+
pure_response = val[1].split("**End thinking**")[-1].strip()
|
40 |
messages.append({"Role": "assistant", "Content": pure_response})
|
|
|
|
|
|
|
|
|
41 |
|
42 |
|
43 |
messages.append({"Role": "user", "Content": message})
|
|
|
56 |
|
57 |
|
58 |
for event in completion:
|
|
|
|
|
59 |
if hasattr(event.choices[0].delta, 'reasoning_content'):
|
60 |
if is_reasoning_start:
|
61 |
response += '> **Start thinking**\n\n'
|
|
|
93 |
title="Hunyuan T1",
|
94 |
examples=example_prompts,
|
95 |
chatbot=chatbot,
|
96 |
+
description="当前体验demo为非联网Hunyuan-T1 最新推理模型,完整版联网/非联网能力即将在元宝上线,敬请期待!</br>The current experience demo is the latest offline inference model of Hunyuan-T1. The full version with both online and offline capabilities will be launched on Tencent Yuanbao soon. Please look forward to it."
|
97 |
|
98 |
)
|
99 |
|