Instructions to use TCMVince/HOP4NLP5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TCMVince/HOP4NLP5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="TCMVince/HOP4NLP5", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("TCMVince/HOP4NLP5", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update mlm.py
Browse files
mlm.py
CHANGED
|
@@ -494,7 +494,7 @@ class BertEnergyModelForSequenceClassification(BertPreTrainedModel):
|
|
| 494 |
ignore_index = -100
|
| 495 |
_tied_weights_keys = ["lm_head.decoder.weight"]
|
| 496 |
|
| 497 |
-
def __init__(self, config, add_pooling_layer=True, pad_idx=None):
|
| 498 |
super().__init__(config)
|
| 499 |
self.config = config
|
| 500 |
|
|
|
|
| 494 |
ignore_index = -100
|
| 495 |
_tied_weights_keys = ["lm_head.decoder.weight"]
|
| 496 |
|
| 497 |
+
def __init__(self, config, add_pooling_layer=True, pad_idx=None, classifier_dropout=0.1, num_labels=2):
|
| 498 |
super().__init__(config)
|
| 499 |
self.config = config
|
| 500 |
|