h-siyuan commited on
Commit
b75ba06
·
verified ·
1 Parent(s): c25773e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -11,6 +11,7 @@ import ast
11
  import os
12
  from datetime import datetime
13
  import numpy as np
 
14
 
15
  # Define constants
16
  DESCRIPTION = "[ShowUI Demo](https://huggingface.co/showlab/ShowUI-2B)"
@@ -28,6 +29,8 @@ model = Qwen2VLForConditionalGeneration.from_pretrained(
28
  # Load the processor
29
  processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", min_pixels=MIN_PIXELS, max_pixels=MAX_PIXELS)
30
 
 
 
31
  # Helper functions
32
  def draw_point(image_input, point=None, radius=5):
33
  """Draw a point on the image."""
 
11
  import os
12
  from datetime import datetime
13
  import numpy as np
14
+ from huggingface_hub import snapshot_download
15
 
16
  # Define constants
17
  DESCRIPTION = "[ShowUI Demo](https://huggingface.co/showlab/ShowUI-2B)"
 
29
  # Load the processor
30
  processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", min_pixels=MIN_PIXELS, max_pixels=MAX_PIXELS)
31
 
32
+ local_dir = snapshot_download(repo_id="showlab/ShowUI-2B", local_dir="./showui-2b")
33
+
34
  # Helper functions
35
  def draw_point(image_input, point=None, radius=5):
36
  """Draw a point on the image."""