YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
from huggingface_hub import HfApi
readme_text = """
πΏ Gemma-3-4B LoRA β Emotion + Toxicity Core (v1)
Author: Shaima Z. Alzubi
Base model: google/gemma-3-4b-it
Technique: LoRA (Low-Rank Adaptation)
Trained Cores: Core-1 (Emotions) + Core-2 (Toxicity)
π§ Overview
This model adapts Gemma-3-4B-IT using a dual-core dataset:
| Core | Domain | Objective | Size |
|---|---|---|---|
| π©΅ Core-1 | Emotion understanding | Detect human emotional states from text | 49K |
| π’ Core-2 | Toxicity moderation | Detect & rephrase toxic or disrespectful content | 65K |
The LoRA improves emotional recognition and safe conversational tone, making the base Gemma more empathetic and socially aware.
π¬ Example Usage
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
from peft import PeftModel
base = "google/gemma-3-4b-it"
adapter = "Shaimaz/gemma3_4B_LoRA_Emotion_Toxicity_v1"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base)
model = PeftModel.from_pretrained(model, adapter)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
prompt = "Detect the emotion or toxicity in this text and respond kindly:\\n\\nYou are so annoying!"
print(pipe(prompt, max_new_tokens=60)[0]['generated_text'])
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support