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
|
@@ -501,7 +501,7 @@ class BertEnergyModelForSequenceClassification(BertPreTrainedModel):
|
|
| 501 |
self.model = BertEnergyModel(config, pad_idx=pad_idx)
|
| 502 |
#self.lm_head = EnergyLMHead(config)
|
| 503 |
|
| 504 |
-
dropout = classifier_dropout if classifier_dropout is not None else config.hidden_dropout_prob
|
| 505 |
|
| 506 |
#self.dropout = nn.Dropout(dropout)
|
| 507 |
output_dim = config.hidden_size
|
|
|
|
| 501 |
self.model = BertEnergyModel(config, pad_idx=pad_idx)
|
| 502 |
#self.lm_head = EnergyLMHead(config)
|
| 503 |
|
| 504 |
+
dropout = config.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob
|
| 505 |
|
| 506 |
#self.dropout = nn.Dropout(dropout)
|
| 507 |
output_dim = config.hidden_size
|