Spaces:
Paused
Paused
Update api/aduc_ltx_latent_patch.py
Browse files- api/aduc_ltx_latent_patch.py +17 -0
api/aduc_ltx_latent_patch.py
CHANGED
|
@@ -7,6 +7,23 @@ from torch import Tensor
|
|
| 7 |
from typing import Optional, List, Tuple, Any
|
| 8 |
from dataclasses import dataclass, field
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Importa as dependências necessárias do módulo original que será modificado.
|
| 11 |
# Certifique-se de que o sys.path esteja configurado corretamente para que isso funcione.
|
| 12 |
try:
|
|
|
|
| 7 |
from typing import Optional, List, Tuple, Any
|
| 8 |
from dataclasses import dataclass, field
|
| 9 |
|
| 10 |
+
|
| 11 |
+
DEPS_DIR = Path("/data")
|
| 12 |
+
LTX_VIDEO_REPO_DIR = DEPS_DIR / "LTX-Video"
|
| 13 |
+
def add_deps_to_path(repo_path: Path):
|
| 14 |
+
"""Adiciona o diretório do repositório ao sys.path para importações locais."""
|
| 15 |
+
resolved_path = str(repo_path.resolve())
|
| 16 |
+
if resolved_path not in sys.path:
|
| 17 |
+
sys.path.insert(0, resolved_path)
|
| 18 |
+
if LTXV_DEBUG:
|
| 19 |
+
print(f"[DEBUG] Adicionado ao sys.path: {resolved_path}")
|
| 20 |
+
|
| 21 |
+
# --- Execução da configuração inicial ---
|
| 22 |
+
if not LTX_VIDEO_REPO_DIR.exists():
|
| 23 |
+
_run_setup_script()
|
| 24 |
+
add_deps_to_path(LTX_VIDEO_REPO_DIR)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
# Importa as dependências necessárias do módulo original que será modificado.
|
| 28 |
# Certifique-se de que o sys.path esteja configurado corretamente para que isso funcione.
|
| 29 |
try:
|