Spaces:
Sleeping
Sleeping
Commit
·
56d8eb0
1
Parent(s):
8f252c6
app.py
CHANGED
@@ -9,11 +9,32 @@ def chat(message, history):
|
|
9 |
else:
|
10 |
return "Please ask about Python or JavaScript.", None
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
with gr.Blocks() as demo:
|
13 |
code = gr.Code(render=False)
|
|
|
14 |
|
15 |
with gr.Row():
|
16 |
-
|
17 |
gr.ChatInterface(
|
18 |
chat,
|
19 |
textbox=text,
|
@@ -25,4 +46,8 @@ with gr.Blocks() as demo:
|
|
25 |
with gr.Row():
|
26 |
code.render()
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
9 |
else:
|
10 |
return "Please ask about Python or JavaScript.", None
|
11 |
|
12 |
+
|
13 |
+
history = [
|
14 |
+
{"role": "assistant", "content": "I am happy to provide you that report and plot."},
|
15 |
+
#{"role": "assistant", "content": gr.Plot(value=make_plot_from_file('quaterly_sales.txt'))}
|
16 |
+
]
|
17 |
+
|
18 |
+
with gr.Blocks() as demo:
|
19 |
+
|
20 |
+
code = gr.Code(render=False)
|
21 |
+
|
22 |
+
with gr.Row():
|
23 |
+
gr.Chatbot(history, label="LLM output", type="messages")
|
24 |
+
|
25 |
+
with gr.Row():
|
26 |
+
code.render()
|
27 |
+
|
28 |
+
demo.launch()
|
29 |
+
|
30 |
+
|
31 |
+
'''
|
32 |
with gr.Blocks() as demo:
|
33 |
code = gr.Code(render=False)
|
34 |
+
text = gr.Textbox(render=False)
|
35 |
|
36 |
with gr.Row():
|
37 |
+
|
38 |
gr.ChatInterface(
|
39 |
chat,
|
40 |
textbox=text,
|
|
|
46 |
with gr.Row():
|
47 |
code.render()
|
48 |
|
49 |
+
with gr.Row():
|
50 |
+
text.render()
|
51 |
+
|
52 |
+
demo.launch()
|
53 |
+
'''
|