sam-motamed commited on
Commit
bfe2ce5
Β·
verified Β·
1 Parent(s): 9743ceb

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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