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
1 change: 1 addition & 0 deletions swift/megatron/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ def _apply_rotary_pos_emb_thd(


def _patch_megatron():
os.environ.pop('VLLM_USE_MODELSCOPE', None)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better maintainability, it's good practice to add a comment explaining why this environment variable is being removed. This will provide valuable context for future developers.

Suggested change
os.environ.pop('VLLM_USE_MODELSCOPE', None)
# Unset VLLM_USE_MODELSCOPE to prevent vLLM from unconditionally using ModelScope,
# which can conflict with Megatron's model loading logic.
os.environ.pop('VLLM_USE_MODELSCOPE', None)

logging_level = logging.root.level
_patch_flash_attn()
_patch_transformer_engine()
Expand Down
Loading