MCPcopy Index your code
hub / github.com/LUMIA-Group/MemoryDecoder / get_model_last_layer

Method get_model_last_layer

knn_utils/saveEmbedMulti.py:243–246  ·  view source on GitHub ↗
(model_type)

Source from the content-addressed store, hash-verified

241
242 @staticmethod
243 def get_model_last_layer(model_type):
244 # works for gpt2, marian, t5. If a model does not have an ".lm_head" layer,
245 # add an "if model_type is ..." statement here, and return the output embedding layer
246 return lambda model: model.lm_head
247
248 @staticmethod
249 def get_model_embedding_layer(model_type):

Callers 2

break_intoMethod · 0.80
break_intoMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected