Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -203,8 +203,8 @@ def clear_chat():
|
|
| 203 |
return [], ""
|
| 204 |
|
| 205 |
# Gradio Interface
|
| 206 |
-
with gr.Blocks(theme='
|
| 207 |
-
gr.Image("Image.jpg", width=
|
| 208 |
gr.Markdown("# Mawared HR Assistant 2.6.4")
|
| 209 |
gr.Markdown('### Instructions')
|
| 210 |
gr.Markdown("Ask a question about MawaredHR and get a detailed answer, if you get an error try again with same prompt, its an Api issue and we are working on it π")
|
|
@@ -216,18 +216,25 @@ with gr.Blocks(theme='Hev832/Applio') as iface:
|
|
| 216 |
)
|
| 217 |
|
| 218 |
with gr.Row():
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
clear_button.click(
|
| 233 |
clear_chat,
|
|
|
|
| 203 |
return [], ""
|
| 204 |
|
| 205 |
# Gradio Interface
|
| 206 |
+
with gr.Blocks(theme='Yntec/HaleyCH_Theme_Orange_Green') as iface:
|
| 207 |
+
gr.Image("Image.jpg", width=750, height=250, show_label=False, show_download_button=False)
|
| 208 |
gr.Markdown("# Mawared HR Assistant 2.6.4")
|
| 209 |
gr.Markdown('### Instructions')
|
| 210 |
gr.Markdown("Ask a question about MawaredHR and get a detailed answer, if you get an error try again with same prompt, its an Api issue and we are working on it π")
|
|
|
|
| 216 |
)
|
| 217 |
|
| 218 |
with gr.Row():
|
| 219 |
+
with gr.Column(scale=20):
|
| 220 |
+
question_input = gr.Textbox(
|
| 221 |
+
label="Ask a question:",
|
| 222 |
+
placeholder="Type your question here...",
|
| 223 |
+
show_label=False
|
| 224 |
+
)
|
| 225 |
+
with gr.Column(scale=3):
|
| 226 |
+
send_button = gr.Button("Send", variant="primary")
|
| 227 |
+
with gr.Column(scale=2):
|
| 228 |
+
clear_button = gr.Button("Clear Chat")
|
| 229 |
|
| 230 |
+
# Handle both submit events (Enter key and Send button)
|
| 231 |
+
submit_events = [question_input.submit, send_button.click]
|
| 232 |
+
for submit_event in submit_events:
|
| 233 |
+
submit_event(
|
| 234 |
+
ask_question_gradio,
|
| 235 |
+
inputs=[question_input, chatbot],
|
| 236 |
+
outputs=[question_input, chatbot]
|
| 237 |
+
)
|
| 238 |
|
| 239 |
clear_button.click(
|
| 240 |
clear_chat,
|