Aduc-sdr commited on
Commit
f4d4a28
·
verified ·
1 Parent(s): ea7dfbd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -26,12 +26,10 @@ if not os.path.exists(repo_dir_name):
26
  subprocess.run(f"git clone https://huggingface.co/spaces/ByteDance-Seed/{repo_dir_name}", shell=True, check=True)
27
 
28
  # 2. Mude o diretório de trabalho atual para a raiz do repositório.
29
- # Isso corrige o acesso a arquivos relativos (ex: carregar config.yaml).
30
  os.chdir(repo_dir_name)
31
  print(f"Diretório de trabalho alterado para: {os.getcwd()}")
32
 
33
  # 3. Adicione explicitamente o novo diretório de trabalho ao caminho do sistema do Python.
34
- # Isso corrige as importações de módulos (ex: `from data...`).
35
  sys.path.insert(0, os.path.abspath('.'))
36
  print(f"Diretório atual adicionado ao sys.path: {os.path.abspath('.')}")
37
 
@@ -92,7 +90,12 @@ subprocess.run(
92
 
93
  apex_wheel_path = "apex-0.1-cp310-cp310-linux_x86_64.whl"
94
  if os.path.exists(apex_wheel_path):
95
- subprocess.run([python_executable, "-m", "pip", "install", apex_wheel_path], check=True)
 
 
 
 
 
96
  print("✅ Configuração do Apex concluída.")
97
 
98
  # --- Funções Principais ---
 
26
  subprocess.run(f"git clone https://huggingface.co/spaces/ByteDance-Seed/{repo_dir_name}", shell=True, check=True)
27
 
28
  # 2. Mude o diretório de trabalho atual para a raiz do repositório.
 
29
  os.chdir(repo_dir_name)
30
  print(f"Diretório de trabalho alterado para: {os.getcwd()}")
31
 
32
  # 3. Adicione explicitamente o novo diretório de trabalho ao caminho do sistema do Python.
 
33
  sys.path.insert(0, os.path.abspath('.'))
34
  print(f"Diretório atual adicionado ao sys.path: {os.path.abspath('.')}")
35
 
 
90
 
91
  apex_wheel_path = "apex-0.1-cp310-cp310-linux_x86_64.whl"
92
  if os.path.exists(apex_wheel_path):
93
+ print("Instalando o Apex a partir do arquivo wheel...")
94
+ # CORREÇÃO: Usar --force-reinstall e --no-cache-dir para garantir uma instalação limpa.
95
+ subprocess.run(
96
+ [python_executable, "-m", "pip", "install", "--force-reinstall", "--no-cache-dir", apex_wheel_path],
97
+ check=True
98
+ )
99
  print("✅ Configuração do Apex concluída.")
100
 
101
  # --- Funções Principais ---