Upload app.py
Browse files
app.py
CHANGED
|
@@ -52,8 +52,10 @@ NEG_PROMPT = (
|
|
| 52 |
# ββ model loading (once at startup, lives in CPU RAM between GPU requests) βββββ
|
| 53 |
print("Loading VOID pipeline β¦")
|
| 54 |
|
|
|
|
|
|
|
| 55 |
# Download base model to local cache (custom from_pretrained needs a local path)
|
| 56 |
-
base_model_path = snapshot_download(repo_id=BASE_MODEL_ID)
|
| 57 |
|
| 58 |
transformer = CogVideoXTransformer3DModel.from_pretrained(
|
| 59 |
base_model_path,
|
|
@@ -65,7 +67,7 @@ transformer = CogVideoXTransformer3DModel.from_pretrained(
|
|
| 65 |
).to(WEIGHT_DTYPE)
|
| 66 |
|
| 67 |
# Load VOID Pass-1 checkpoint
|
| 68 |
-
ckpt_path = hf_hub_download(repo_id=VOID_MODEL_ID, filename=VOID_CKPT_FILE)
|
| 69 |
state_dict = load_file(ckpt_path)
|
| 70 |
state_dict = state_dict.get("state_dict", state_dict)
|
| 71 |
|
|
|
|
| 52 |
# ββ model loading (once at startup, lives in CPU RAM between GPU requests) βββββ
|
| 53 |
print("Loading VOID pipeline β¦")
|
| 54 |
|
| 55 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 56 |
+
|
| 57 |
# Download base model to local cache (custom from_pretrained needs a local path)
|
| 58 |
+
base_model_path = snapshot_download(repo_id=BASE_MODEL_ID, token=HF_TOKEN)
|
| 59 |
|
| 60 |
transformer = CogVideoXTransformer3DModel.from_pretrained(
|
| 61 |
base_model_path,
|
|
|
|
| 67 |
).to(WEIGHT_DTYPE)
|
| 68 |
|
| 69 |
# Load VOID Pass-1 checkpoint
|
| 70 |
+
ckpt_path = hf_hub_download(repo_id=VOID_MODEL_ID, filename=VOID_CKPT_FILE, token=HF_TOKEN)
|
| 71 |
state_dict = load_file(ckpt_path)
|
| 72 |
state_dict = state_dict.get("state_dict", state_dict)
|
| 73 |
|