Instructions to use advy/phi-2-hate-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use advy/phi-2-hate-classifier with PEFT:
from peft import PeftModel from transformers import AutoModelForSequenceClassification base_model = AutoModelForSequenceClassification.from_pretrained("microsoft/phi-2") model = PeftModel.from_pretrained(base_model, "advy/phi-2-hate-classifier") - Transformers
How to use advy/phi-2-hate-classifier with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("advy/phi-2-hate-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from advy/phi-2-hate-classifier: direct link, hf CLI and curl.
- Browser
- Download file 1.61 kB
-
https://huggingface.co/advy/phi-2-hate-classifier/resolve/main/README.md
- Command line
-
hf download hf://advy/phi-2-hate-classifier/README.md
-
curl -L -o README.md https://huggingface.co/advy/phi-2-hate-classifier/resolve/main/README.md
1.61 kB
metadata
base_model: microsoft/phi-2
library_name: peft
license: mit
tags:
- base_model:adapter:microsoft/phi-2
- lora
- transformers
model-index:
- name: phi-2-hate-classifier
results: []
phi-2-hate-classifier
This model is a fine-tuned version of microsoft/phi-2 on an unknown dataset. It achieves the following results on the evaluation set:
- Loss: 0.5518
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: 0.0002
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 5
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.5294 | 1.0 | 450 | 0.4561 |
| 0.3573 | 2.0 | 900 | 0.4084 |
| 0.0945 | 3.0 | 1350 | 0.5058 |
| 0.0021 | 4.0 | 1800 | 0.5769 |
| 0.2353 | 5.0 | 2250 | 0.5518 |
Framework versions
- PEFT 0.17.1
- Transformers 4.46.3
- Pytorch 2.8.0+cu128
- Datasets 2.17.0
- Tokenizers 0.20.0