Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
17 |
-
|
18 |
-
'
|
19 |
-
|
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
|
28 |
install_apex()
|
29 |
-
# Try to import Apex again after installation
|
30 |
-
|
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
|