eeuuia commited on
Commit
db4bbd0
·
verified ·
1 Parent(s): e9eab63

Update api/ltx/ltx_utils.py

Browse files
Files changed (1) hide show
  1. api/ltx/ltx_utils.py +7 -2
api/ltx/ltx_utils.py CHANGED
@@ -75,17 +75,22 @@ def build_ltx_pipeline_on_cpu(config: Dict) -> Tuple[LTXVideoPipeline, Optional[
75
  t0 = time.perf_counter()
76
  logging.info("Building LTX pipeline on CPU...")
77
 
78
- ckpt_path = hf_hub_download(repo_id=LTX_REPO_ID, filename=self.config["checkpoint_path"], cache_dir=CACHE_DIR)
79
-
 
 
80
  if not ckpt_path.is_file():
81
  raise FileNotFoundError(f"Main checkpoint file not found: {ckpt_path}")
 
82
 
 
83
  with safe_open(ckpt_path, framework="pt") as f:
84
  metadata = f.metadata() or {}
85
  config_str = metadata.get("config", "{}")
86
  configs = json.loads(config_str)
87
  allowed_inference_steps = configs.get("allowed_inference_steps")
88
 
 
89
  vae = CausalVideoAutoencoder.from_pretrained(ckpt_path).to("cpu")
90
  transformer = Transformer3DModel.from_pretrained(ckpt_path).to("cpu")
91
  scheduler = RectifiedFlowScheduler.from_pretrained(ckpt_path)
 
75
  t0 = time.perf_counter()
76
  logging.info("Building LTX pipeline on CPU...")
77
 
78
+
79
+
80
+ ckpt_path = hf_hub_download(repo_id=LTX_REPO_ID, filename=config["checkpoint_path"], cache_dir=CACHE_DIR)
81
+
82
  if not ckpt_path.is_file():
83
  raise FileNotFoundError(f"Main checkpoint file not found: {ckpt_path}")
84
+
85
 
86
+
87
  with safe_open(ckpt_path, framework="pt") as f:
88
  metadata = f.metadata() or {}
89
  config_str = metadata.get("config", "{}")
90
  configs = json.loads(config_str)
91
  allowed_inference_steps = configs.get("allowed_inference_steps")
92
 
93
+
94
  vae = CausalVideoAutoencoder.from_pretrained(ckpt_path).to("cpu")
95
  transformer = Transformer3DModel.from_pretrained(ckpt_path).to("cpu")
96
  scheduler = RectifiedFlowScheduler.from_pretrained(ckpt_path)