File size: 765 Bytes
074a8d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1e68d1
074a8d0
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import random

import gradio as gr

CSS = """
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@500&display=swap');

"""

def random_response(message, history):
    return random.choice(["الثالث بلديهما مواقعها", "بلا مع. وقد الخاسر"])


demo = gr.ChatInterface(
    random_response,
    title="ArabicGPT",
    chatbot=gr.Chatbot(
        rtl=False,
    ),
    textbox=gr.Textbox(
        lines=1, placeholder="اكتب رسالتك هنا...", rtl=True, scale=7, autofocus=True
    ),
    theme=gr.themes.Soft(),
    css=CSS,
    submit_btn="ارسل",
    stop_btn="توقف",
    retry_btn="أعد المحاولة 🔄",
    clear_btn="أمسح النقاش 🗑️",
    undo_btn=None,
)

demo.queue().launch()