Commit
·
1c4a55b
1
Parent(s):
1a2f974
rename
Browse files
app.py
CHANGED
|
@@ -46,11 +46,21 @@ def load_pipeline(dtype_str="bfloat16"):
|
|
| 46 |
# Set paths
|
| 47 |
model_base_path = repo_path
|
| 48 |
cogvideo_path = os.path.join(model_base_path, "CogVideoX-5b-I2V")
|
| 49 |
-
ef_net_path = os.path.join(
|
|
|
|
|
|
|
| 50 |
|
| 51 |
print(f"CogVideo path: {cogvideo_path}")
|
| 52 |
print(f"EF-Net path: {ef_net_path}")
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
# Load models
|
| 55 |
print("Loading tokenizer and text encoder...")
|
| 56 |
tokenizer = T5Tokenizer.from_pretrained(os.path.join(cogvideo_path, "tokenizer"))
|
|
@@ -73,9 +83,6 @@ def load_pipeline(dtype_str="bfloat16"):
|
|
| 73 |
|
| 74 |
# Load EF-Net
|
| 75 |
print(f"Loading EF-Net from {ef_net_path}...")
|
| 76 |
-
if not os.path.exists(ef_net_path):
|
| 77 |
-
raise FileNotFoundError(f"EF-Net weights not found at {ef_net_path}")
|
| 78 |
-
|
| 79 |
EF_Net_model = (
|
| 80 |
EF_Net(num_layers=4, downscale_coef=8, in_channels=2, num_attention_heads=48)
|
| 81 |
.requires_grad_(False)
|
|
|
|
| 46 |
# Set paths
|
| 47 |
model_base_path = repo_path
|
| 48 |
cogvideo_path = os.path.join(model_base_path, "CogVideoX-5b-I2V")
|
| 49 |
+
ef_net_path = os.path.join(
|
| 50 |
+
model_base_path, "EF_Net", "EF_Net.pt"
|
| 51 |
+
) # Changed from .pth to .pt
|
| 52 |
|
| 53 |
print(f"CogVideo path: {cogvideo_path}")
|
| 54 |
print(f"EF-Net path: {ef_net_path}")
|
| 55 |
|
| 56 |
+
# Verify the EF_Net file exists
|
| 57 |
+
if not os.path.exists(ef_net_path):
|
| 58 |
+
# Try to list files in the EF_Net directory to debug
|
| 59 |
+
ef_net_dir = os.path.join(model_base_path, "EF_Net")
|
| 60 |
+
if os.path.exists(ef_net_dir):
|
| 61 |
+
print(f"Files in EF_Net directory: {os.listdir(ef_net_dir)}")
|
| 62 |
+
raise FileNotFoundError(f"EF-Net weights not found at {ef_net_path}")
|
| 63 |
+
|
| 64 |
# Load models
|
| 65 |
print("Loading tokenizer and text encoder...")
|
| 66 |
tokenizer = T5Tokenizer.from_pretrained(os.path.join(cogvideo_path, "tokenizer"))
|
|
|
|
| 83 |
|
| 84 |
# Load EF-Net
|
| 85 |
print(f"Loading EF-Net from {ef_net_path}...")
|
|
|
|
|
|
|
|
|
|
| 86 |
EF_Net_model = (
|
| 87 |
EF_Net(num_layers=4, downscale_coef=8, in_channels=2, num_attention_heads=48)
|
| 88 |
.requires_grad_(False)
|