|
|
import gradio as gr |
|
|
|
|
|
|
|
|
destinations = { |
|
|
"بارد": {"name": "أبها", "image": "https://example.com/abha.jpg"}, |
|
|
"شاطئ": {"name": "الشرقية", "image": "https://example.com/eastern_province.jpg"} |
|
|
} |
|
|
|
|
|
def recommend_destination(weather_preference): |
|
|
if weather_preference in destinations: |
|
|
destination = destinations[weather_preference] |
|
|
return destination["name"], destination["image"] |
|
|
else: |
|
|
return "لم يتم العثور على وجهة سياحية.", None |
|
|
|
|
|
iface = gr.Interface( |
|
|
fn=recommend_destination, |
|
|
inputs=gr.Radio(["بارد", "شاطئ"], label="اختر نوع الطقس المفضل"), |
|
|
outputs=["text", "image"], |
|
|
title="توصية أماكن سياحية", |
|
|
description="نساعدك لاختيار أفضل وجهة سياحية بناءً على تفضيلات الطقس." |
|
|
) |
|
|
|
|
|
iface.launch() |
|
|
|