Instructions to use Wb-az/peft-modernbert-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Wb-az/peft-modernbert-base with PEFT:
from peft import PeftModel from transformers import AutoModelForSequenceClassification base_model = AutoModelForSequenceClassification.from_pretrained("answerdotai/ModernBERT-base") model = PeftModel.from_pretrained(base_model, "Wb-az/peft-modernbert-base") - Transformers
How to use Wb-az/peft-modernbert-base with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Wb-az/peft-modernbert-base", dtype="auto") - Notebooks
- Google Colab
- Kaggle
End of training
Browse files- README.md +78 -0
- adapter_config.json +45 -0
- adapter_model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +18 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: peft
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: answerdotai/ModernBERT-base
|
| 5 |
+
tags:
|
| 6 |
+
- base_model:adapter:answerdotai/ModernBERT-base
|
| 7 |
+
- lora
|
| 8 |
+
- transformers
|
| 9 |
+
metrics:
|
| 10 |
+
- accuracy
|
| 11 |
+
- matthews_correlation
|
| 12 |
+
- f1
|
| 13 |
+
- precision
|
| 14 |
+
- recall
|
| 15 |
+
model-index:
|
| 16 |
+
- name: peft-modernbert-base
|
| 17 |
+
results: []
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 21 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 22 |
+
|
| 23 |
+
# peft-modernbert-base
|
| 24 |
+
|
| 25 |
+
This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on an unknown dataset.
|
| 26 |
+
It achieves the following results on the evaluation set:
|
| 27 |
+
- Loss: 0.0410
|
| 28 |
+
- Accuracy: 0.9887
|
| 29 |
+
- Matthews Correlation: 0.9850
|
| 30 |
+
- F1: 0.9760
|
| 31 |
+
- Precision: 0.9730
|
| 32 |
+
- Recall: 0.9792
|
| 33 |
+
|
| 34 |
+
## Model description
|
| 35 |
+
|
| 36 |
+
More information needed
|
| 37 |
+
|
| 38 |
+
## Intended uses & limitations
|
| 39 |
+
|
| 40 |
+
More information needed
|
| 41 |
+
|
| 42 |
+
## Training and evaluation data
|
| 43 |
+
|
| 44 |
+
More information needed
|
| 45 |
+
|
| 46 |
+
## Training procedure
|
| 47 |
+
|
| 48 |
+
### Training hyperparameters
|
| 49 |
+
|
| 50 |
+
The following hyperparameters were used during training:
|
| 51 |
+
- learning_rate: 0.0001
|
| 52 |
+
- train_batch_size: 8
|
| 53 |
+
- eval_batch_size: 8
|
| 54 |
+
- seed: 42
|
| 55 |
+
- gradient_accumulation_steps: 4
|
| 56 |
+
- total_train_batch_size: 32
|
| 57 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 58 |
+
- lr_scheduler_type: linear
|
| 59 |
+
- num_epochs: 1
|
| 60 |
+
|
| 61 |
+
### Training results
|
| 62 |
+
|
| 63 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy | Matthews Correlation | F1 | Precision | Recall |
|
| 64 |
+
|:-------------:|:------:|:----:|:---------------:|:--------:|:--------------------:|:------:|:---------:|:------:|
|
| 65 |
+
| 0.5348 | 0.1977 | 1400 | 0.0968 | 0.9722 | 0.9631 | 0.9568 | 0.9528 | 0.9609 |
|
| 66 |
+
| 0.2975 | 0.3954 | 2800 | 0.0728 | 0.9808 | 0.9745 | 0.9637 | 0.9559 | 0.9725 |
|
| 67 |
+
| 0.2385 | 0.5931 | 4200 | 0.0518 | 0.9865 | 0.9821 | 0.9731 | 0.9685 | 0.9780 |
|
| 68 |
+
| 0.2500 | 0.7908 | 5600 | 0.0443 | 0.9882 | 0.9843 | 0.9752 | 0.9709 | 0.9803 |
|
| 69 |
+
| 0.1968 | 0.9885 | 7000 | 0.0410 | 0.9887 | 0.9850 | 0.9760 | 0.9730 | 0.9792 |
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
### Framework versions
|
| 73 |
+
|
| 74 |
+
- PEFT 0.18.1
|
| 75 |
+
- Transformers 5.2.0
|
| 76 |
+
- Pytorch 2.10.0+cu128
|
| 77 |
+
- Datasets 4.0.0
|
| 78 |
+
- Tokenizers 0.22.2
|
adapter_config.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "answerdotai/ModernBERT-base",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": false,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 16,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.1,
|
| 22 |
+
"megatron_config": null,
|
| 23 |
+
"megatron_core": "megatron.core",
|
| 24 |
+
"modules_to_save": [
|
| 25 |
+
"classifier",
|
| 26 |
+
"score"
|
| 27 |
+
],
|
| 28 |
+
"peft_type": "LORA",
|
| 29 |
+
"peft_version": "0.18.1",
|
| 30 |
+
"qalora_group_size": 16,
|
| 31 |
+
"r": 8,
|
| 32 |
+
"rank_pattern": {},
|
| 33 |
+
"revision": null,
|
| 34 |
+
"target_modules": [
|
| 35 |
+
"Wqkv",
|
| 36 |
+
"Wi",
|
| 37 |
+
"Wo"
|
| 38 |
+
],
|
| 39 |
+
"target_parameters": null,
|
| 40 |
+
"task_type": "SEQ_CLS",
|
| 41 |
+
"trainable_token_indices": null,
|
| 42 |
+
"use_dora": false,
|
| 43 |
+
"use_qalora": false,
|
| 44 |
+
"use_rslora": false
|
| 45 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c4664a7b99624d33a3fa03d1ca035edd00ae98c76cadb4c0b711ae25254ad83
|
| 3 |
+
size 6798480
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "[CLS]",
|
| 4 |
+
"clean_up_tokenization_spaces": true,
|
| 5 |
+
"cls_token": "[CLS]",
|
| 6 |
+
"eos_token": "[SEP]",
|
| 7 |
+
"is_local": false,
|
| 8 |
+
"mask_token": "[MASK]",
|
| 9 |
+
"model_input_names": [
|
| 10 |
+
"input_ids",
|
| 11 |
+
"attention_mask"
|
| 12 |
+
],
|
| 13 |
+
"model_max_length": 8192,
|
| 14 |
+
"pad_token": "[PAD]",
|
| 15 |
+
"sep_token": "[SEP]",
|
| 16 |
+
"tokenizer_class": "TokenizersBackend",
|
| 17 |
+
"unk_token": "[UNK]"
|
| 18 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1f4e3d7ac76327380a0cd87cdbe98feb767f40892ff2f759328bd2889d6ef7c2
|
| 3 |
+
size 5265
|