bridge.models.muse_spark_open.muse_spark_open_bridge#
HF config and parameter mappings for the Muse Spark Open Hybrid integration.
Module Contents#
Classes#
Convert the supplied multimodal HF checkpoint to a native Hybrid stack. |
|
Use the same Hybrid decoder and mappings for the standalone language model. |
API#
- class bridge.models.muse_spark_open.muse_spark_open_bridge.MuseSparkBridge#
Bases:
megatron.bridge.models.conversion.model_bridge.MegatronModelBridgeConvert the supplied multimodal HF checkpoint to a native Hybrid stack.
- MODEL_CONFIG_CLASS#
None
- USE_MODEL_CONFIG_FOR_CONVERSION#
True
- text_only_pretrained(
- hf_pretrained: megatron.bridge.models.hf_pretrained.PreTrainedCausalLM,
Select language weights and a standalone HF text configuration.
- postprocess_hf_export_artifacts(path: pathlib.Path) None#
Preserve the VL head computation in standalone HF text exports.
- stream_weights_megatron_to_hf(
- megatron_model: megatron.bridge.models.muse_spark_open.modeling_muse_spark_open.model.MuseSparkModel | list[megatron.bridge.models.muse_spark_open.modeling_muse_spark_open.model.MuseSparkModel],
- hf_pretrained: Any,
- cpu: bool = True,
- show_progress: bool = True,
- conversion_tasks: list[megatron.bridge.models.conversion.model_bridge.WeightConversionTask] | None = None,
- merge_adapter_weights: bool = True,
- weight_dtype: torch.dtype | None = None,
- with_megatron_names: bool = False,
Emit small tensors first so interleaved HF shards can release expert weights.
- hf_config_to_model_config(
- hf_config: transformers.PretrainedConfig,
Read all architecture sizes from HF and expand schedules to Hybrid positions.
- classmethod megatron_to_hf_config(
- model_config: megatron.bridge.models.muse_spark_open.muse_spark_open_config.MuseSparkModelConfig,
Export current language settings and retain the original HF perception config.
- mapping_registry() megatron.bridge.models.conversion.mapping_registry.MegatronMappingRegistry#
Map HF blocks to separate attention and MoE Hybrid positions.
- class bridge.models.muse_spark_open.muse_spark_open_bridge.MuseSparkTextBridge#
Bases:
bridge.models.muse_spark_open.muse_spark_open_bridge.MuseSparkBridgeUse the same Hybrid decoder and mappings for the standalone language model.