cerebras.modelzoo.tools.checkpoint_converters.esm2.Converter_Esm2Model_WithoutOptionalModel_HF_CS21#
- class cerebras.modelzoo.tools.checkpoint_converters.esm2.Converter_Esm2Model_WithoutOptionalModel_HF_CS21[source]#
Bases:
cerebras.modelzoo.tools.checkpoint_converters.bert.Converter_BertModel_WithoutOptionalModel_HF_CS21
Methods
attempt_mup_to_sp
convert
convert_all_keys
Converts all keys in a checkpoint from converter_indices.direction format to the other format.
Attempts to convert the old key by matching against the list of conversion rules.
DPR, which uses two BERT sub-converters, requires different behavior of the pooler conversion, so we generalize to allow overriding.
convert_with_interleaving_query_key
extract_model_dict
file_formats
formats
get_config_converter_class
get_converter_indices
Allows models to override the default muP converters with their own
init_output_checkpoint
interleave_helper
load
position_embeddings_convert
post_checkpoint_convert
post_model_convert
pre_checkpoint_convert
pre_model_convert
Copies value that exists at old_state_dict's old_key to new_state_dict's new_key.
reverse_interleave_helper
save
supports_conversion
supports_mup_conversion
- convert_helper(input_checkpoint, configs, converter_indices, output_checkpoint={}, drop_unmatched_keys=False, no_progress_bar=True, debug=False)#
Converts all keys in a checkpoint from converter_indices.direction format to the other format. Conversion will fail if at least one of the keys did not match on any conversion rules and drop_unmatched_keys is not enabled. Returns the newly converted checkpoint.
- convert_key(old_key, old_state_dict, new_state_dict, from_index, match_start=0, prefix='', action_fn_args=None, debug=False)#
Attempts to convert the old key by matching against the list of conversion rules. The first rule to match is used for conversion (i.e. even if multiple rules would match, the latter ones are never used). Returns True if a conversion occurred.
- convert_pooler_factory_fn()#
DPR, which uses two BERT sub-converters, requires different behavior of the pooler conversion, so we generalize to allow overriding.
- get_mup_converter()#
Allows models to override the default muP converters with their own
- static replaceKey(old_key, new_key, old_state_dict, new_state_dict, from_index, action_fn_args=None)#
Copies value that exists at old_state_dict’s old_key to new_state_dict’s new_key.