Spaces:
Running
on
A100
Running
on
A100
Update app.py
Browse files
app.py
CHANGED
@@ -5,13 +5,20 @@ import shutil
|
|
5 |
import tempfile
|
6 |
|
7 |
# Set the PATH and LD_LIBRARY_PATH for CUDA 12.3
|
8 |
-
cuda_bin_path = "/usr/local/cuda
|
9 |
-
cuda_lib_path = "/usr/local/cuda
|
10 |
|
11 |
# Update the environment variables
|
12 |
os.environ['PATH'] = f"{cuda_bin_path}:{os.environ.get('PATH', '')}"
|
13 |
os.environ['LD_LIBRARY_PATH'] = f"{cuda_lib_path}:{os.environ.get('LD_LIBRARY_PATH', '')}"
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
from huggingface_hub import snapshot_download
|
16 |
|
17 |
# Create xcodec_mini_infer folder
|
|
|
5 |
import tempfile
|
6 |
|
7 |
# Set the PATH and LD_LIBRARY_PATH for CUDA 12.3
|
8 |
+
cuda_bin_path = "/usr/local/cuda/bin"
|
9 |
+
cuda_lib_path = "/usr/local/cuda/lib64"
|
10 |
|
11 |
# Update the environment variables
|
12 |
os.environ['PATH'] = f"{cuda_bin_path}:{os.environ.get('PATH', '')}"
|
13 |
os.environ['LD_LIBRARY_PATH'] = f"{cuda_lib_path}:{os.environ.get('LD_LIBRARY_PATH', '')}"
|
14 |
|
15 |
+
# Install flash attention
|
16 |
+
subprocess.run(
|
17 |
+
"pip install flash-attn --no-build-isolation",
|
18 |
+
env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
|
19 |
+
shell=True,
|
20 |
+
)
|
21 |
+
|
22 |
from huggingface_hub import snapshot_download
|
23 |
|
24 |
# Create xcodec_mini_infer folder
|