rahul7star commited on
Commit
3c2a6ba
Β·
verified Β·
1 Parent(s): 3cb36d7

Update app_g.py

Browse files
Files changed (1) hide show
  1. app_g.py +14 -5
app_g.py CHANGED
@@ -12,7 +12,7 @@ from huggingface_hub import snapshot_download
12
 
13
  # === Setup Paths ===
14
  PUSA_ROOT = os.path.abspath("./PusaV1")
15
- MODEL_ZOO_DIR = os.path.join(PUSA_ROOT, "modelzoo")
16
  WAN_SUBFOLDER = "Wan2.1-T2V-14B"
17
  WAN_MODEL_PATH = os.path.join(MODEL_ZOO_DIR, WAN_SUBFOLDER)
18
  LORA_PATH = os.path.join(MODEL_ZOO_DIR, "pusa_v1.pt")
@@ -32,7 +32,7 @@ if not os.path.exists(DIFFSYNTH_PATH):
32
  # === Ensure model and weights are downloaded ===
33
  def ensure_model_downloaded():
34
  if not os.path.exists(MODEL_ZOO_DIR):
35
- print("Downloading RaphaelLiu/PusaV1 to ./PusaV1/modelzoo ...")
36
  snapshot_download(
37
  repo_id="RaphaelLiu/PusaV1",
38
  local_dir=MODEL_ZOO_DIR,
@@ -42,9 +42,9 @@ def ensure_model_downloaded():
42
  print("βœ… PusaV1 base model downloaded.")
43
 
44
  if not os.path.exists(WAN_MODEL_PATH):
45
- print("Downloading Wan-AI/Wan2.1-T2V-14B to ./PusaV1/modelzoo/Wan2.1-T2V-14B ...")
46
  snapshot_download(
47
- repo_id="Wan-AI/Wan2.1-T2V-14B-Diffusers", # Adjust if necessary
48
  local_dir=WAN_MODEL_PATH,
49
  repo_type="model",
50
  local_dir_use_symlinks=False,
@@ -57,6 +57,14 @@ def ensure_model_downloaded():
57
  f"Please ensure the file exists or is downloaded manually."
58
  )
59
 
 
 
 
 
 
 
 
 
60
 
61
 
62
  import gradio as gr
@@ -83,7 +91,8 @@ class PusaVideoDemo:
83
  self.multi_frames_pipe = None
84
  self.v2v_pipe = None
85
  self.t2v_pipe = None
86
- self.base_dir = "PusaV1/model_zoo/PusaV1/Wan2.1-T2V-14B"
 
87
  self.output_dir = "outputs"
88
  os.makedirs(self.output_dir, exist_ok=True)
89
 
 
12
 
13
  # === Setup Paths ===
14
  PUSA_ROOT = os.path.abspath("./PusaV1")
15
+ MODEL_ZOO_DIR = os.path.join(PUSA_ROOT, "model_zoo")
16
  WAN_SUBFOLDER = "Wan2.1-T2V-14B"
17
  WAN_MODEL_PATH = os.path.join(MODEL_ZOO_DIR, WAN_SUBFOLDER)
18
  LORA_PATH = os.path.join(MODEL_ZOO_DIR, "pusa_v1.pt")
 
32
  # === Ensure model and weights are downloaded ===
33
  def ensure_model_downloaded():
34
  if not os.path.exists(MODEL_ZOO_DIR):
35
+ print("Downloading RaphaelLiu/PusaV1 to ./PusaV1/model_zoo ...")
36
  snapshot_download(
37
  repo_id="RaphaelLiu/PusaV1",
38
  local_dir=MODEL_ZOO_DIR,
 
42
  print("βœ… PusaV1 base model downloaded.")
43
 
44
  if not os.path.exists(WAN_MODEL_PATH):
45
+ print("Downloading Wan-AI/Wan2.1-T2V-14B to ./PusaV1/model_zoo/Wan2.1-T2V-14B ...")
46
  snapshot_download(
47
+ repo_id="Wan-AI/Wan2.1-T2V-14B-Diffusers",
48
  local_dir=WAN_MODEL_PATH,
49
  repo_type="model",
50
  local_dir_use_symlinks=False,
 
57
  f"Please ensure the file exists or is downloaded manually."
58
  )
59
 
60
+ # βœ… Add this to list all files in modelzoo
61
+ print(f"\nπŸ“ Verifying files under: {MODEL_ZOO_DIR}\n")
62
+ for root, dirs, files in os.walk(MODEL_ZOO_DIR):
63
+ for file in files:
64
+ full_path = os.path.relpath(os.path.join(root, file), start=MODEL_ZOO_DIR)
65
+ print(" -", full_path)
66
+
67
+
68
 
69
 
70
  import gradio as gr
 
91
  self.multi_frames_pipe = None
92
  self.v2v_pipe = None
93
  self.t2v_pipe = None
94
+ self.base_dir = os.path.join("PusaV1", "model_zoo", "Wan2.1-T2V-14B")
95
+
96
  self.output_dir = "outputs"
97
  os.makedirs(self.output_dir, exist_ok=True)
98