Skip to content

Commit 88cdf14

Browse files
committed
Add support for num_crops and valid_size from vLLM
1 parent facae5f commit 88cdf14

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

QEfficient/transformers/models/molmo/modeling_molmo.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,14 @@ def get_specializations(
719719
full_batch_size: Optional[int] = None,
720720
**compiler_options,
721721
):
722+
723+
#Extract Molmo specific paramters from compiler options if not provided as named args
724+
# vLLM passes num_crops instead of num_images, so that user don't get confused
725+
if num_images is None and "num_crops" in compiler_options:
726+
num_images = int(compiler_options["num_crops"])
727+
if valid_size is None and "valid_size" in compiler_options:
728+
valid_size = int(compiler_options["valid_size"])
729+
722730
prefill_seq_len = prefill_seq_len if prefill_seq_len else 1024
723731
ctx_len = ctx_len if ctx_len else constants.INTERN_CTX_LEN
724732

@@ -845,6 +853,9 @@ def get_specializations(
845853

846854
lang = [lang_prefill, lang_decode]
847855

856+
compiler_options.pop("num_crops", None)
857+
compiler_options.pop("valid_size", None)
858+
848859
specializations = {}
849860

850861
if kv_offload:

0 commit comments

Comments
 (0)