Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,6 +32,16 @@ print(f"Diretório atual adicionado ao sys.path.")
|
|
| 32 |
# --- ETAPA 3: Instalar Dependências Corretamente ---
|
| 33 |
python_executable = sys.executable
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
from pathlib import Path
|
| 37 |
from urllib.parse import urlparse
|
|
@@ -48,12 +58,6 @@ def load_file_from_url(url, model_dir='.', progress=True, file_name=None):
|
|
| 48 |
download_url_to_file(url, cached_file, hash_prefix=None, progress=progress)
|
| 49 |
return cached_file
|
| 50 |
|
| 51 |
-
apex_url = 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/apex-0.1-cp310-cp310-linux_x86_64.whl'
|
| 52 |
-
apex_wheel_path = load_file_from_url(url=apex_url)
|
| 53 |
-
print("Instalando Apex a partir do wheel baixado...")
|
| 54 |
-
subprocess.run([python_executable, "-m", "pip", "install", "--force-reinstall", "--no-cache-dir", apex_wheel_path], check=True)
|
| 55 |
-
print("✅ Configuração do Apex concluída.")
|
| 56 |
-
|
| 57 |
# --- ETAPA 4: Baixar os Modelos Pré-treinados ---
|
| 58 |
print("Baixando modelos pré-treinados...")
|
| 59 |
import torch
|
|
|
|
| 32 |
# --- ETAPA 3: Instalar Dependências Corretamente ---
|
| 33 |
python_executable = sys.executable
|
| 34 |
|
| 35 |
+
# CORREÇÃO: Instalar o Apex a partir do código-fonte para garantir a compatibilidade com a GPU.
|
| 36 |
+
# A instalação de um wheel pré-compilado pode causar o erro "CUDA error: no kernel image is available"
|
| 37 |
+
# se o wheel não foi compilado para a arquitetura de GPU específica do ambiente de execução.
|
| 38 |
+
print("Instalando Apex a partir do código-fonte...")
|
| 39 |
+
subprocess.run(
|
| 40 |
+
[python_executable, "-m", "pip", "install", "git+https://github.com/NVIDIA/apex.git"],
|
| 41 |
+
check=True
|
| 42 |
+
)
|
| 43 |
+
print("✅ Configuração do Apex concluída.")
|
| 44 |
+
|
| 45 |
|
| 46 |
from pathlib import Path
|
| 47 |
from urllib.parse import urlparse
|
|
|
|
| 58 |
download_url_to_file(url, cached_file, hash_prefix=None, progress=progress)
|
| 59 |
return cached_file
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
# --- ETAPA 4: Baixar os Modelos Pré-treinados ---
|
| 62 |
print("Baixando modelos pré-treinados...")
|
| 63 |
import torch
|