Text Classification
Transformers
Safetensors
modernbert
Generated from Trainer
text-embeddings-inference
Run this model with HF Jobs
Run P0u4a/ModernBERT-bash-classifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/P0u4a/ModernBERT-bash-classifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/P0u4a/ModernBERT-bash-classifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use P0u4a/ModernBERT-bash-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use P0u4a/ModernBERT-bash-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="P0u4a/ModernBERT-bash-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("P0u4a/ModernBERT-bash-classifier") model = AutoModelForSequenceClassification.from_pretrained("P0u4a/ModernBERT-bash-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
End of training
Browse filesFiles changed (6)
- README.mdAdded+72
- config.jsonAdded+86
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+17
- training_args.binAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172---library_name: transformerslicense: apache-2.0base_model: answerdotai/ModernBERT-basetags:- generated_from_trainermetrics:- f1- precision- recall- accuracymodel-index:- name: ModernBERT-bash-classifier 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. -->
# ModernBERT-bash-classifier
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.2624- F1: 0.9515- Precision: 0.9608- Recall: 0.9423- Accuracy: 0.9864
## 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: 2e-05- train_batch_size: 16- eval_batch_size: 16- 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: 5- mixed_precision_training: Native AMP
### Training results
| Training Loss | Epoch | Step | Validation Loss | F1 | Precision | Recall | Accuracy ||:-------------:|:-----:|:----:|:---------------:|:------:|:---------:|:------:|:--------:|| 0.1074 | 1.0 | 184 | 0.0978 | 0.9074 | 0.875 | 0.9423 | 0.9728 || 0.0633 | 2.0 | 368 | 0.0335 | 0.9808 | 0.9808 | 0.9808 | 0.9946 || 0.0267 | 3.0 | 552 | 0.0268 | 0.9903 | 1.0 | 0.9808 | 0.9973 || 0.0000 | 4.0 | 736 | 0.0636 | 0.9804 | 1.0 | 0.9615 | 0.9946 || 0.0000 | 5.0 | 920 | 0.0677 | 0.9804 | 1.0 | 0.9615 | 0.9946 |
### Framework versions
- Transformers 5.10.2- Pytorch 2.11.0+cu128- Datasets 4.0.0- Tokenizers 0.22.21234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586{ "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, "dtype": "float32", "embedding_dropout": 0.0, "eos_token_id": 50282, "global_attn_every_n_layers": 3, "gradient_checkpointing": false, "hidden_activation": "gelu", "hidden_size": 768, "id2label": { "0": "unsafe", "1": "safe" }, "initializer_cutoff_factor": 2.0, "initializer_range": 0.02, "intermediate_size": 1152, "label2id": { "safe": 1, "unsafe": 0 }, "layer_norm_eps": 1e-05, "layer_types": [ "full_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "full_attention", "sliding_attention", "sliding_attention", "full_attention" ], "local_attention": 128, "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", "rope_parameters": { "full_attention": { "rope_theta": 160000.0, "rope_type": "default" }, "sliding_attention": { "rope_theta": 10000.0, "rope_type": "default" } }, "sep_token_id": 50282, "sparse_pred_ignore_index": -100, "sparse_prediction": false, "tie_word_embeddings": true, "transformers_version": "5.10.2", "use_cache": false, "vocab_size": 50368}123version https://git-lfs.github.com/spec/v1oid sha256:b4a71c385cd467a9b581d5aed55e161579142bc82587a8db2658666096f7cb12size 5984397841234567891011121314151617{ "backend": "tokenizers", "clean_up_tokenization_spaces": true, "cls_token": "[CLS]", "is_local": false, "local_files_only": false, "mask_token": "[MASK]", "model_input_names": [ "input_ids", "attention_mask" ], "model_max_length": 8192, "pad_token": "[PAD]", "sep_token": "[SEP]", "tokenizer_class": "TokenizersBackend", "unk_token": "[UNK]"}123version https://git-lfs.github.com/spec/v1oid sha256:4671cf7ebca0be3e532eff7bdebbef504abf9d245eaaf4371ea6224fcbf2c0f4size 5201README.mdAdded+72
config.jsonAdded+86
model.safetensorsAdded+3
tokenizer.jsonAdded
tokenizer_config.jsonAdded+17
training_args.binAdded+3