tuandunghcmut commited on
Commit
c44566b
1 Parent(s): c1fbf73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -33,8 +33,8 @@ def array_to_image_path(image_array):
33
  return full_path
34
 
35
  models = {
36
- "Qwen/Qwen2-VL-72B-Instruct": Qwen2VLForConditionalGeneration.from_pretrained(
37
- "Qwen/Qwen2-VL-72B-Instruct",
38
  trust_remote_code=True,
39
  token=HF_TOKEN,
40
  torch_dtype=torch.bfloat16,
@@ -44,10 +44,10 @@ models = {
44
  }
45
 
46
  processors = {
47
- "Qwen/Qwen2-VL-72B-Instruct": AutoProcessor.from_pretrained("Qwen/Qwen2-VL-72B-Instruct", trust_remote_code=True)
48
  }
49
 
50
- DESCRIPTION = "[Qwen2-VL-72B Demo](https://huggingface.co/Qwen/Qwen2-VL-72B-Instruct)"
51
 
52
  kwargs = {}
53
  kwargs['torch_dtype'] = torch.bfloat16
@@ -114,11 +114,11 @@ css = """
114
 
115
  with gr.Blocks(css=css) as demo:
116
  gr.Markdown(DESCRIPTION)
117
- with gr.Tab(label="Qwen2-VL-72B Input"):
118
  with gr.Row():
119
  with gr.Column():
120
  input_img = gr.Image(label="Input Picture")
121
- model_selector = gr.Dropdown(choices=list(models.keys()), label="Model", value="Qwen/Qwen2-VL-72B-Instruct")
122
  text_input = gr.Textbox(label="Question")
123
  submit_btn = gr.Button(value="Submit")
124
  with gr.Column():
 
33
  return full_path
34
 
35
  models = {
36
+ "Qwen/Qwen2-VL-7B-Instruct": Qwen2VLForConditionalGeneration.from_pretrained(
37
+ "Qwen/Qwen2-VL-7B-Instruct",
38
  trust_remote_code=True,
39
  token=HF_TOKEN,
40
  torch_dtype=torch.bfloat16,
 
44
  }
45
 
46
  processors = {
47
+ "Qwen/Qwen2-VL-7B-Instruct": AutoProcessor.from_pretrained("Qwen/Qwen2-VL-7B-Instruct", trust_remote_code=True)
48
  }
49
 
50
+ DESCRIPTION = "[Qwen2-VL-7B Demo](https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct)"
51
 
52
  kwargs = {}
53
  kwargs['torch_dtype'] = torch.bfloat16
 
114
 
115
  with gr.Blocks(css=css) as demo:
116
  gr.Markdown(DESCRIPTION)
117
+ with gr.Tab(label="Qwen2-VL-7B Input"):
118
  with gr.Row():
119
  with gr.Column():
120
  input_img = gr.Image(label="Input Picture")
121
+ model_selector = gr.Dropdown(choices=list(models.keys()), label="Model", value="Qwen/Qwen2-VL-7B-Instruct")
122
  text_input = gr.Textbox(label="Question")
123
  submit_btn = gr.Button(value="Submit")
124
  with gr.Column():