Spaces:
Paused
Paused
Update managers/vae_manager.py
Browse files- managers/vae_manager.py +17 -0
managers/vae_manager.py
CHANGED
|
@@ -3,6 +3,23 @@
|
|
| 3 |
import torch
|
| 4 |
import contextlib
|
| 5 |
import logging
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# --- IMPORTAÇÃO CRÍTICA ---
|
| 8 |
# Importa a função helper oficial da biblioteca LTX para decodificação.
|
|
|
|
| 3 |
import torch
|
| 4 |
import contextlib
|
| 5 |
import logging
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
|
| 8 |
+
LTX_VIDEO_REPO_DIR = Path("/data/LTX-Video")
|
| 9 |
+
|
| 10 |
+
def add_deps_to_path():
|
| 11 |
+
"""
|
| 12 |
+
Adiciona o diretório do repositório LTX ao sys.path para garantir que suas
|
| 13 |
+
bibliotecas possam ser importadas.
|
| 14 |
+
"""
|
| 15 |
+
repo_path = str(LTX_VIDEO_REPO_DIR.resolve())
|
| 16 |
+
if repo_path not in sys.path:
|
| 17 |
+
sys.path.insert(0, repo_path)
|
| 18 |
+
logging.info(f"[ltx_utils] LTX-Video repository added to sys.path: {repo_path}")
|
| 19 |
+
|
| 20 |
+
# Executa a função imediatamente para configurar o ambiente antes de qualquer importação.
|
| 21 |
+
add_deps_to_path()
|
| 22 |
+
|
| 23 |
|
| 24 |
# --- IMPORTAÇÃO CRÍTICA ---
|
| 25 |
# Importa a função helper oficial da biblioteca LTX para decodificação.
|