Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -19,16 +19,6 @@ _SYSTEM = "Based on the screenshot of the page, I give a text description and yo
|
|
19 |
MIN_PIXELS = 256 * 28 * 28
|
20 |
MAX_PIXELS = 1344 * 28 * 28
|
21 |
|
22 |
-
# Load the model
|
23 |
-
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
24 |
-
"./showui-2b",
|
25 |
-
torch_dtype=torch.bfloat16,
|
26 |
-
device_map="auto",
|
27 |
-
)
|
28 |
-
|
29 |
-
# Load the processor
|
30 |
-
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", min_pixels=MIN_PIXELS, max_pixels=MAX_PIXELS)
|
31 |
-
|
32 |
# Specify the model repository and destination folder
|
33 |
model_repo = "showlab/ShowUI-2B"
|
34 |
destination_folder = "./showui-2b"
|
@@ -43,6 +33,16 @@ files = list_repo_files(repo_id=model_repo)
|
|
43 |
for file in files:
|
44 |
file_path = hf_hub_download(repo_id=model_repo, filename=file, local_dir=destination_folder)
|
45 |
print(f"Downloaded {file} to {file_path}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
# Helper functions
|
48 |
def draw_point(image_input, point=None, radius=5):
|
|
|
19 |
MIN_PIXELS = 256 * 28 * 28
|
20 |
MAX_PIXELS = 1344 * 28 * 28
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
# Specify the model repository and destination folder
|
23 |
model_repo = "showlab/ShowUI-2B"
|
24 |
destination_folder = "./showui-2b"
|
|
|
33 |
for file in files:
|
34 |
file_path = hf_hub_download(repo_id=model_repo, filename=file, local_dir=destination_folder)
|
35 |
print(f"Downloaded {file} to {file_path}")
|
36 |
+
|
37 |
+
# Load the model
|
38 |
+
model = Qwen2VLForConditionalGeneration.from_pretrained(
|
39 |
+
"./showui-2b",
|
40 |
+
torch_dtype=torch.bfloat16,
|
41 |
+
device_map="auto",
|
42 |
+
)
|
43 |
+
|
44 |
+
# Load the processor
|
45 |
+
processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", min_pixels=MIN_PIXELS, max_pixels=MAX_PIXELS)
|
46 |
|
47 |
# Helper functions
|
48 |
def draw_point(image_input, point=None, radius=5):
|