Downloads · 30 days
0
skhamzah123/llama-3.2-1b-prompt-tuning-twitter
llama-3.2-1b-prompt-tuning-twitter is a machine learning model from skhamzah123. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
libraryname: peft basemodel: meta-llama/Llama-3.2-1B tags: - prompt-tuning - text-classification - twitter - complaint-detection - peft datasets: - ought/raft language: - en license: llama3.2
Downloads · 30 days
0
Access
Public
Updated Nov 18, 2025
Repo size
17.3 MB
Likes
0
Public
Click a slice to open those files.
.json17.3 MB · 99%
From the Hugging Face model README
library_name: peft
base_model: meta-llama/Llama-3.2-1B
tags:
This model is a prompt-tuned version of Llama 3.2 1B for classifying tweets as "complaint" or "no complaint".
It uses PEFT (Parameter-Efficient Fine-Tuning) with prompt tuning, training only 8,192 parameters (~0.0015% of the base model).
meta-llama/Llama-3.2-1Bfrom peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
model = AutoPeftModelForCausalLM.from_pretrained(
"skhamzah123/llama-3.2-1b-prompt-tuning-tweet-peft"
).to("cuda")
tokenizer = AutoTokenizer.from_pretrained(
"skhamzah123/llama-3.2-1b-prompt-tuning-tweet-peft"
)
# Set pad token if missing
if tokenizer.pad_token_id is None:
tokenizer.pad_token = tokenizer.eos_token
tokenizer.pad_token_id = tokenizer.eos_token_id
# Classify a tweet
tweet = "@customer_service This is unacceptable! Still waiting for help."
inputs = tokenizer(f"Tweet text : {tweet} Label : ", return_tensors="pt").to("cuda")
outputs = model.generate(
input_ids=inputs["input_ids"],
max_new_tokens=10,
pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
ought/raft – Twitter Complaints subsetcomplaint, no complaint| Parameter | Value |
|---|---|
| Learning Rate | 3e-2 |
| Epochs | 50 |
| Batch Size | 16 (train & eval) |
| Max Seq Length | 64 |
| Optimizer | AdamW |
| Trainer | TRL SFTTrainer |
| Setting | Value |
|---|---|
| Init Text | "Classify if the tweet is a complaint or no complaint. |
| " | |
| Virtual Tokens | 13 |
| Init Method | TEXT |
The model efficiently classifies tweets into complaint vs. no complaint with minimal computational overhead due to prompt tuning.
Primary Use:
Automated classification of customer-service-related tweets to detect complaints for routing, analysis, or prioritization.
If you use this model, feel free to ⭐ star the repo and share feedback!