Hannah commited on
Commit
074a8d0
·
1 Parent(s): e209b4b

Add app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -0
app.py ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import random
2
+
3
+ import gradio as gr
4
+
5
+ CSS = """
6
+ @import url('https://fonts.googleapis.com/css2?family=Cairo:wght@500&display=swap');
7
+
8
+ """
9
+
10
+ def random_response(message, history):
11
+ return random.choice(["الثالث بلديهما مواقعها", "بلا مع. وقد الخاسر"])
12
+
13
+
14
+ demo = gr.ChatInterface(
15
+ random_response,
16
+ title="ArabicGPT",
17
+ chatbot=gr.Chatbot(
18
+ rtl=True,
19
+ ),
20
+ textbox=gr.Textbox(
21
+ lines=1, placeholder="اكتب رسالتك هنا...", rtl=True, scale=7, autofocus=True
22
+ ),
23
+ theme=gr.themes.Soft(),
24
+ css=CSS,
25
+ submit_btn="ارسل",
26
+ stop_btn="توقف",
27
+ retry_btn="أعد المحاولة 🔄",
28
+ clear_btn="أمسح النقاش 🗑️",
29
+ undo_btn=None,
30
+ )
31
+
32
+ demo.queue().launch()