Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions vllm/config/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,11 +1334,13 @@ def try_get_generation_config(self) -> dict[str, Any]:
self.hf_config_path or self.model,
trust_remote_code=self.trust_remote_code,
revision=self.revision,
config_format=self.config_format,
)
else:
config = try_get_generation_config(
self.generation_config,
trust_remote_code=self.trust_remote_code,
config_format=self.config_format,
)
Comment on lines 1340 to 1344
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The revision parameter is not being passed to try_get_generation_config in this else block. If self.generation_config refers to a model on the Hugging Face Hub, this will cause it to always use the default revision (e.g., main branch), ignoring the revision specified for the main model. This could lead to loading an incorrect or incompatible generation configuration. You should pass self.revision here for consistency with the if block.

Suggested change
config = try_get_generation_config(
self.generation_config,
trust_remote_code=self.trust_remote_code,
config_format=self.config_format,
)
config = try_get_generation_config(
self.generation_config,
trust_remote_code=self.trust_remote_code,
revision=self.revision,
config_format=self.config_format,
)


if config is None:
Expand Down
2 changes: 2 additions & 0 deletions vllm/transformers_utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ def try_get_generation_config(
model: str,
trust_remote_code: bool,
revision: Optional[str] = None,
config_format: Union[str, ConfigFormat] = "auto",
) -> Optional[GenerationConfig]:
try:
return GenerationConfig.from_pretrained(
Expand All @@ -961,6 +962,7 @@ def try_get_generation_config(
model,
trust_remote_code=trust_remote_code,
revision=revision,
config_format=config_format,
)
return GenerationConfig.from_model_config(config)
except OSError: # Not found
Expand Down