kadirnar commited on
Commit
b9f214e
1 Parent(s): b39befe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -10,25 +10,19 @@ from transformers import T5ForConditionalGeneration, T5Tokenizer
10
  import os
11
 
12
  subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
13
-
14
-
15
  def install_apex():
16
- # Install Apex in editable mode from the specified GitHub repository
17
- cmd = [
18
- 'pip', 'install', '--no-cache-dir', '--no-build-isolation',
19
- '--config-settings', 'build-option=--cpp_ext', '--config-settings',
20
- 'build-option=--cuda_ext', '-e', 'git+https://github.com/NVIDIA/apex.git#egg=apex'
21
- ]
22
- subprocess.run(cmd, check=True)
23
 
24
  try:
25
  import apex
26
  except ModuleNotFoundError:
27
- print("Apex not found, installing...")
28
  install_apex()
29
- # Try to import Apex again after installation
30
- import apex
31
-
32
 
33
  def download_t5_model(model_id, save_directory):
34
  # Modelin tokenizer'ını ve modeli indir
 
10
  import os
11
 
12
  subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
 
 
13
  def install_apex():
14
+ subprocess.run([
15
+ 'pip', 'install', '-v', '--disable-pip-version-check', '--no-cache-dir',
16
+ '--no-build-isolation', 'git+https://github.com/NVIDIA/apex.git'
17
+ ], check=True)
 
 
 
18
 
19
  try:
20
  import apex
21
  except ModuleNotFoundError:
22
+ print("Installing Apex...")
23
  install_apex()
24
+ import apex # Try to import Apex again after installation
25
+
 
26
 
27
  def download_t5_model(model_id, save_directory):
28
  # Modelin tokenizer'ını ve modeli indir