Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,20 +4,21 @@
|
|
| 4 |
# in the Software without restriction, including without limitation the rights
|
| 5 |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 6 |
# copies of the Software, and to permit persons to whom the Software is
|
| 7 |
-
|
| 8 |
-
|
| 9 |
import os
|
| 10 |
-
#subprocess.run(['sh', './torch.sh'])
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
os.environ['
|
|
|
|
|
|
|
| 19 |
os.environ["SAFETENSORS_FAST_GPU"] = "1"
|
| 20 |
-
os.
|
| 21 |
|
| 22 |
import gradio as gr
|
| 23 |
import numpy as np
|
|
|
|
| 4 |
# in the Software without restriction, including without limitation the rights
|
| 5 |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 6 |
# copies of the Software, and to permit persons to whom the Software is
|
| 7 |
+
import spaces
|
| 8 |
+
import subprocess
|
| 9 |
import os
|
|
|
|
| 10 |
|
| 11 |
+
@spaces.GPU(required=True)
|
| 12 |
+
def install_flashattn():
|
| 13 |
+
subprocess.run(['sh', './flashattn.sh'])
|
| 14 |
+
|
| 15 |
+
install_flashattn()
|
| 16 |
+
|
| 17 |
+
os.environ['PYTORCH_NVML_BASED_CUDA_CHECK'] = '1'
|
| 18 |
+
os.environ['TORCH_LINALG_PREFER_CUSOLVER'] = '1'
|
| 19 |
+
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True,pinned_use_background_threads:True'
|
| 20 |
os.environ["SAFETENSORS_FAST_GPU"] = "1"
|
| 21 |
+
os.environ['HF_HUB_ENABLE_HF_TRANSFER'] = '1'
|
| 22 |
|
| 23 |
import gradio as gr
|
| 24 |
import numpy as np
|