Spaces:
PhilSpiel
/
Sleeping

PhilSpiel commited on
Commit
b765081
·
verified ·
1 Parent(s): 123946a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -138,13 +138,22 @@ with gr.Blocks(theme, css="""
138
  code_message = gr.Label(label="Status", elem_id="code_message")
139
 
140
  with gr.Tab("Chat"):
141
- chatbot = gr.Chatbot(label="Conversation", height=340) # Adjust the height as needed
142
- msg = gr.Textbox(
143
- label=f"Chat with {coach_name_short}",
144
- placeholder="Type your message here... (MAX: 1000 characters)",
145
- interactive=False
146
- )
147
- submit = gr.Button("Submit Message", interactive=False)
 
 
 
 
 
 
 
 
 
148
 
149
  def submit_code(code, access_granted):
150
  success, _, _, message = verify_code(code, access_granted)
 
138
  code_message = gr.Label(label="Status", elem_id="code_message")
139
 
140
  with gr.Tab("Chat"):
141
+ chatbot = gr.Chatbot(label="Conversation", height=340, autoscroll=True)
142
+ with gr.Row():
143
+ msg = gr.Textbox(
144
+ label=f"Chat with {coach_name_short}",
145
+ placeholder="Type your message here... (MAX: 1000 characters)",
146
+ interactive=False
147
+ )
148
+ submit = gr.Button("Submit Message", interactive=False, variant="primary", scale=0.15)
149
+
150
+ # In your predict function or wherever you handle the submit action
151
+ submit.click(
152
+ predict,
153
+ inputs=[msg, chatbot, access_granted],
154
+ outputs=[chatbot, msg],
155
+ scroll_to_output=True
156
+ )
157
 
158
  def submit_code(code, access_granted):
159
  success, _, _, message = verify_code(code, access_granted)