Update app.py
Browse files
app.py
CHANGED
|
@@ -9,16 +9,19 @@ import spaces
|
|
| 9 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 10 |
import os
|
| 11 |
|
|
|
|
| 12 |
def install_apex():
|
| 13 |
# Install Apex in editable mode from the specified GitHub repository
|
| 14 |
-
cmd = [
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
]
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
try:
|
|
|
|
| 22 |
import apex
|
| 23 |
except ModuleNotFoundError:
|
| 24 |
print("Apex not found, installing...")
|
|
|
|
| 9 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 10 |
import os
|
| 11 |
|
| 12 |
+
print ("starting the app.")
|
| 13 |
def install_apex():
|
| 14 |
# Install Apex in editable mode from the specified GitHub repository
|
| 15 |
+
# cmd = [
|
| 16 |
+
# 'pip', 'install', '-v','--no-cache-dir', '--no-build-isolation',
|
| 17 |
+
# '--config-settings', 'build-option=--cpp_ext', '--config-settings',
|
| 18 |
+
# 'build-option=--cuda_ext', 'git+https://github.com/sandeshrajbhandari/apex.git#egg=apex'
|
| 19 |
+
# ]
|
| 20 |
+
cmd = '!pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" git+https://github.com/sandeshrajbhandari/apex.git#egg=apex'
|
| 21 |
+
subprocess.run(cmd, shell=True)
|
| 22 |
|
| 23 |
try:
|
| 24 |
+
|
| 25 |
import apex
|
| 26 |
except ModuleNotFoundError:
|
| 27 |
print("Apex not found, installing...")
|