Download app.py from hmb/rtl-test: direct link, hf CLI and curl.
- Browser
- Download file 764 Bytes
-
https://huggingface.co/spaces/hmb/rtl-test/resolve/main/app.py
- Command line
-
hf download hf://spaces/hmb/rtl-test/app.py
-
curl -L -o app.py https://huggingface.co/spaces/hmb/rtl-test/resolve/main/app.py
764 Bytes
| 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=True, | |
| ), | |
| 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() | |