Spaces:
Paused
Paused
Update video_service.py
Browse files- video_service.py +2 -4
video_service.py
CHANGED
|
@@ -261,12 +261,10 @@ class VideoService:
|
|
| 261 |
return yaml.safe_load(file)
|
| 262 |
|
| 263 |
def _load_models(self):
|
| 264 |
-
models_dir = "downloaded_models_gradio"
|
| 265 |
-
Path(models_dir).mkdir(parents=True, exist_ok=True)
|
| 266 |
LTX_REPO = "Lightricks/LTX-Video"
|
| 267 |
-
distilled_model_path = hf_hub_download(repo_id=LTX_REPO, filename=self.config["checkpoint_path"], local_dir=
|
| 268 |
self.config["checkpoint_path"] = distilled_model_path
|
| 269 |
-
spatial_upscaler_path = hf_hub_download(repo_id=LTX_REPO, filename=self.config["spatial_upscaler_model_path"], local_dir=
|
| 270 |
self.config["spatial_upscaler_model_path"] = spatial_upscaler_path
|
| 271 |
pipeline = create_ltx_video_pipeline(ckpt_path=self.config["checkpoint_path"], precision=self.config["precision"], text_encoder_model_name_or_path=self.config["text_encoder_model_name_or_path"], sampler=self.config["sampler"], device="cpu", enhance_prompt=False, prompt_enhancer_image_caption_model_name_or_path=self.config["prompt_enhancer_image_caption_model_name_or_path"], prompt_enhancer_llm_model_name_or_path=self.config["prompt_enhancer_llm_model_name_or_path"])
|
| 272 |
latent_upsampler = None
|
|
|
|
| 261 |
return yaml.safe_load(file)
|
| 262 |
|
| 263 |
def _load_models(self):
|
|
|
|
|
|
|
| 264 |
LTX_REPO = "Lightricks/LTX-Video"
|
| 265 |
+
distilled_model_path = hf_hub_download(repo_id=LTX_REPO, filename=self.config["checkpoint_path"], local_dir=os.getenv("HF_HOME"), cache_dir=os.getenv("HF_HOME_CACHE"), token=os.getenv("HF_TOKEN"))
|
| 266 |
self.config["checkpoint_path"] = distilled_model_path
|
| 267 |
+
spatial_upscaler_path = hf_hub_download(repo_id=LTX_REPO, filename=self.config["spatial_upscaler_model_path"], local_dir=os.getenv("HF_HOME"), cache_dir=os.getenv("HF_HOME_CACHE"), token=os.getenv("HF_TOKEN"))
|
| 268 |
self.config["spatial_upscaler_model_path"] = spatial_upscaler_path
|
| 269 |
pipeline = create_ltx_video_pipeline(ckpt_path=self.config["checkpoint_path"], precision=self.config["precision"], text_encoder_model_name_or_path=self.config["text_encoder_model_name_or_path"], sampler=self.config["sampler"], device="cpu", enhance_prompt=False, prompt_enhancer_image_caption_model_name_or_path=self.config["prompt_enhancer_image_caption_model_name_or_path"], prompt_enhancer_llm_model_name_or_path=self.config["prompt_enhancer_llm_model_name_or_path"])
|
| 270 |
latent_upsampler = None
|