Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import transformers
|
|
2 |
import gradio as gr
|
3 |
import git
|
4 |
import os
|
5 |
-
from gradio import rtl
|
6 |
os.system("pip install --upgrade pip")
|
7 |
|
8 |
#Load arabert preprocessor
|
@@ -41,8 +40,8 @@ def generate_response(text, minimum_length, p, temperature):
|
|
41 |
with gr.Blocks() as demo:
|
42 |
|
43 |
gr.Markdown("Empathetic Response Generation in Arabic")
|
44 |
-
chatbot = gr.Chatbot().style(height=400)
|
45 |
-
msg = gr.Textbox(placeholder="Send a message",show_label=False).style(container=False)
|
46 |
with gr.Column():
|
47 |
output_slider=gr.Slider(5, 20, step=1, label='Minimum Output Length')
|
48 |
top_p_slider=gr.Slider(0.7, 1, step=0.1, label='Top-P')
|
@@ -54,5 +53,5 @@ with gr.Blocks() as demo:
|
|
54 |
clear = gr.Button("Clear Chat")
|
55 |
msg.submit(respond, [msg, chatbot,output_slider,top_p_slider,temperature_slider], [msg, chatbot])
|
56 |
clear.click(lambda: None, None, chatbot, queue=False)
|
57 |
-
|
58 |
demo.launch()
|
|
|
2 |
import gradio as gr
|
3 |
import git
|
4 |
import os
|
|
|
5 |
os.system("pip install --upgrade pip")
|
6 |
|
7 |
#Load arabert preprocessor
|
|
|
40 |
with gr.Blocks() as demo:
|
41 |
|
42 |
gr.Markdown("Empathetic Response Generation in Arabic")
|
43 |
+
chatbot = gr.Chatbot(rtl=True).style(height=400)
|
44 |
+
msg = gr.Textbox(placeholder="Send a message",show_label=False,rtl=True).style(container=False)
|
45 |
with gr.Column():
|
46 |
output_slider=gr.Slider(5, 20, step=1, label='Minimum Output Length')
|
47 |
top_p_slider=gr.Slider(0.7, 1, step=0.1, label='Top-P')
|
|
|
53 |
clear = gr.Button("Clear Chat")
|
54 |
msg.submit(respond, [msg, chatbot,output_slider,top_p_slider,temperature_slider], [msg, chatbot])
|
55 |
clear.click(lambda: None, None, chatbot, queue=False)
|
56 |
+
|
57 |
demo.launch()
|