Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,25 +11,6 @@ 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'
|
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
|
35 |
model = T5ForConditionalGeneration.from_pretrained(model_id)
|
|
|
11 |
|
12 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
def download_t5_model(model_id, save_directory):
|
15 |
# Modelin tokenizer'ını ve modeli indir
|
16 |
model = T5ForConditionalGeneration.from_pretrained(model_id)
|