Text Classification
Transformers
Safetensors
modernbert
ai-safety
safeguards
guardrails
text-embeddings-inference
Instructions to use dcarpintero/pangolin-guard-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dcarpintero/pangolin-guard-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="dcarpintero/pangolin-guard-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("dcarpintero/pangolin-guard-base") model = AutoModelForSequenceClassification.from_pretrained("dcarpintero/pangolin-guard-base", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
End of training
Browse filesFiles changed (4)
- README.mdAdded+81
- config.jsonAdded+56
- model.safetensorsAdded+3
- training_args.binAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081---library_name: transformerslicense: apache-2.0base_model: answerdotai/ModernBERT-basetags:- generated_from_trainermetrics:- f1- accuracymodel-index:- name: pangolin-guard-base results: []---
<!-- This model card has been generated automatically according to the information the Trainer had access to. Youshould probably proofread and complete it, then remove this comment. -->
# pangolin-guard-base
This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on an unknown dataset.It achieves the following results on the evaluation set:- Loss: 0.0216- F1: 0.9909- Accuracy: 0.9940
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:- learning_rate: 5e-05- train_batch_size: 64- eval_batch_size: 32- seed: 42- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments- lr_scheduler_type: linear- num_epochs: 2
### Training results
| Training Loss | Epoch | Step | Validation Loss | F1 | Accuracy ||:-------------:|:------:|:----:|:---------------:|:------:|:--------:|| 0.1786 | 0.1042 | 100 | 0.0687 | 0.9646 | 0.9765 || 0.0807 | 0.2083 | 200 | 0.0540 | 0.9709 | 0.9808 || 0.0479 | 0.3125 | 300 | 0.0486 | 0.9733 | 0.9824 || 0.043 | 0.4167 | 400 | 0.0495 | 0.9751 | 0.9833 || 0.0414 | 0.5208 | 500 | 0.0364 | 0.9824 | 0.9884 || 0.0369 | 0.625 | 600 | 0.0396 | 0.9791 | 0.9861 || 0.0341 | 0.7292 | 700 | 0.0292 | 0.9854 | 0.9904 || 0.0334 | 0.8333 | 800 | 0.0276 | 0.9860 | 0.9908 || 0.0278 | 0.9375 | 900 | 0.0272 | 0.9872 | 0.9916 || 0.0203 | 1.0417 | 1000 | 0.0277 | 0.9884 | 0.9924 || 0.012 | 1.1458 | 1100 | 0.0280 | 0.9897 | 0.9932 || 0.0118 | 1.25 | 1200 | 0.0268 | 0.9889 | 0.9926 || 0.0075 | 1.3542 | 1300 | 0.0270 | 0.9904 | 0.9937 || 0.0112 | 1.4583 | 1400 | 0.0300 | 0.9877 | 0.9918 || 0.0126 | 1.5625 | 1500 | 0.0233 | 0.9886 | 0.9924 || 0.0108 | 1.6667 | 1600 | 0.0214 | 0.9910 | 0.9941 || 0.0101 | 1.7708 | 1700 | 0.0222 | 0.9911 | 0.9941 || 0.0058 | 1.875 | 1800 | 0.0230 | 0.9911 | 0.9941 || 0.0095 | 1.9792 | 1900 | 0.0216 | 0.9909 | 0.9940 |
### Framework versions
- Transformers 4.48.3- Pytorch 2.6.0+cu124- Datasets 3.4.0- Tokenizers 0.21.01234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556{ "_name_or_path": "answerdotai/ModernBERT-base", "architectures": [ "ModernBertForSequenceClassification" ], "attention_bias": false, "attention_dropout": 0.0, "bos_token_id": 50281, "classifier_activation": "gelu", "classifier_bias": false, "classifier_dropout": 0.0, "classifier_pooling": "mean", "cls_token_id": 50281, "decoder_bias": true, "deterministic_flash_attn": false, "embedding_dropout": 0.0, "eos_token_id": 50282, "global_attn_every_n_layers": 3, "global_rope_theta": 160000.0, "gradient_checkpointing": false, "hidden_activation": "gelu", "hidden_size": 768, "id2label": { "0": "safe", "1": "unsafe" }, "initializer_cutoff_factor": 2.0, "initializer_range": 0.02, "intermediate_size": 1152, "label2id": { "safe": "0", "unsafe": "1" }, "layer_norm_eps": 1e-05, "local_attention": 128, "local_rope_theta": 10000.0, "max_position_embeddings": 8192, "mlp_bias": false, "mlp_dropout": 0.0, "model_type": "modernbert", "norm_bias": false, "norm_eps": 1e-05, "num_attention_heads": 12, "num_hidden_layers": 22, "pad_token_id": 50283, "position_embedding_type": "absolute", "problem_type": "single_label_classification", "reference_compile": true, "repad_logits_with_grad": false, "sep_token_id": 50282, "sparse_pred_ignore_index": -100, "sparse_prediction": false, "torch_dtype": "float32", "transformers_version": "4.48.3", "vocab_size": 50368}123version https://git-lfs.github.com/spec/v1oid sha256:6018f40a93f72a2f93c73dbb987e6ed9995eae52f4b6d76d7d5885a293e545cbsize 598439784123version https://git-lfs.github.com/spec/v1oid sha256:e1b815b19eec8d4d382b6ffaf2f2a5366fc1f24b46d943961bbafdf336f5fddbsize 5368README.mdAdded+81
config.jsonAdded+56
model.safetensorsAdded+3
training_args.binAdded+3