JimmyK300 commited on
Commit
1124359
·
verified ·
1 Parent(s): 5bbbd7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,7 +11,7 @@ from PIL import Image
11
  vl_model = Qwen2VLForConditionalGeneration.from_pretrained(
12
  "Qwen/Qwen2-VL-2B-Instruct", torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, device_map="auto"
13
  )
14
- vl_processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", max_pixels=480*480)
15
 
16
  # Load Text Model
17
  model_name = "Qwen/Qwen2.5-Math-1.5B-Instruct"
@@ -96,7 +96,7 @@ with gr.Blocks(css=css) as demo:
96
  with gr.Column():
97
  with gr.Tabs() as input_tabs:
98
  with gr.Tab("Upload"):
99
- input_image = gr.Image(type="pil", label="Upload")
100
  with gr.Tab("Sketch"):
101
  input_sketchpad = gr.Sketchpad(type="pil", label="Sketch", layers=False)
102
  input_tabs.select(fn=tabs_select, inputs=[state])
 
11
  vl_model = Qwen2VLForConditionalGeneration.from_pretrained(
12
  "Qwen/Qwen2-VL-2B-Instruct", torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, device_map="auto"
13
  )
14
+ vl_processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-2B-Instruct", max_pixels=240*240)
15
 
16
  # Load Text Model
17
  model_name = "Qwen/Qwen2.5-Math-1.5B-Instruct"
 
96
  with gr.Column():
97
  with gr.Tabs() as input_tabs:
98
  with gr.Tab("Upload"):
99
+ input_image = resize_image(gr.Image(type="pil", label="Upload"))
100
  with gr.Tab("Sketch"):
101
  input_sketchpad = gr.Sketchpad(type="pil", label="Sketch", layers=False)
102
  input_tabs.select(fn=tabs_select, inputs=[state])