Qwen 2.5 3B - Indian Law QA

Model Details

  • Model Name: aaghaazkhan/qwen2.5-3b-indian-law-instruct
  • Base Model: Qwen 2.5 3B
  • License: MIT
  • Library: transformers
  • Language: English
  • Fine-Tuned By: Aaghaaz Khan
  • Task: Question Answering, Instruction Fine-Tuning

Model Description

This model is fine-tuned on Indian legal QA using instruction fine-tuning. It helps answer legal queries based on Indian law.

Prompt Format Chat Format (Qwen-style)

[
    {"role": "system", "content": "You are a legal expert."},
    {"role": "user", "content": "What is Article 21 of the Indian Constitution?"}
]

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "aaghaazkhan/qwen2.5-3b-indian-law-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

messages = [
    {"role": "system", "content": "You are a legal expert."},
    {"role": "user", "content": "What is Article 21 of the Indian Constitution?"}
]

input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt")
output = model.generate(input_ids, max_new_tokens=200)
print(tokenizer.decode(output[0], skip_special_tokens=True))

Evaluation Metrics

Perplexity: 0.303

Perplexity: 1.354

Downloads last month
23
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for aaghaazkhan/Qwen2.5-3B-law-instruct

Base model

Qwen/Qwen2.5-3B
Finetuned
(858)
this model
Quantizations
3 models

Dataset used to train aaghaazkhan/Qwen2.5-3B-law-instruct