CognitiveScience commited on
Commit
3fa32a1
1 Parent(s): 069fab3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -16
app.py CHANGED
@@ -111,14 +111,20 @@ def respond3(message, chat_history):
111
  return "", chat_history
112
 
113
  with gr.Blocks() as demo:
114
- #with gr.Row():
115
- # with gr.Column():
 
 
 
 
116
  #cschatbot = gr.Chatbot()
117
  #csinp = gr.Textbox()
118
  #csout=cs(csinp)
119
  #csclear = gr.ClearButton([csinp, cschatbot])
120
 
121
  #csinp.submit(cs, [csinp, cschatbot], [csinp, cschatbot])
 
 
122
 
123
  with gr.Row():
124
  with gr.Column():
@@ -139,20 +145,6 @@ with gr.Blocks() as demo:
139
  return "", chat_history
140
 
141
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
142
-
143
- with gr.Column():
144
- chatbot2 = gr.Chatbot()
145
- msg2 = gr.Textbox()
146
- clear2 = gr.ClearButton([msg2, chatbot2])
147
-
148
- def respond2(message):
149
- bot_message = "hii" + message #random.choice(["How are you?", "I love you", "I'm very hungry"])
150
- chat_history.append((message, bot_message))
151
- time.sleep(2)
152
-
153
- return bot_message #"", chat_history
154
-
155
- msg2.submit(respond2, "text", "text")
156
 
157
  with gr.Column():
158
  submitsave = gr.Button(value="Save")
 
111
  return "", chat_history
112
 
113
  with gr.Blocks() as demo:
114
+ with gr.Row():
115
+ with gr.Column():
116
+ name = gr.Textbox(label="Name", placeholder="ur name?")
117
+ review = gr.Radio(label="How satisfied are you with your pick?", choices=[1, 2, 3, 4, 5, 6])
118
+ comments = gr.Textbox(label="Comments0", lines=10, placeholder="comm?")
119
+ submit = gr.Button(value="Submit Choice")
120
  #cschatbot = gr.Chatbot()
121
  #csinp = gr.Textbox()
122
  #csout=cs(csinp)
123
  #csclear = gr.ClearButton([csinp, cschatbot])
124
 
125
  #csinp.submit(cs, [csinp, cschatbot], [csinp, cschatbot])
126
+ submit.click(add_review, [name, review, comments], [data, count])
127
+
128
 
129
  with gr.Row():
130
  with gr.Column():
 
145
  return "", chat_history
146
 
147
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
  with gr.Column():
150
  submitsave = gr.Button(value="Save")