Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,21 +4,17 @@ from pathlib import Path
|
|
4 |
import argparse
|
5 |
import gradio as gr
|
6 |
|
7 |
-
# تشغيل سكربت التحميل إذا كنتِ تبغي تنفذيه هنا
|
8 |
-
os.system("chmod +x setup.sh && ./setup.sh")
|
9 |
-
|
10 |
# إعداد المسارات
|
11 |
sys.path.append(os.path.abspath("."))
|
12 |
|
13 |
-
# استيراد
|
14 |
from STT.sst import speech_to_text
|
15 |
from LLM.llm import generate_reply
|
16 |
from TTS_X.tts import generate_voice
|
17 |
from FantasyTalking.infer import load_models, main
|
18 |
|
19 |
-
# ثابتات
|
20 |
args_template = argparse.Namespace(
|
21 |
-
wan_model_dir="./wan", # افترضي إنك حملتيه هناك
|
22 |
fantasytalking_model_path="./fantasy/fantasytalking_model.ckpt",
|
23 |
wav2vec_model_dir="./wav2vec",
|
24 |
image_path="",
|
@@ -36,10 +32,10 @@ args_template = argparse.Namespace(
|
|
36 |
seed=1111
|
37 |
)
|
38 |
|
39 |
-
# تحميل النماذج
|
40 |
-
print("🚀 جاري تحميل
|
41 |
pipe, fantasytalking, wav2vec_processor, wav2vec = load_models(args_template)
|
42 |
-
print("✅ تم
|
43 |
|
44 |
def generate_video(image_path, audio_path, prompt, output_dir="./output"):
|
45 |
args = argparse.Namespace(
|
@@ -92,3 +88,4 @@ with gr.Blocks(title="🧠 صوتك يحرك صورة!") as demo:
|
|
92 |
outputs=[user_text, reply_text, reply_audio, video_output])
|
93 |
|
94 |
demo.launch(inbrowser=True, share=True)
|
|
|
|
4 |
import argparse
|
5 |
import gradio as gr
|
6 |
|
|
|
|
|
|
|
7 |
# إعداد المسارات
|
8 |
sys.path.append(os.path.abspath("."))
|
9 |
|
10 |
+
# استيراد الباقي
|
11 |
from STT.sst import speech_to_text
|
12 |
from LLM.llm import generate_reply
|
13 |
from TTS_X.tts import generate_voice
|
14 |
from FantasyTalking.infer import load_models, main
|
15 |
|
16 |
+
# ثابتات النموذج بدون Wan
|
17 |
args_template = argparse.Namespace(
|
|
|
18 |
fantasytalking_model_path="./fantasy/fantasytalking_model.ckpt",
|
19 |
wav2vec_model_dir="./wav2vec",
|
20 |
image_path="",
|
|
|
32 |
seed=1111
|
33 |
)
|
34 |
|
35 |
+
# تحميل النماذج (بدون Wan)
|
36 |
+
print("🚀 جاري تحميل FantasyTalking و Wav2Vec...")
|
37 |
pipe, fantasytalking, wav2vec_processor, wav2vec = load_models(args_template)
|
38 |
+
print("✅ تم التحميل!")
|
39 |
|
40 |
def generate_video(image_path, audio_path, prompt, output_dir="./output"):
|
41 |
args = argparse.Namespace(
|
|
|
88 |
outputs=[user_text, reply_text, reply_audio, video_output])
|
89 |
|
90 |
demo.launch(inbrowser=True, share=True)
|
91 |
+
|