rahul7star commited on
Commit
65b5bb7
·
verified ·
1 Parent(s): 1bf3e32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -2,9 +2,9 @@ import spaces
2
  import os
3
  import subprocess
4
  import tempfile
 
5
  from huggingface_hub import snapshot_download
6
  import gradio as gr
7
- import glob
8
 
9
  # ---------------- Step 1: Download Model ----------------
10
  repo_id = "Wan-AI/Wan2.2-TI2V-5B"
@@ -21,12 +21,12 @@ def get_duration(prompt, size, duration_seconds, steps):
21
  h, w = 704, 1280
22
  return int(duration_seconds) * int(steps) * 2.25 + 5
23
 
24
- # Helper to find the most recent .mp4 file in cwd
25
- def find_latest_mp4(search_path="."):
26
- mp4_files = glob.glob(os.path.join(search_path, "*.mp4"))
27
- if not mp4_files:
28
  return None
29
- latest_file = max(mp4_files, key=os.path.getmtime)
30
  return latest_file
31
 
32
  # ---------------- Step 3: Generation Functions ----------------
 
2
  import os
3
  import subprocess
4
  import tempfile
5
+ import glob
6
  from huggingface_hub import snapshot_download
7
  import gradio as gr
 
8
 
9
  # ---------------- Step 1: Download Model ----------------
10
  repo_id = "Wan-AI/Wan2.2-TI2V-5B"
 
21
  h, w = 704, 1280
22
  return int(duration_seconds) * int(steps) * 2.25 + 5
23
 
24
+ # ---------------- Helper: Find latest .mp4 in cwd ----------------
25
+ def find_latest_mp4():
26
+ files = glob.glob("*.mp4")
27
+ if not files:
28
  return None
29
+ latest_file = max(files, key=os.path.getctime)
30
  return latest_file
31
 
32
  # ---------------- Step 3: Generation Functions ----------------