bstraehle commited on
Commit
9e309bc
·
verified ·
1 Parent(s): d747e39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -144,6 +144,7 @@ def chat(message, history):
144
 
145
  return content_values[0]
146
 
 
147
  gr.ChatInterface(
148
  fn=chat,
149
  chatbot=gr.Chatbot(height=350),
@@ -159,4 +160,13 @@ gr.ChatInterface(
159
  [f"Execute: Today is {datetime.date.today()}. Create a plot showing stock gain YTD for NVDA, MSFT, AAPL, and GOOG, x-axis is 'Day' and y-axis is 'YTD Gain %'. Return the result, don't persist to storage."],
160
  ],
161
  cache_examples=False,
162
- ).launch()
 
 
 
 
 
 
 
 
 
 
144
 
145
  return content_values[0]
146
 
147
+ """
148
  gr.ChatInterface(
149
  fn=chat,
150
  chatbot=gr.Chatbot(height=350),
 
160
  [f"Execute: Today is {datetime.date.today()}. Create a plot showing stock gain YTD for NVDA, MSFT, AAPL, and GOOG, x-axis is 'Day' and y-axis is 'YTD Gain %'. Return the result, don't persist to storage."],
161
  ],
162
  cache_examples=False,
163
+ ).launch()
164
+ """
165
+
166
+ with gr.Blocks() as demo:
167
+ chatbot = gr.Chatbot()
168
+ msg = gr.Textbox()
169
+ clear = gr.ClearButton([msg, chatbot])
170
+ msg.submit(chat, [msg, chatbot], [msg, chatbot])
171
+
172
+ demo.launch()