generic_decoder
Converter derived entirely from a composable generic decoder contract.
Classes
Attach typed block configs using descriptor-owned structural contracts. |
Functions
Apply exactly one descriptor-declared checkpoint-key migration. |
|
Materialize descriptor-declared key migrations without mutating hardlinked sources. |
- class GenericDecoderConverter
Bases:
ConverterAttach typed block configs using descriptor-owned structural contracts.
- classmethod convert(descriptor, input_dir, output_dir)
- Parameters:
input_dir (Path)
output_dir (Path)
- static create_block_configs(descriptor, config)
- Parameters:
config (Any)
- Return type:
list[BlockConfig]
- static create_block_configs_from_main_config(config)
- rewrite_checkpoint_key(key, rewrites)
Apply exactly one descriptor-declared checkpoint-key migration.
- Parameters:
key (str)
rewrites (tuple[tuple[str, str], ...])
- Return type:
str
- rewrite_safetensor_checkpoint_keys(checkpoint, rewrites)
Materialize descriptor-declared key migrations without mutating hardlinked sources.
- Parameters:
checkpoint (Path)
rewrites (tuple[tuple[str, str], ...])
- Return type:
dict[str, str]