transformer_lens.pretrained.weight_conversions.hubert#

transformer_lens.pretrained.weight_conversions.hubert.convert_hubert_weights(hf_model, cfg: HookedTransformerConfig)#

Convert transformer encoder weights from a HuggingFace HuBERT model into the state_dict expected by Transformer-Lens’ HookedEncoder.

Intentionally skips the convolutional frontend and feature_projection; those are used directly from the HF model. Use model.load_state_dict(state_dict, strict=False) to load these.