Spaces:
Running
Running
Upload 2 files
Browse files- app.py +29 -0
- requirements.txt +2 -0
app.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
# تعريف الروابط وأسماء التبويبات لتنظيم الكود
|
| 4 |
+
# (الاسم الذي سيظهر في التبويب, رابط الـ Space الأصلي)
|
| 5 |
+
spaces_list = [
|
| 6 |
+
("Wan2.2 Faster", "dream2589632147/Dream-wan2-2-faster-Pro"),
|
| 7 |
+
("Qwen Image Edit", "dream2589632147/Dream-Qwen-Image-Edit-Angles"),
|
| 8 |
+
("Audio Separator", "dream2589632147/Dream-Audio_separator-pro"),
|
| 9 |
+
("Video BG Removal", "dream2589632147/Dream-video-background-removal"),
|
| 10 |
+
("F-E Farm", "dream2589632147/Dream-F-E-farm"),
|
| 11 |
+
("Video Enhancer 4K", "dream2589632147/Dream-AI_Video_Enhancer_4K"),
|
| 12 |
+
]
|
| 13 |
+
|
| 14 |
+
with gr.Blocks(theme=gr.themes.Soft(), title="Dream AI Studio Pro") as demo:
|
| 15 |
+
gr.Markdown("# 🚀 Dream AI Studio Pro \n مجموعة أدوات الذكاء الاصطناعي الشاملة")
|
| 16 |
+
|
| 17 |
+
# إنشاء تبويب لكل أداة
|
| 18 |
+
for tab_name, space_id in spaces_list:
|
| 19 |
+
with gr.Tab(tab_name):
|
| 20 |
+
try:
|
| 21 |
+
# محاولة تحميل الـ Space كواجهة Gradio أصلية
|
| 22 |
+
gr.load(name=space_id, src="spaces")
|
| 23 |
+
except Exception as e:
|
| 24 |
+
# في حال فشل التحميل (أحياناً يحدث مع أدوات معقدة)، نستخدم التضمين كبديل
|
| 25 |
+
gr.Markdown(f"⚠️ تعذر التحميل المباشر لـ {tab_name}، يتم العرض عبر Iframe:")
|
| 26 |
+
gr.HTML(f"""<iframe src="https://huggingface.co/spaces/{space_id}" width="100%" height="800px" frameborder="0"></iframe>""")
|
| 27 |
+
|
| 28 |
+
# تشغيل التطبيق
|
| 29 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio>=4.0.0
|
| 2 |
+
huggingface_hub
|