Update simple_app.py
Browse files- simple_app.py +7 -2
simple_app.py
CHANGED
|
@@ -15,7 +15,7 @@ snapshot_download(
|
|
| 15 |
repo_id="Wan-AI/Wan2.1-T2V-1.3B",
|
| 16 |
local_dir="./Wan2.1-T2V-1.3B"
|
| 17 |
)
|
| 18 |
-
|
| 19 |
def infer(prompt, progress=gr.Progress(track_tqdm=True)):
|
| 20 |
# Configuration:
|
| 21 |
total_process_steps = 11 # Total INFO messages expected
|
|
@@ -49,6 +49,9 @@ def infer(prompt, progress=gr.Progress(track_tqdm=True)):
|
|
| 49 |
"--prompt", prompt,
|
| 50 |
"--save_file", "generated_video.mp4"
|
| 51 |
]
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
process = subprocess.Popen(command,
|
| 54 |
stdout=subprocess.PIPE,
|
|
@@ -56,6 +59,8 @@ def infer(prompt, progress=gr.Progress(track_tqdm=True)):
|
|
| 56 |
text=True,
|
| 57 |
bufsize=1)
|
| 58 |
|
|
|
|
|
|
|
| 59 |
while True:
|
| 60 |
# Poll stdout with a 40ms timeout.
|
| 61 |
rlist, _, _ = select.select([process.stdout], [], [], 0.04)
|
|
@@ -145,7 +150,7 @@ def infer(prompt, progress=gr.Progress(track_tqdm=True)):
|
|
| 145 |
overall_bar.close()
|
| 146 |
|
| 147 |
if process.returncode == 0:
|
| 148 |
-
print("Command executed
|
| 149 |
return "generated_video.mp4"
|
| 150 |
else:
|
| 151 |
print("Error executing command.")
|
|
|
|
| 15 |
repo_id="Wan-AI/Wan2.1-T2V-1.3B",
|
| 16 |
local_dir="./Wan2.1-T2V-1.3B"
|
| 17 |
)
|
| 18 |
+
print("Model downloaded successfully.")
|
| 19 |
def infer(prompt, progress=gr.Progress(track_tqdm=True)):
|
| 20 |
# Configuration:
|
| 21 |
total_process_steps = 11 # Total INFO messages expected
|
|
|
|
| 49 |
"--prompt", prompt,
|
| 50 |
"--save_file", "generated_video.mp4"
|
| 51 |
]
|
| 52 |
+
print("Starting video generation process...")
|
| 53 |
+
|
| 54 |
+
|
| 55 |
|
| 56 |
process = subprocess.Popen(command,
|
| 57 |
stdout=subprocess.PIPE,
|
|
|
|
| 59 |
text=True,
|
| 60 |
bufsize=1)
|
| 61 |
|
| 62 |
+
print("Process started successfully.")
|
| 63 |
+
|
| 64 |
while True:
|
| 65 |
# Poll stdout with a 40ms timeout.
|
| 66 |
rlist, _, _ = select.select([process.stdout], [], [], 0.04)
|
|
|
|
| 150 |
overall_bar.close()
|
| 151 |
|
| 152 |
if process.returncode == 0:
|
| 153 |
+
print("Command executed successfullyg.")
|
| 154 |
return "generated_video.mp4"
|
| 155 |
else:
|
| 156 |
print("Error executing command.")
|