bridge.models.muse_spark_open.text_only#

Language-only checkpoint views and standalone export artifacts for Muse Spark Open.

Module Contents#

Classes#

MuseSparkTextStateSource

Expose the VL decoder and separate LM head through standalone text keys.

Functions#

select_text_pretrained

Project a VL source without mutating its config, index, or weights.

export_text_artifacts

Install the text-only causal LM class that Transformers does not provide.

API#

class bridge.models.muse_spark_open.text_only.MuseSparkTextStateSource(
path: str | pathlib.Path,
*,
revision: str | None,
hub_kwargs: dict,
)#

Bases: megatron.bridge.models.hf_pretrained.state.SafeTensorsStateSource

Expose the VL decoder and separate LM head through standalone text keys.

Prefix sources retain index-first loading and the existing streaming writer. No perception tensor is loaded, including when shards mix modalities.

Initialization

property key_to_filename_map: dict[str, str]#

Retain source shard grouping while excluding perception keys.

load_tensors(keys_to_load: list[str]) → dict[str, torch.Tensor]#

Read only the selected language tensors under their original names.

bridge.models.muse_spark_open.text_only.select_text_pretrained(
hf_pretrained: megatron.bridge.models.hf_pretrained.PreTrainedCausalLM,
) → megatron.bridge.models.hf_pretrained.PreTrainedCausalLM#

Project a VL source without mutating its config, index, or weights.

bridge.models.muse_spark_open.text_only.export_text_artifacts(path: pathlib.Path) → None#

Install the text-only causal LM class that Transformers does not provide.