bridge.models.exaone.exaone45.exaone45_bridge#

Module Contents#

Classes#

Exaone45Bridge

Megatron Bridge for EXAONE 4.5 conditional generation.

API#

class bridge.models.exaone.exaone45.exaone45_bridge.Exaone45Bridge#

Bases: megatron.bridge.models.conversion.model_bridge.MegatronModelBridge

Megatron Bridge for EXAONE 4.5 conditional generation.

This bridge handles the conversion between HuggingFace Exaone4_5_ForConditionalGeneration and Megatron-Core Exaone45Model formats, including weight mappings and configuration translation for vision-language models.

The weight mappings are based on the yan-mbridge implementation which defines:

  • Vision model direct mappings

  • Vision attention layer mappings

  • Vision MLP layer mappings

  • Language model mappings

.. rubric:: Example

from megatron.bridge import AutoBridge bridge = AutoBridge.from_hf_pretrained(“LGAI-EXAONE/EXAONE-4.5-33B”) model_config = bridge.get_model_config()

MODEL_CONFIG_CLASS#

None

USE_MODEL_CONFIG_FOR_CONVERSION#

True

hf_config_to_model_config_kwargs(
hf_config: transformers.PretrainedConfig,
) → dict[str, Any]#

Convert a Hugging Face EXAONE 4.5 config to builder config kwargs.

The language-model fields start from the EXAONE 4.0 text bridge’s, read from text_config, and add the hybrid sliding-window attention, MTP and vision-language fields.

hf_config_to_provider_kwargs(
hf_config: transformers.PretrainedConfig,
) → dict[str, Any]#

Adapt the canonical builder mapping to the deprecated provider path.

Exaone45ModelProvider.provide() reads the language model’s maximum sequence length from the Hugging Face text config, so the provider also keeps that config.

mapping_registry() → megatron.bridge.models.conversion.mapping_registry.MegatronMappingRegistry#

Return MegatronMappingRegistry containing parameter mappings from Megatron to HF format.

The mappings are organized into:

  1. Simple 1:1 mappings for embeddings, layer norms, and output layers

  2. Vision model mappings (replicated without modification)

  3. QKV mappings that combine separate Q, K, V matrices

  4. Gated MLP mappings that combine gate and up projections

Returns:

MegatronMappingRegistry with all parameter mappings