nemo_automodel.components.models.nemotron_decision.export
nemo_automodel.components.models.nemotron_decision.export
Export a trained Nemotron Decision stage (merged LoRA adapter or full weights) as a complete, servable checkpoint.
Module Contents
Functions
Data
API
SHA-256 over the configuration, the decision contract files and every *.safetensors shard of a checkpoint.
Covers config.json, decision.json and decision_template.jinja (each when present) and reads every
weight byte, so a base whose interior weights or decision prompt differ (for example, an ordinary fine-tune of the
same architecture) gets a different fingerprint.
Parameters:
Local checkpoint directory.
Bytes read per step.
Returns: str
Hex digest.
Raises:
FileNotFoundError: If the directory has no*.safetensorsshard.
Write a complete checkpoint from consolidated backbone fine-tuning weights, cast to the base dtypes.
Parameters:
Checkpoint the run started from (configuration, tokenizer and model code are copied from it).
Directory of consolidated *.safetensors weights of the trained model.
New directory (must not exist).
Returns: dict
Receipt {"base", "weights", "tensors"} (also written as export-receipt.json).
Raises:
ValueError: If the trained tensor names or shapes differ from the base.FileExistsError: Ifoutput_direxists.
Merge a PEFT LoRA adapter into the base weights and write a complete checkpoint.
Parameters:
Checkpoint the adapter was trained on.
Directory with adapter_config.json and adapter_model.safetensors.
New directory (must not exist).
Returns: dict
Receipt {"base", "adapter", "lora_modules", "r", "alpha", "scale"} (also written as merge-receipt.json).
Raises:
ValueError: For DoRA/rank-pattern adapters, adapter weights missing from the base, or shape mismatch.FileExistsError: Ifoutput_direxists.