CosmoAI commited on
Commit
f03da32
·
1 Parent(s): b7dba00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -12
app.py CHANGED
@@ -33,6 +33,14 @@ def bardChat(data):
33
 
34
  def responsenew(data):
35
  return bardChat(data)
 
 
 
 
 
 
 
 
36
 
37
  # remind_val = ["create a reminder", "create reminder", "remind me"]
38
  # if remind_val in data:
@@ -40,18 +48,18 @@ def responsenew(data):
40
  # else:
41
  # return bardChat(data)
42
 
43
- with gr.Blocks() as demo:
44
- chatbot = gr.Chatbot()
45
- msg = gr.Textbox()
46
- clear = gr.ClearButton([msg, chatbot])
47
 
48
- def respond(message, chat_history):
49
- bot_message = responsenew(message)
50
- chat_history.append((message, bot_message))
51
- time.sleep(2)
52
- return "", chat_history
53
 
54
- msg.submit(respond, [msg, chatbot], [msg, chatbot])
55
 
56
- if __name__ == "__main__":
57
- demo.launch()
 
33
 
34
  def responsenew(data):
35
  return bardChat(data)
36
+
37
+
38
+ gradio_interface = gradio.Interface(
39
+ fn = responsenew,
40
+ inputs = "text",
41
+ outputs = "text"
42
+ )
43
+ gradio_interface.launch()
44
 
45
  # remind_val = ["create a reminder", "create reminder", "remind me"]
46
  # if remind_val in data:
 
48
  # else:
49
  # return bardChat(data)
50
 
51
+ # with gr.Blocks() as demo:
52
+ # chatbot = gr.Chatbot()
53
+ # msg = gr.Textbox()
54
+ # clear = gr.ClearButton([msg, chatbot])
55
 
56
+ # def respond(message, chat_history):
57
+ # bot_message = responsenew(message)
58
+ # chat_history.append((message, bot_message))
59
+ # time.sleep(2)
60
+ # return "", chat_history
61
 
62
+ # msg.submit(respond, [msg, chatbot], [msg, chatbot])
63
 
64
+ # if __name__ == "__main__":
65
+ # demo.launch()