Pittawat Taveekitworachai commited on
Commit
c0b4343
·
1 Parent(s): 75ec781

feat: limit min max img size

Browse files
Files changed (1) hide show
  1. demo.py +7 -1
demo.py CHANGED
@@ -11,7 +11,13 @@ model_name = "scb10x/typhoon2-qwen2vl-7b-vision-instruct"
11
  model = Qwen2VLForConditionalGeneration.from_pretrained(
12
  model_name, torch_dtype="auto", device_map="auto"
13
  )
14
- processor = AutoProcessor.from_pretrained(model_name)
 
 
 
 
 
 
15
 
16
 
17
  def bot_streaming(message, history, max_new_tokens=512):
 
11
  model = Qwen2VLForConditionalGeneration.from_pretrained(
12
  model_name, torch_dtype="auto", device_map="auto"
13
  )
14
+
15
+ min_pixels = 256 * 28 * 28
16
+ max_pixels = 1280 * 28 * 28
17
+
18
+ processor = AutoProcessor.from_pretrained(
19
+ model_name, min_pixels=min_pixels, max_pixels=max_pixels
20
+ )
21
 
22
 
23
  def bot_streaming(message, history, max_new_tokens=512):