EuuIia commited on
Commit
eb62b92
verified
1 Parent(s): a2fc1a1

Update video_service.py

Browse files
Files changed (1) hide show
  1. video_service.py +3 -3
video_service.py CHANGED
@@ -29,7 +29,7 @@ def run_setup():
29
  print(f"ERRO CR脥TICO DURANTE O SETUP: 'setup.py' falhou com c贸digo {e.returncode}.")
30
  sys.exit(1)
31
 
32
- DEPS_DIR = Path("./deps")
33
  LTX_VIDEO_REPO_DIR = DEPS_DIR / "LTX-Video"
34
  if not LTX_VIDEO_REPO_DIR.exists():
35
  run_setup()
@@ -111,9 +111,9 @@ class VideoService:
111
  models_dir = "downloaded_models_gradio"
112
  Path(models_dir).mkdir(parents=True, exist_ok=True)
113
  LTX_REPO = "Lightricks/LTX-Video"
114
- distilled_model_path = hf_hub_download(repo_id=LTX_REPO, filename=self.config["checkpoint_path"], local_dir=models_dir, local_dir_use_symlinks=False)
115
  self.config["checkpoint_path"] = distilled_model_path
116
- spatial_upscaler_path = hf_hub_download(repo_id=LTX_REPO, filename=self.config["spatial_upscaler_model_path"], local_dir=models_dir, local_dir_use_symlinks=False)
117
  self.config["spatial_upscaler_model_path"] = spatial_upscaler_path
118
  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"])
119
  latent_upsampler = None
 
29
  print(f"ERRO CR脥TICO DURANTE O SETUP: 'setup.py' falhou com c贸digo {e.returncode}.")
30
  sys.exit(1)
31
 
32
+ DEPS_DIR = Path("/data")
33
  LTX_VIDEO_REPO_DIR = DEPS_DIR / "LTX-Video"
34
  if not LTX_VIDEO_REPO_DIR.exists():
35
  run_setup()
 
111
  models_dir = "downloaded_models_gradio"
112
  Path(models_dir).mkdir(parents=True, exist_ok=True)
113
  LTX_REPO = "Lightricks/LTX-Video"
114
+ distilled_model_path = hf_hub_download(repo_id=LTX_REPO, filename=self.config["checkpoint_path"], local_dir=models_dir, cache_dir=os.getenv("HF_HOME_CACHE"), token=os.getenv("HF_TOKEN"))
115
  self.config["checkpoint_path"] = distilled_model_path
116
+ spatial_upscaler_path = hf_hub_download(repo_id=LTX_REPO, filename=self.config["spatial_upscaler_model_path"], local_dir=models_dir, cache_dir=os.getenv("HF_HOME_CACHE"), token=os.getenv("HF_TOKEN"))
117
  self.config["spatial_upscaler_model_path"] = spatial_upscaler_path
118
  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"])
119
  latent_upsampler = None