(model_type)
| 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): |
no outgoing calls
no test coverage detected