Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ import re
|
|
| 10 |
import time
|
| 11 |
from threading import Thread
|
| 12 |
from io import BytesIO
|
|
|
|
| 13 |
import uuid
|
| 14 |
import tempfile
|
| 15 |
|
|
@@ -31,6 +32,16 @@ from transformers.image_utils import load_image
|
|
| 31 |
from gradio.themes import Soft
|
| 32 |
from gradio.themes.utils import colors, fonts, sizes
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
colors.steel_blue = colors.Color(
|
| 35 |
name="steel_blue",
|
| 36 |
c50="#EBF3F8",
|
|
|
|
| 10 |
import time
|
| 11 |
from threading import Thread
|
| 12 |
from io import BytesIO
|
| 13 |
+
import subprocess
|
| 14 |
import uuid
|
| 15 |
import tempfile
|
| 16 |
|
|
|
|
| 32 |
from gradio.themes import Soft
|
| 33 |
from gradio.themes.utils import colors, fonts, sizes
|
| 34 |
|
| 35 |
+
|
| 36 |
+
# Attempt to install flash-attn
|
| 37 |
+
try:
|
| 38 |
+
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, check=True, shell=True)
|
| 39 |
+
except subprocess.CalledProcessError as e:
|
| 40 |
+
print(f"Error installing flash-attn: {e}")
|
| 41 |
+
print("Continuing without flash-attn.")
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
colors.steel_blue = colors.Color(
|
| 46 |
name="steel_blue",
|
| 47 |
c50="#EBF3F8",
|