Spaces:
Sleeping
Sleeping
MohammedNasser
commited on
Commit
•
1a197f9
1
Parent(s):
bfd30d8
Update app.py
Browse files
app.py
CHANGED
@@ -260,7 +260,7 @@ def chat(user_input):
|
|
260 |
|
261 |
with gr.Blocks(css=custom_css) as demo:
|
262 |
with gr.Row():
|
263 |
-
gr.Markdown("<h2 style='text-align: center; color: #00000;'>المساعد العربي للدردشة
|
264 |
|
265 |
with gr.Row():
|
266 |
pdf_input = gr.File(label="اختر ملف PDF")
|
@@ -271,7 +271,8 @@ with gr.Blocks(css=custom_css) as demo:
|
|
271 |
with gr.Row():
|
272 |
with gr.Column(scale=3):
|
273 |
chatbot = gr.Chatbot(label="الشات", elem_classes="arabic-chatbox", height=400, rtl=True, layout='bubble', bubble_full_width=False)
|
274 |
-
|
|
|
275 |
with gr.Row():
|
276 |
chat_input = gr.Textbox(label="💬", rtl=True, visible=False, placeholder="أدخل سؤالك هنا ..", elem_id="inputbox", lines=2)
|
277 |
#chat_output = gr.Textbox(label="الرد الآلي 🤖", rtl=True, visible=False)
|
@@ -315,7 +316,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
315 |
submit_button_pdf.click(process_pdf_and_enable_components, inputs=pdf_input, outputs=[output_label, submit_button_chat, submit_button_pdf, chatbot, chat_input, audio_output, clear_btn])
|
316 |
clear_btn.click(clear_chat, outputs=[chat_input, audio_output])
|
317 |
# Chat button connection
|
318 |
-
submit_button_chat.click(chat, inputs=chat_input, outputs=[
|
319 |
|
320 |
|
321 |
# Launch the Gradio app
|
|
|
260 |
|
261 |
with gr.Blocks(css=custom_css) as demo:
|
262 |
with gr.Row():
|
263 |
+
gr.Markdown("<h2 style='text-align: center; color: #00000;'>المساعد العربي ar-pdf-chat للدردشة </h2>", rtl=True)
|
264 |
|
265 |
with gr.Row():
|
266 |
pdf_input = gr.File(label="اختر ملف PDF")
|
|
|
271 |
with gr.Row():
|
272 |
with gr.Column(scale=3):
|
273 |
chatbot = gr.Chatbot(label="الشات", elem_classes="arabic-chatbox", height=400, rtl=True, layout='bubble', bubble_full_width=False)
|
274 |
+
with gr.Row():
|
275 |
+
chat_label = gr.HTML(value='')
|
276 |
with gr.Row():
|
277 |
chat_input = gr.Textbox(label="💬", rtl=True, visible=False, placeholder="أدخل سؤالك هنا ..", elem_id="inputbox", lines=2)
|
278 |
#chat_output = gr.Textbox(label="الرد الآلي 🤖", rtl=True, visible=False)
|
|
|
316 |
submit_button_pdf.click(process_pdf_and_enable_components, inputs=pdf_input, outputs=[output_label, submit_button_chat, submit_button_pdf, chatbot, chat_input, audio_output, clear_btn])
|
317 |
clear_btn.click(clear_chat, outputs=[chat_input, audio_output])
|
318 |
# Chat button connection
|
319 |
+
submit_button_chat.click(chat, inputs=chat_input, outputs=[chat_label, chatbot, audio_output])
|
320 |
|
321 |
|
322 |
# Launch the Gradio app
|