File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
server/text_generation_server/models Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -236,10 +236,7 @@ def batch_tokenized_inputs(
236
236
image = Image .open (BytesIO (chunk .image .data ))
237
237
# qwen2_vl expects images to be greater than 20 pixels, this is for warmup since the
238
238
# default warmup image is 20x20
239
- if (
240
- config .model_type == "qwen2_vl"
241
- or config .model_type == "qwen2_5_vl"
242
- ):
239
+ if config .model_type in {"qwen2_vl" , "qwen2_5_vl" }:
243
240
if image .width <= 20 :
244
241
w = image .width * 2
245
242
h = image .height * 2
@@ -430,10 +427,7 @@ def forward(
430
427
max_s = batch .max_current_length
431
428
lm_head_indices = batch .prefill_head_indices
432
429
433
- if (
434
- self .model .config .model_type == "qwen2_vl"
435
- or self .model .config .model_type == "qwen2_5_vl"
436
- ):
430
+ if self .model .config .model_type in {"qwen2_vl" , "qwen2_5_vl" }:
437
431
if position_ids .dim () == 1 and batch .prefilling :
438
432
position_ids = self .model .get_position_ids (
439
433
input_ids , batch .image_grid_thw
You can’t perform that action at this time.
0 commit comments