Spaces:
Running
Running
* Behavior Change:
Browse files- Only CoT can be edited now - to reduce confusion
- Cognitive parameters only applies to CoT
This is meant to be an experimental interface focusing on co-thinking with reasoning model, not a full-spec interface. We recommend other open source LLM frontend (e.g. open-webui) for complex cases for now.
app.py
CHANGED
@@ -20,9 +20,7 @@ class AppConfig:
|
|
20 |
DEFAULT_THROUGHPUT = 10
|
21 |
SYNC_THRESHOLD_DEFAULT = 0
|
22 |
API_TIMEOUT = 20
|
23 |
-
|
24 |
-
"✅ Ready! <br> Think together with AI. Use Shift+Enter to toggle generation"
|
25 |
-
)
|
26 |
|
27 |
|
28 |
class DynamicState:
|
@@ -185,7 +183,7 @@ class ConvoState:
|
|
185 |
)
|
186 |
for chunk in response_stream:
|
187 |
chunk_content = chunk.choices[0].delta.content
|
188 |
-
if coordinator.should_pause_for_human(full_response):
|
189 |
dynamic_state.should_stream = False
|
190 |
if not dynamic_state.should_stream:
|
191 |
break
|
@@ -211,7 +209,7 @@ class ConvoState:
|
|
211 |
else lang_data["loading_output"]
|
212 |
)
|
213 |
editor_label = f"{lang_data['editor_label']} - {status}"
|
214 |
-
yield
|
215 |
label=editor_label
|
216 |
), self.flatten_output()
|
217 |
|
@@ -219,7 +217,7 @@ class ConvoState:
|
|
219 |
start_time = time.time()
|
220 |
while (
|
221 |
time.time() - start_time
|
222 |
-
) < interval and dynamic_state.should_stream:
|
223 |
time.sleep(0.005)
|
224 |
|
225 |
except Exception as e:
|
@@ -247,9 +245,9 @@ class ConvoState:
|
|
247 |
)
|
248 |
editor_label = f"{lang_data['editor_label']} - {final_status}"
|
249 |
if not self.is_error:
|
250 |
-
yield
|
251 |
else:
|
252 |
-
yield
|
253 |
{
|
254 |
"role": "assistant",
|
255 |
"content": error_msg,
|
|
|
20 |
DEFAULT_THROUGHPUT = 10
|
21 |
SYNC_THRESHOLD_DEFAULT = 0
|
22 |
API_TIMEOUT = 20
|
23 |
+
|
|
|
|
|
24 |
|
25 |
|
26 |
class DynamicState:
|
|
|
183 |
)
|
184 |
for chunk in response_stream:
|
185 |
chunk_content = chunk.choices[0].delta.content
|
186 |
+
if coordinator.should_pause_for_human(full_response) and dynamic_state.in_cot:
|
187 |
dynamic_state.should_stream = False
|
188 |
if not dynamic_state.should_stream:
|
189 |
break
|
|
|
209 |
else lang_data["loading_output"]
|
210 |
)
|
211 |
editor_label = f"{lang_data['editor_label']} - {status}"
|
212 |
+
yield self.current["cot"] + ("</think>" if think_complete else ""), gr.update(
|
213 |
label=editor_label
|
214 |
), self.flatten_output()
|
215 |
|
|
|
217 |
start_time = time.time()
|
218 |
while (
|
219 |
time.time() - start_time
|
220 |
+
) < interval and dynamic_state.should_stream and dynamic_state.in_cot:
|
221 |
time.sleep(0.005)
|
222 |
|
223 |
except Exception as e:
|
|
|
245 |
)
|
246 |
editor_label = f"{lang_data['editor_label']} - {final_status}"
|
247 |
if not self.is_error:
|
248 |
+
yield self.current["cot"] + ("</think>" if not dynamic_state.in_cot else ""), gr.update(label=editor_label), self.flatten_output()
|
249 |
else:
|
250 |
+
yield self.current["cot"] + ("</think>" if not dynamic_state.in_cot else ""), gr.update(label=editor_label_error), self.flatten_output() + [
|
251 |
{
|
252 |
"role": "assistant",
|
253 |
"content": error_msg,
|
lang.py
CHANGED
@@ -14,7 +14,7 @@ LANGUAGE_CONFIG = {
|
|
14 |
"throughput_info": "Tokens/s - 5:Learn, 10:Follow, 50:Skim",
|
15 |
"language_label": "Language",
|
16 |
"loading_thinking": "🤖 AI Thinking ↓ Shift+Enter to Pause",
|
17 |
-
"loading_output": "🖨️ Result Writing
|
18 |
"interrupted": "🤔 Pause, Human thinking time - **EDIT THOUGHTS BELOW**",
|
19 |
"completed": "✅ Completed → Check overview",
|
20 |
"error": "Error",
|
@@ -51,8 +51,8 @@ LANGUAGE_CONFIG = {
|
|
51 |
"throughput_label": "⏱ 同步思考速度",
|
52 |
"throughput_info": "词元/秒 - 5:学习, 10:跟读, 50:跳读",
|
53 |
"language_label": "界面语言",
|
54 |
-
"loading_thinking": "🤖 AI
|
55 |
-
"loading_output": "🖨️
|
56 |
"interrupted": "🤔 暂停,人类思考回合 **下面的思考过程可以编辑**",
|
57 |
"completed": "✅ 已完成 → 查看完整对话",
|
58 |
"error": "错误",
|
|
|
14 |
"throughput_info": "Tokens/s - 5:Learn, 10:Follow, 50:Skim",
|
15 |
"language_label": "Language",
|
16 |
"loading_thinking": "🤖 AI Thinking ↓ Shift+Enter to Pause",
|
17 |
+
"loading_output": "🖨️ Result Writing → (Pause & submit to reroll the result)",
|
18 |
"interrupted": "🤔 Pause, Human thinking time - **EDIT THOUGHTS BELOW**",
|
19 |
"completed": "✅ Completed → Check overview",
|
20 |
"error": "Error",
|
|
|
51 |
"throughput_label": "⏱ 同步思考速度",
|
52 |
"throughput_info": "词元/秒 - 5:学习, 10:跟读, 50:跳读",
|
53 |
"language_label": "界面语言",
|
54 |
+
"loading_thinking": "🤖 AI思考中 ↓ Shift+Enter可暂停",
|
55 |
+
"loading_output": "🖨️ 结果输出中 → (暂停再提交会重新生成结果部分)",
|
56 |
"interrupted": "🤔 暂停,人类思考回合 **下面的思考过程可以编辑**",
|
57 |
"completed": "✅ 已完成 → 查看完整对话",
|
58 |
"error": "错误",
|