Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,27 +31,34 @@ def simulate_thinking_chat(message, history):
|
|
31 |
yield response
|
32 |
|
33 |
time.sleep(5.0)
|
34 |
-
|
35 |
response,
|
36 |
ChatMessage(
|
37 |
content="Based on my thoughts and analysis above, my response is: This dummy repro shows how thoughts of a thinking LLM can be progressively shown before providing its final answer."
|
38 |
)
|
39 |
]
|
40 |
yield response
|
41 |
-
|
42 |
-
response = ChatMessage(
|
43 |
-
|
44 |
-
|
45 |
-
yield response
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
-
|
51 |
simulate_thinking_chat,
|
52 |
title="Thinking LLM Chat Interface 🤔",
|
53 |
type="messages",
|
54 |
)
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
if __name__ == "__main__":
|
57 |
demo.launch()
|
|
|
31 |
yield response
|
32 |
|
33 |
time.sleep(5.0)
|
34 |
+
response = [
|
35 |
response,
|
36 |
ChatMessage(
|
37 |
content="Based on my thoughts and analysis above, my response is: This dummy repro shows how thoughts of a thinking LLM can be progressively shown before providing its final answer."
|
38 |
)
|
39 |
]
|
40 |
yield response
|
41 |
+
|
42 |
+
#response = ChatMessage(
|
43 |
+
# content="Based on my thoughts and analysis above, my response is: This dummy repro shows how thoughts of a thinking LLM can be progressively shown before providing its final answer."
|
44 |
+
# )
|
45 |
+
#yield response
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
+
demo1 = gr.ChatInterface(
|
51 |
simulate_thinking_chat,
|
52 |
title="Thinking LLM Chat Interface 🤔",
|
53 |
type="messages",
|
54 |
)
|
55 |
+
with gr.Blocks() as demo:
|
56 |
+
chat = gr.Chatbot()
|
57 |
+
with gr.Row():
|
58 |
+
text = gr.Textbox(scale=9)
|
59 |
+
btn = gr.Button(scale=1)
|
60 |
+
btn.click(simulate_thinking_chat, [text, chat], [chat]).then(lambda :gr.Textbox(value=""), [], text)
|
61 |
+
text.submit(simulate_thinking_chat, [text, chat], [chat]).then(lambda :gr.Textbox(value=""), [], text))
|
62 |
+
|
63 |
if __name__ == "__main__":
|
64 |
demo.launch()
|