Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,12 +12,21 @@ cuda_lib_path = "/usr/local/cuda/lib64"
|
|
| 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
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
from huggingface_hub import snapshot_download
|
| 23 |
|
|
|
|
| 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 required package
|
| 16 |
+
def install_flash_attn():
|
| 17 |
+
try:
|
| 18 |
+
print("Installing flash-attn...")
|
| 19 |
+
subprocess.run(
|
| 20 |
+
["pip", "install", "flash-attn", "--no-build-isolation"],
|
| 21 |
+
check=True
|
| 22 |
+
)
|
| 23 |
+
print("flash-attn installed successfully!")
|
| 24 |
+
except subprocess.CalledProcessError as e:
|
| 25 |
+
print(f"Failed to install flash-attn: {e}")
|
| 26 |
+
exit(1)
|
| 27 |
+
|
| 28 |
+
# Install flash-attn
|
| 29 |
+
install_flash_attn()
|
| 30 |
|
| 31 |
from huggingface_hub import snapshot_download
|
| 32 |
|