aducsdr commited on
Commit
b392300
·
verified ·
1 Parent(s): bfe4022

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -6
app.py CHANGED
@@ -17,10 +17,10 @@ import os
17
  import sys
18
 
19
  # --- ETAPA 1: Clonar o Repositório do GitHub ---
20
- repo_name = "SeedVR"
21
  if not os.path.exists(repo_name):
22
  print(f"Clonando o repositório {repo_name} do GitHub...")
23
- subprocess.run(f"git clone https://github.com/ByteDance-Seed/{repo_name}.git", shell=True, check=True)
24
 
25
  # --- ETAPA 2: Mudar para o Diretório e Configurar o Ambiente ---
26
  os.chdir(repo_name)
@@ -32,8 +32,25 @@ print(f"Diretório atual adicionado ao sys.path.")
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 usando --no-build-isolation
36
- # para que ele possa encontrar o PyTorch já instalado a partir do requirements.txt.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  print("Instalando Apex a partir do código-fonte...")
38
  subprocess.run(
39
  [
@@ -41,7 +58,7 @@ subprocess.run(
41
  "-m",
42
  "pip",
43
  "install",
44
- "--no-build-isolation", # Garante que o torch seja encontrado durante a compilação
45
  "git+https://github.com/NVIDIA/apex.git"
46
  ],
47
  check=True
@@ -207,4 +224,4 @@ with gr.Blocks(title="SeedVR") as demo:
207
  run_button.click(fn=generation_loop, inputs=[input_file, seed, fps], outputs=[output_image, output_video, download_link])
208
 
209
 
210
- demo.queue().launch(share=True)
 
17
  import sys
18
 
19
  # --- ETAPA 1: Clonar o Repositório do GitHub ---
20
+ repo_name = "SeedVR2-3B"
21
  if not os.path.exists(repo_name):
22
  print(f"Clonando o repositório {repo_name} do GitHub...")
23
+ subprocess.run(f"git clone https://huggingface.co/spaces/ByteDance-Seed/SeedVR2-3B", shell=True, check=True)
24
 
25
  # --- ETAPA 2: Mudar para o Diretório e Configurar o Ambiente ---
26
  os.chdir(repo_name)
 
32
  # --- ETAPA 3: Instalar Dependências Corretamente ---
33
  python_executable = sys.executable
34
 
35
+ # CORREÇÃO: Instalar flash-attn e Apex a partir do código-fonte para garantir a compatibilidade.
36
+
37
+ # Instalar flash-attn
38
+ print("Instalando flash-attn...")
39
+ subprocess.run(
40
+ [
41
+ python_executable,
42
+ "-m",
43
+ "pip",
44
+ "install",
45
+ "flash-attn",
46
+ "--no-build-isolation"
47
+ ],
48
+ check=True
49
+ )
50
+ print("✅ Configuração do flash-attn concluída.")
51
+
52
+
53
+ # Instalar Apex
54
  print("Instalando Apex a partir do código-fonte...")
55
  subprocess.run(
56
  [
 
58
  "-m",
59
  "pip",
60
  "install",
61
+ "--no-build-isolation",
62
  "git+https://github.com/NVIDIA/apex.git"
63
  ],
64
  check=True
 
224
  run_button.click(fn=generation_loop, inputs=[input_file, seed, fps], outputs=[output_image, output_video, download_link])
225
 
226
 
227
+ demo.queue().launch(share=True)