(self, model)
| 546 | return "OPTForCausalLM" |
| 547 | |
| 548 | def get_model_spec(self, model): |
| 549 | spec = transformer_spec.TransformerDecoderModelSpec.from_config( |
| 550 | model.config.num_hidden_layers, |
| 551 | model.config.num_attention_heads, |
| 552 | pre_norm=model.config.do_layer_norm_before, |
| 553 | activation=_SUPPORTED_ACTIVATIONS[model.config.activation_function], |
| 554 | project_in_out=model.config.word_embed_proj_dim != model.config.hidden_size, |
| 555 | ) |
| 556 | |
| 557 | self.set_decoder(spec.decoder, model.model.decoder) |
| 558 | self.set_linear(spec.decoder.projection, model.lm_head) |
| 559 | return spec |
| 560 | |
| 561 | def smooth_activation(self, spec, activation_scales): |
| 562 | for i, layer in enumerate(spec.decoder.layer): |
nothing calls this directly
no test coverage detected