Geraldine commited on
Commit
43b70e8
·
verified ·
1 Parent(s): ef47ccc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -12,9 +12,9 @@ import os, stat, io
12
 
13
  # Load the model in half-precision on the available device(s)
14
  model = Qwen2VLForConditionalGeneration.from_pretrained(
15
- "./Qwen2-VL-7B-Instruct", torch_dtype="auto", device_map="auto"
16
  )
17
- processor = AutoProcessor.from_pretrained("./Qwen2-VL-7B-Instruct")
18
 
19
  def array_to_image(image_array):
20
  if image_array is None:
@@ -50,7 +50,7 @@ def describe_image(image_array):
50
  inputs = processor(
51
  text=[text_prompt], images=[image], padding=True, return_tensors="pt"
52
  )
53
- inputs = inputs.to("cpu")
54
 
55
  # Inference: Generation of the output
56
  output_ids = model.generate(**inputs, max_new_tokens=128)
 
12
 
13
  # Load the model in half-precision on the available device(s)
14
  model = Qwen2VLForConditionalGeneration.from_pretrained(
15
+ "./Qwen2-VL-2B-Instruct-GPTQ-Int8", torch_dtype="auto", device_map="auto"
16
  )
17
+ processor = AutoProcessor.from_pretrained("./Qwen2-VL-2B-Instruct-GPTQ-Int8")
18
 
19
  def array_to_image(image_array):
20
  if image_array is None:
 
50
  inputs = processor(
51
  text=[text_prompt], images=[image], padding=True, return_tensors="pt"
52
  )
53
+ #inputs = inputs.to("cpu")
54
 
55
  # Inference: Generation of the output
56
  output_ids = model.generate(**inputs, max_new_tokens=128)