Downloads · 30 days
7
18% of all-time downloads
Noshitha98/TinyLlama-ToS-Finetuned
TinyLlama-ToS-Finetuned is a text classification model from Noshitha98. Use it when you need a label for a piece of text. It is set up for peft.
A LoRA-finetuned version of TinyLlama-1.1B-Chat-v1.0 for detecting unfair / anomalous Terms of Service clauses. The model classifies clauses as Fair or Unfair based on anomalous patterns in legal text.
Downloads · 30 days
7
18% of all-time downloads
All-time downloads
39
Public
Repo size
5 MB
Likes
3
Public
Click a slice to open those files.
.safetensors4.5 MB · 52%
From the Hugging Face model README
A LoRA-finetuned version of TinyLlama-1.1B-Chat-v1.0 for detecting unfair / anomalous Terms of Service clauses. The model classifies clauses as Fair or Unfair based on anomalous patterns in legal text.
This model was finetuned with LoRA adapters. During training, only ~1.13M parameters were updated, while the 1.1B base model parameters remained frozen. The final uploaded model contains both the base weights and the adapter weights.
If you use this model in your research or work, please cite the following paper:
Juttu, Noshitha Padma Pratyusha. Text to Trust: Evaluating Fine-Tuning and LoRA Trade-Offs in Language Models for Unfair Terms of Service Detection. arXiv preprint arXiv:2510.22531, 2025.
https://arxiv.org/abs/2510.22531
Use this model as assistive tool, not for automated legal decision-making.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
adapter = "Noshitha98/TinyLlama-ToS-Finetuned"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base)
model = PeftModel.from_pretrained(model, adapter)
prompt = "<s>[CLAUSE]: You agree that we may suspend your account at any time. \n[Is this anomalous?]:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=5)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))