bridge.models.stepfun.step37_bridge#
Step3.7 multimodal bridge.
Registers a :class:MegatronModelBridge for the upstream
Step3p7ForConditionalGeneration HF architecture (model_type step37).
The bridge:
Maps the config to a builder-backed :class:
Step37ModelConfig: the language fields come from :class:Step35Bridgeapplied tohf_config.text_config(the Step3.7 HF config nests its Step-3.5 text fields there), and the vision-tower fields (vision_config, image_token_id, projector_bias, understand_projector_stride) come from the top-level config.Defines an HF↔Megatron parameter mapping registry that prefixes every Step-3.5 text mapping with
language_model.(since- class:
Step37Modelwraps the text GPTModel) and adds directvision_model.*AutoMappings for the PE-G/14 trunk + downsamplers, plus a top-levelvit_large_projector.weightmapping.
Module Contents#
Classes#
Megatron Bridge for Step3.7 (Step-3.5 text + Perception-Encoder G/14 vision). |
Functions#
Prefix a Step-3.5 megatron_param with the |
Data#
API#
- bridge.models.stepfun.step37_bridge.logger#
‘getLogger(…)’
- bridge.models.stepfun.step37_bridge._LM_PREFIX#
‘language_model.’
- bridge.models.stepfun.step37_bridge._lm(megatron_param: str) str#
Prefix a Step-3.5 megatron_param with the
language_model.namespace.
- class bridge.models.stepfun.step37_bridge.Step37Bridge#
Bases:
megatron.bridge.models.conversion.model_bridge.MegatronModelBridgeMegatron Bridge for Step3.7 (Step-3.5 text + Perception-Encoder G/14 vision).
.. rubric:: Example
from megatron.bridge import AutoBridge bridge = AutoBridge.from_hf_pretrained(“stepfun-ai/Step-3.7-Flash”) model_config = bridge.get_model_config()
- MODEL_CONFIG_CLASS#
None
- USE_MODEL_CONFIG_FOR_CONVERSION#
True
- CONFIG_MAPPING#
None
- classmethod megatron_to_hf_config(
- provider: megatron.bridge.models.stepfun.step37_config.Step37ModelConfig | megatron.bridge.models.stepfun.step37_provider.Step37ModelProvider,
Convert a Step3.7 model config or provider into its nested Hugging Face config.
- hf_config_to_model_config_kwargs(
- hf_config: transformers.PretrainedConfig,
Convert a Hugging Face Step3.7 config to builder config kwargs.
The language fields come from :class:
Step35Bridgeapplied tohf_config.text_config. Where the Step3.7 provider configured a field differently, it is set here as the provider set it. The vision-language fields come from the top-level config.
- hf_config_to_provider_kwargs(
- hf_config: transformers.PretrainedConfig,
Adapt the canonical builder mapping to the deprecated provider path.
- mapping_registry() megatron.bridge.models.conversion.mapping_registry.MegatronMappingRegistry#
Return the full text + vision parameter mapping registry.
Text mappings replicate :meth:
Step35Bridge.mapping_registrywith alanguage_model.prefix on every Megatron-side path (since- Class:
Step37Modelwraps the Step-3.5GPTModelunderself.language_model). Vision mappings are direct AutoMappings — the Megatron module structure mirrors the HF safetensors layout.
- bridge.models.stepfun.step37_bridge.__all__#
[‘Step37Bridge’]