Instructions to use TCMVince/HOP4NLP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TCMVince/HOP4NLP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="TCMVince/HOP4NLP4", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("TCMVince/HOP4NLP4", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update mlm.py
Browse files
mlm.py
CHANGED
|
@@ -10,9 +10,9 @@ from transformers.modeling_outputs import (
|
|
| 10 |
SequenceClassifierOutput,
|
| 11 |
)
|
| 12 |
|
| 13 |
-
from
|
| 14 |
-
from
|
| 15 |
-
from
|
| 16 |
|
| 17 |
|
| 18 |
class EnergyLMHead(nn.Module):
|
|
|
|
| 10 |
SequenceClassifierOutput,
|
| 11 |
)
|
| 12 |
|
| 13 |
+
from .hopfield import HopfieldLayer
|
| 14 |
+
from .hf_configuration import BertEnergyConfig
|
| 15 |
+
from .positional import PositionalEncoding
|
| 16 |
|
| 17 |
|
| 18 |
class EnergyLMHead(nn.Module):
|