Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,26 +10,20 @@ 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 |
def install_apex():
|
15 |
-
# Apex
|
16 |
-
|
17 |
-
subprocess.run(['git', 'clone', 'https://github.com/NVIDIA/apex'], check=True)
|
18 |
|
19 |
-
# Apex
|
20 |
-
os.chdir('apex')
|
21 |
-
|
22 |
-
# Apex'i kur
|
23 |
cmd = [
|
24 |
-
'pip', 'install', '-
|
25 |
'--no-build-isolation', '--config-settings', '--build-option=--cpp_ext',
|
26 |
-
'--config-settings', '--build-option=--cuda_ext'
|
27 |
]
|
28 |
subprocess.run(cmd, check=True)
|
29 |
|
30 |
-
|
31 |
-
os.chdir('..')
|
32 |
-
|
33 |
try:
|
34 |
import apex
|
35 |
except ModuleNotFoundError:
|
@@ -37,7 +31,7 @@ except ModuleNotFoundError:
|
|
37 |
install_apex()
|
38 |
# Kurulumdan sonra apex'i import etmeyi dene
|
39 |
import apex
|
40 |
-
|
41 |
|
42 |
|
43 |
|
|
|
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 |
def install_apex():
|
15 |
+
# Apex klasörünün var olduğundan emin ol
|
16 |
+
subprocess.run(['git', 'clone', 'https://github.com/NVIDIA/apex'], check=True)
|
|
|
17 |
|
18 |
+
# Apex'i belirtilen seçeneklerle kur
|
|
|
|
|
|
|
19 |
cmd = [
|
20 |
+
'pip', 'install', '-e', './apex', '--disable-pip-version-check', '--no-cache-dir',
|
21 |
'--no-build-isolation', '--config-settings', '--build-option=--cpp_ext',
|
22 |
+
'--config-settings', '--build-option=--cuda_ext'
|
23 |
]
|
24 |
subprocess.run(cmd, check=True)
|
25 |
|
26 |
+
# Apex'in kurulu olup olmadığını kontrol et ve gerekirse kur
|
|
|
|
|
27 |
try:
|
28 |
import apex
|
29 |
except ModuleNotFoundError:
|
|
|
31 |
install_apex()
|
32 |
# Kurulumdan sonra apex'i import etmeyi dene
|
33 |
import apex
|
34 |
+
|
35 |
|
36 |
|
37 |
|