Spaces:
Running
on
Zero
Running
on
Zero
override gradio version
Browse files
app.py
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from typing import Optional
|
2 |
import spaces
|
3 |
import gradio as gr
|
@@ -7,7 +13,6 @@ from PIL import Image
|
|
7 |
import io
|
8 |
import re
|
9 |
|
10 |
-
import base64, os
|
11 |
from util.utils import check_ocr_box, get_yolo_model, get_caption_model_processor, get_som_labeled_img
|
12 |
from util.som import MarkHelper, plot_boxes_with_marks, plot_circles_with_marks
|
13 |
from util.process_utils import pred_2_point, extract_bbox, extract_mark_id
|
@@ -20,8 +25,7 @@ import torch
|
|
20 |
from transformers import AutoModelForCausalLM
|
21 |
from transformers import AutoProcessor
|
22 |
|
23 |
-
|
24 |
-
os.system('pip install flash-attn --no-build-isolation')
|
25 |
|
26 |
# Define repository and local directory
|
27 |
repo_id = "microsoft/OmniParser-v2.0" # HF repo
|
|
|
1 |
+
|
2 |
+
import base64, os
|
3 |
+
# add a command for installing flash-attn
|
4 |
+
os.system('pip install flash-attn --no-build-isolation')
|
5 |
+
os.system("pip install gradio==4.44.1")
|
6 |
+
|
7 |
from typing import Optional
|
8 |
import spaces
|
9 |
import gradio as gr
|
|
|
13 |
import io
|
14 |
import re
|
15 |
|
|
|
16 |
from util.utils import check_ocr_box, get_yolo_model, get_caption_model_processor, get_som_labeled_img
|
17 |
from util.som import MarkHelper, plot_boxes_with_marks, plot_circles_with_marks
|
18 |
from util.process_utils import pred_2_point, extract_bbox, extract_mark_id
|
|
|
25 |
from transformers import AutoModelForCausalLM
|
26 |
from transformers import AutoProcessor
|
27 |
|
28 |
+
|
|
|
29 |
|
30 |
# Define repository and local directory
|
31 |
repo_id = "microsoft/OmniParser-v2.0" # HF repo
|