Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Model] Dynamic image size support for LLaVA-NeXT #5279

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use default input processor
  • Loading branch information
DarkLight1337 committed Jun 3, 2024
commit 7aa37787978a3f9e1c316caa30f804eb73260965
9 changes: 4 additions & 5 deletions vllm/inputs/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def dummy_data_for_profiling(self, model_config: "ModelConfig",

return dummy_factory(model_config, seq_len)

def _default_input_processor(self, inputs: LLMInputs) -> LLMInputs:
def _default_input_processor(self, model_config: "ModelConfig",
inputs: LLMInputs) -> LLMInputs:
"""Preprocess the inputs to the model."""
return inputs

Expand Down Expand Up @@ -273,10 +274,8 @@ def process_input(self, model_config: "ModelConfig",

model_cls, _ = get_model_architecture(model_config)

processor = self._input_processors_by_model_type.get(model_cls)
if processor is None:
raise KeyError(f"No input processor in {self} is registered for "
f"model class {model_cls.__name__}.")
processor = self._input_processors_by_model_type \
.get(model_cls, self._default_input_processor)

return processor(model_config, inputs)

Expand Down
Loading