Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,18 @@
|
|
2 |
import warnings
|
3 |
warnings.filterwarnings("ignore")
|
4 |
|
|
|
5 |
import gradio as gr
|
6 |
from src.florence.task import ocr_task
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Image input for the interface
|
10 |
image = gr.Image(type="pil", label="Image")
|
11 |
|
|
|
2 |
import warnings
|
3 |
warnings.filterwarnings("ignore")
|
4 |
|
5 |
+
import subprocess
|
6 |
import gradio as gr
|
7 |
from src.florence.task import ocr_task
|
8 |
|
9 |
|
10 |
+
# Install Flash Attention
|
11 |
+
subprocess.run(
|
12 |
+
"pip install flash-attn --no-build-isolation",
|
13 |
+
env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
|
14 |
+
shell=True,
|
15 |
+
)
|
16 |
+
|
17 |
# Image input for the interface
|
18 |
image = gr.Image(type="pil", label="Image")
|
19 |
|