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 special_tokens_map.json from advy/phi-2-hate-classifier: direct link, hf CLI and curl.
- Browser
- Download file 473 Bytes
-
https://huggingface.co/advy/phi-2-hate-classifier/resolve/main/special_tokens_map.json
- Command line
-
hf download hf://advy/phi-2-hate-classifier/special_tokens_map.json
-
curl -L -o special_tokens_map.json https://huggingface.co/advy/phi-2-hate-classifier/resolve/main/special_tokens_map.json
473 Bytes
| { | |
| "bos_token": { | |
| "content": "<|endoftext|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "eos_token": { | |
| "content": "<|endoftext|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "pad_token": "<|endoftext|>", | |
| "unk_token": { | |
| "content": "<|endoftext|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| } | |
| } | |