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

Function init_student

examples/seq2seq/initialization_utils.py:6–10  ·  view source on GitHub ↗
(student, teacher)

Source from the content-addressed store, hash-verified

4
5
6def init_student(student, teacher):
7 teacher_state_dict = teacher.state_dict()
8 info = student.load_state_dict(teacher_state_dict, strict=False)
9 assert info.missing_keys == [], info.missing_keys
10 return student, info
11
12
13def copy_decoder_layers(teacher, student, l2copy=[0, 2, 4, 7, 9, 11]):

Callers 2

pre_initMethod · 0.90
pre_initMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected