File size: 852 Bytes
db0ea86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from inference import evo_suggest

with gr.Blocks(css="body { direction: rtl; text-align: right; }") as demo:
    gr.Markdown("<h1>🤖 مساعد الحكومة الذكي – تجديد جواز السفر</h1>")
    
    question = gr.Textbox(label="سؤالك", value="كيف أجدد جواز سفري؟")
    option1 = gr.Textbox(label="الخيار ١", value="املأ النموذج عبر الإنترنت وادفع الرسوم")
    option2 = gr.Textbox(label="الخيار ٢", value="انتظر حتى تنتهي صلاحيته ثم اتصل بالشرطة")

    output = gr.Textbox(label="اقتراح Evo")

    def compare(q, o1, o2):
        return evo_suggest(q, o1, o2)

    compare_btn = gr.Button("قارن")
    compare_btn.click(compare, inputs=[question, option1, option2], outputs=output)

demo.launch()