Spaces:
Running
on
Zero
Running
on
Zero
Antoine Chaffin
commited on
Commit
•
346feeb
1
Parent(s):
7988f40
Doing the subprocess install before importation
Browse files
app.py
CHANGED
@@ -1,4 +1,10 @@
|
|
1 |
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import uuid
|
3 |
|
4 |
import gradio as gr
|
@@ -8,12 +14,6 @@ from qwen_vl_utils import process_vision_info
|
|
8 |
from transformers import AutoProcessor, Qwen2VLForConditionalGeneration
|
9 |
from voyager_index import Voyager
|
10 |
|
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 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
18 |
|
19 |
|
|
|
1 |
import subprocess
|
2 |
+
|
3 |
+
subprocess.run(
|
4 |
+
"pip install flash-attn --no-build-isolation",
|
5 |
+
env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
|
6 |
+
shell=True,
|
7 |
+
)
|
8 |
import uuid
|
9 |
|
10 |
import gradio as gr
|
|
|
14 |
from transformers import AutoProcessor, Qwen2VLForConditionalGeneration
|
15 |
from voyager_index import Voyager
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
18 |
|
19 |
|