Downloads · 30 days
15
28% of all-time downloads
SabihaK/ipc-legal-qwen-1.5b
ipc-legal-qwen-1.5b is a text generation model from SabihaK. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This is a fine-tuned version of Qwen/Qwen2.5-1.5B-Instruct specialized for providing information about the Indian Penal Code (IPC). The model has been trained to assist with legal queries related to IPC sections, offe…
Downloads · 30 days
15
28% of all-time downloads
All-time downloads
53
Public
Repo size
85.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors73.9 MB · 82%
From the Hugging Face model README
This is a fine-tuned version of Qwen/Qwen2.5-1.5B-Instruct specialized for providing information about the Indian Penal Code (IPC). The model has been trained to assist with legal queries related to IPC sections, offenses, and punishments.
This model is designed for:
Important: This model is for informational purposes only and does not constitute legal advice. Always consult qualified legal professionals for specific legal matters.
LoRA (Low-Rank Adaptation) Configuration:
pip install transformers torch peft
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load model and tokenizer
model_name = "SabihaK/ipc-legal-qwen-1.5b"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_name,
trust_remote_code=True,
torch_dtype=torch.float16,
device_map="auto"
)
# Prepare conversation
conversation = [
{
"role": "system",
"content": "You are an expert legal assistant specializing in Indian Penal Code."
},
{
"role": "user",
"content": "What is Section 302 of the Indian Penal Code?"
}
]
# Generate response
prompt = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=200,
temperature=0.7,
do_sample=True,
top_p=0.9,
repetition_penalty=1.1
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
The model demonstrates strong performance in:
@misc{ipc-legal-qwen-2025,
author = {SabihaK},
title = {IPC Legal Assistant - Qwen 2.5 1.5B Fine-tuned},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/SabihaK/ipc-legal-qwen-1.5b}},
}
This model is released under the Apache 2.0 License, consistent with the base Qwen model.
For questions or issues, please open a discussion on this model's Hugging Face page.
Model Version: 1.0
Release Date: October 2025
Base Model: Qwen/Qwen2.5-1.5B-Instruct