MaziyarPanahi commited on
Commit
73aa6f4
1 Parent(s): e66b71b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -31,6 +31,7 @@ prompt_suffix = "<|end|>\n"
31
 
32
  @spaces.GPU
33
  def run_example(image, text_input=None, model_id="Qwen/Qwen2-VL-2B-Instruct"):
 
34
  model = models[model_id]
35
  processor = processors[model_id]
36
 
@@ -42,7 +43,7 @@ def run_example(image, text_input=None, model_id="Qwen/Qwen2-VL-2B-Instruct"):
42
  "content": [
43
  {
44
  "type": "image",
45
- "image": image,
46
  },
47
  {"type": "text", "text": text_input},
48
  ],
@@ -87,7 +88,7 @@ with gr.Blocks(css=css) as demo:
87
  with gr.Tab(label="Qwen2-VL-2B Input"):
88
  with gr.Row():
89
  with gr.Column():
90
- input_img = gr.Image(label="Input Picture", type="filepath")
91
  model_selector = gr.Dropdown(choices=list(models.keys()), label="Model", value="Qwen/Qwen2-VL-2B-Instruct")
92
  text_input = gr.Textbox(label="Question")
93
  submit_btn = gr.Button(value="Submit")
 
31
 
32
  @spaces.GPU
33
  def run_example(image, text_input=None, model_id="Qwen/Qwen2-VL-2B-Instruct"):
34
+ print(image)
35
  model = models[model_id]
36
  processor = processors[model_id]
37
 
 
43
  "content": [
44
  {
45
  "type": "image",
46
+ "image": image[0],
47
  },
48
  {"type": "text", "text": text_input},
49
  ],
 
88
  with gr.Tab(label="Qwen2-VL-2B Input"):
89
  with gr.Row():
90
  with gr.Column():
91
+ input_img = gr.Image(label="Input Picture")
92
  model_selector = gr.Dropdown(choices=list(models.keys()), label="Model", value="Qwen/Qwen2-VL-2B-Instruct")
93
  text_input = gr.Textbox(label="Question")
94
  submit_btn = gr.Button(value="Submit")