(self, config)
| 1605 | ) |
| 1606 | class LlamaForTokenClassification(LlamaPreTrainedModel): |
| 1607 | def __init__(self, config): |
| 1608 | super().__init__(config) |
| 1609 | self.num_labels = config.num_labels |
| 1610 | self.model = LlamaModel(config) |
| 1611 | if getattr(config, "classifier_dropout", None) is not None: |
| 1612 | classifier_dropout = config.classifier_dropout |
| 1613 | elif getattr(config, "hidden_dropout", None) is not None: |
| 1614 | classifier_dropout = config.hidden_dropout |
| 1615 | else: |
| 1616 | classifier_dropout = 0.1 |
| 1617 | self.dropout = nn.Dropout(classifier_dropout) |
| 1618 | self.score = nn.Linear(config.hidden_size, config.num_labels) |
| 1619 | |
| 1620 | # Initialize weights and apply final processing |
| 1621 | self.post_init() |
| 1622 | |
| 1623 | def get_input_embeddings(self): |
| 1624 | return self.model.embed_tokens |
nothing calls this directly
no test coverage detected