Downloads · 30 days
5
9% of all-time downloads
Amaanaliii/nemotron-safety-guard-hi-en
nemotron-safety-guard-hi-en is a machine learning model from Amaanaliii. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as other.
QLoRA fine-tune of nvidia/Llama-3.1-Nemotron-Safety-Guard-8B-v3 for Hindi and English content safety classification.
Downloads · 30 days
5
9% of all-time downloads
All-time downloads
55
Public
Repo size
30.9 MB
Likes
0
Public
Click a slice to open those files.
.json17.3 MB · 56%
From the Hugging Face model README
QLoRA fine-tune of nvidia/Llama-3.1-Nemotron-Safety-Guard-8B-v3 for Hindi and English content safety classification.
the original model supports 9 languages. this fine-tune specializes it for hindi (hi) and english (en) only,
trained on a balanced sample from the Nemotron-Safety-Guard-Dataset-v3.
| base model | nvidia/Llama-3.1-Nemotron-Safety-Guard-8B-v3 |
| method | QLoRA (4-bit, nf4) |
| lora rank | 8 |
| lora alpha | 32 |
| target modules | q_proj, v_proj |
| trainable params | 3.4M (LoRA adapters, 4-bit compressed) |
| languages | English, Hindi |
| training samples | 1000 (balanced) |
| epochs | 1 |
| learning rate | 2e-4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch, json
base_model_id = "nvidia/Llama-3.1-Nemotron-Safety-Guard-8B-v3"
adapter_id = "Amaanaliii/nemotron-safety-guard-hi-en"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
model = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype=torch.float16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter_id)
model.eval()
{"User Safety": "safe" | "unsafe", "Response Safety": "safe" | "unsafe", "Safety Categories": "Violence, ..."}
Response Safety and Safety Categories are omitted when not applicable.