@@ -278,6 +278,14 @@ def __init__(self, cfg: DictConfig, trainer: Optional[Trainer] = None):
278278 chunk_size_seconds = self ._cfg .get ("chunk_size_seconds" , None ),
279279 sync_max_audio_length = self ._cfg .get ("sync_max_audio_length" , False ),
280280 )
281+ # Preserve the architecture-only bundle configuration for consolidated
282+ # SpeechLM checkpoint export and serving reconstruction.
283+ self .encoder ._bundle_config = _clone_config (self ._cfg )
284+ self .encoder ._bundle_config .diar_normalize_type = self .encoder .diar_normalize_type
285+ self .encoder ._bundle_config .speaker_feature_config_version = _SPEAKER_FEATURE_CONFIG_VERSION
286+ self .encoder ._bundle_config .speaker_feature_mode = self .encoder .speaker_feature_mode
287+ self .encoder ._bundle_config .speaker_activity_threshold = self .encoder .speaker_activity_threshold
288+ self .encoder ._bundle_config .sync_max_audio_length = self .encoder .sync_max_audio_length
281289
282290 @staticmethod
283291 def _validate_bundle_schema (cfg : DictConfig ) -> None :
@@ -375,6 +383,21 @@ def load_from_nemo(
375383 )
376384 return bundle .encoder
377385
386+ @classmethod
387+ def from_inline_config (
388+ cls ,
389+ cfg : Union [DictConfig , dict ],
390+ * ,
391+ map_location : Union [str , torch .device ] = "cpu" ,
392+ ) -> ParallelExpertEncoder :
393+ """Construct the encoder architecture without loading standalone weights.
394+
395+ Consolidated SpeechLM checkpoints supply the encoder tensors from their
396+ root state dictionary after constructing it from this embedded config.
397+ """
398+ shell = cls (cfg = OmegaConf .create (cfg ), trainer = None )
399+ return shell .encoder .to (map_location )
400+
378401 @classmethod
379402 def save_to_nemo (
380403 cls ,
@@ -445,6 +468,7 @@ class ParallelExpertEncoder(nn.Module):
445468 :class:`TransformerEncoder` used by Transformer AED ASR checkpoints.
446469 """
447470
471+ supports_external_speaker_targets = True
448472 supports_sequence_packed_output = True
449473
450474 def __init__ (
0 commit comments