MCPcopy Create free account
hub / github.com/huggingface/transformers / copy_decoder_layers

Function copy_decoder_layers

examples/seq2seq/initialization_utils.py:13–14  ·  view source on GitHub ↗
(teacher, student, l2copy=[0, 2, 4, 7, 9, 11])

Source from the content-addressed store, hash-verified

11
12
13def copy_decoder_layers(teacher, student, l2copy=[0, 2, 4, 7, 9, 11]):
14 copy_layers(teacher.model.decoder.layers, student.model.decoder.layers, l2copy)
15
16
17def copy_layers(teacher_layers: nn.ModuleList, student_layers: nn.ModuleList, layers_to_copy: List) -> None:

Callers

nothing calls this directly

Calls 1

copy_layersFunction · 0.85

Tested by

no test coverage detected