dot-rename_state_dict_variables: Clean up Parameter Names

.rename_state_dict_variablesR Documentation

Clean up Parameter Names

Description

There are some hard-to-avoid differences between the variable names in BERT models constructed using this package and the standard variable names used in the Huggingface saved weights. This function changes the names from the Huggingface saves to match package usage.

Usage

.rename_state_dict_variables(state_dict)

Arguments

state_dict

A state_dict of pretrained weights, probably loaded from a file.

Value

The state_dict with the names normalized.


macmillancontentscience/torchtransformers documentation built on Aug. 6, 2023, 5:35 a.m.