Fill-Mask
Transformers
Safetensors
modchembert
modernbert
ModChemBERT
cheminformatics
chemical-language-model
molecular-property-prediction
custom_code
Eval Results (legacy)
Instructions to use Derify/ModChemBERT-MLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Derify/ModChemBERT-MLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="Derify/ModChemBERT-MLM", trust_remote_code=True)# Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("Derify/ModChemBERT-MLM", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update README to include transformers version requirement
Browse files- README.md +6 -0
- config.json +4 -2
README.md
CHANGED
|
@@ -121,6 +121,12 @@ model-index:
|
|
| 121 |
ModChemBERT is a ModernBERT-based chemical language model (CLM), trained on SMILES strings for masked language modeling (MLM) and downstream molecular property prediction (classification & regression).
|
| 122 |
|
| 123 |
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
### Load Model
|
| 125 |
```python
|
| 126 |
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
|
|
|
| 121 |
ModChemBERT is a ModernBERT-based chemical language model (CLM), trained on SMILES strings for masked language modeling (MLM) and downstream molecular property prediction (classification & regression).
|
| 122 |
|
| 123 |
## Usage
|
| 124 |
+
Install the `transformers` library starting from v4.56.1:
|
| 125 |
+
|
| 126 |
+
```bash
|
| 127 |
+
pip install -U transformers>=4.56.1
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
### Load Model
|
| 131 |
```python
|
| 132 |
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
config.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
| 1 |
{
|
| 2 |
"architectures": [
|
| 3 |
-
"ModChemBertForMaskedLM"
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.1,
|
| 7 |
"auto_map": {
|
| 8 |
"AutoConfig": "configuration_modchembert.ModChemBertConfig",
|
| 9 |
-
"AutoModelForMaskedLM": "modeling_modchembert.ModChemBertForMaskedLM"
|
|
|
|
| 10 |
},
|
| 11 |
"bos_token_id": 0,
|
| 12 |
"classifier_activation": "gelu",
|
|
|
|
| 1 |
{
|
| 2 |
"architectures": [
|
| 3 |
+
"ModChemBertForMaskedLM",
|
| 4 |
+
"ModChemBertForSequenceClassification"
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.1,
|
| 8 |
"auto_map": {
|
| 9 |
"AutoConfig": "configuration_modchembert.ModChemBertConfig",
|
| 10 |
+
"AutoModelForMaskedLM": "modeling_modchembert.ModChemBertForMaskedLM",
|
| 11 |
+
"AutoModelForSequenceClassification": "modeling_modchembert.ModChemBertForSequenceClassification"
|
| 12 |
},
|
| 13 |
"bos_token_id": 0,
|
| 14 |
"classifier_activation": "gelu",
|