Carlos s
commited on
Update api/ltx_server.py
Browse files- api/ltx_server.py +2 -0
api/ltx_server.py
CHANGED
|
@@ -503,6 +503,8 @@ class VideoService:
|
|
| 503 |
torch.cuda.empty_cache(); torch.cuda.reset_peak_memory_stats()
|
| 504 |
self._log_gpu_memory("Início da Geração")
|
| 505 |
|
|
|
|
|
|
|
| 506 |
if mode == "image-to-video" and not start_image_filepath:
|
| 507 |
raise ValueError("A imagem de início é obrigatória para o modo image-to-video")
|
| 508 |
if mode == "video-to-video" and not input_video_filepath:
|
|
|
|
| 503 |
torch.cuda.empty_cache(); torch.cuda.reset_peak_memory_stats()
|
| 504 |
self._log_gpu_memory("Início da Geração")
|
| 505 |
|
| 506 |
+
ctx = torch.autocast(device_type="cuda", dtype=self.runtime_autocast_dtype) if self.device == "cuda" else contextlib.nullcontext()
|
| 507 |
+
|
| 508 |
if mode == "image-to-video" and not start_image_filepath:
|
| 509 |
raise ValueError("A imagem de início é obrigatória para o modo image-to-video")
|
| 510 |
if mode == "video-to-video" and not input_video_filepath:
|