Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|