Skip to content
Merged
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
5 changes: 4 additions & 1 deletion verl/workers/megatron_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ def _build_model_optimizer(
self.config.model.get("trust_remote_code", False),
self.config.actor.megatron.use_mbridge,
)
self.generation_config = get_generation_config(self.local_path)
self.generation_config = get_generation_config(
self.local_path,
self.config.model.get("trust_remote_code", False),
)
Comment on lines +317 to +320
Copy link
Contributor

Choose a reason for hiding this comment

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

high

While this change is correct, it duplicates the expression self.config.model.get("trust_remote_code", False), which is also used on line 314. To improve maintainability and avoid this duplication, consider extracting this value into a local variable before both calls. This would make the code cleaner and less prone to errors if the configuration key ever changes.


if self._is_actor or self._is_rollout:
wrap_config = McoreModuleWrapperConfig(
Expand Down
Loading