Downloads · 30 days
14
22% of all-time downloads
Prince-1/llama-3.2-3b-legal-india-qlora-v2
llama-3.2-3b-legal-india-qlora-v2 is a text generation model from Prince-1. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama3.2.
Fine-tuned Indian Legal AI | By Ambuj Kumar Tripathi
Downloads · 30 days
14
22% of all-time downloads
All-time downloads
64
Public
Repo size
163 MB
Likes
0
Public
Click a slice to open those files.
.safetensors97.3 MB · 60%
From the Hugging Face model README
Fine-tuned Indian Legal AI | By Ambuj Kumar Tripathi
QLoRA fine-tuned adapter for unsloth/Llama-3.2-3B-Instruct trained on 14,543 Indian Legal QA pairs covering IPC, CrPC, and the Constitution of India.
🚨 Please read before using this model.
This model was trained to validate the complete QLoRA → GGUF pipeline on zero-cost infrastructure (Kaggle Free GPU — 2x Tesla T4).
| Field | Value |
|---|---|
| Base Model | unsloth/Llama-3.2-3B-Instruct |
| Method | QLoRA — 4-bit + LoRA adapters |
| LoRA Rank | 16 |
| Trainable Params | 24.3M of 3.24B (0.75%) |
| Training Steps | 1,820 (full epoch) |
| Final Loss | 0.695 |
| Dataset | 14,543 Indian Legal QA pairs |
| GPU | 2x Tesla T4 (Kaggle Free) |
| Cost | ₹0 |
| Model | Link |
|---|---|
| 3B GGUF (CPU local) | Ambuj-Tripathi-Indian-Legal-Llama-3B-GGUF |
| 8B Adapter | llama-3.1-8b-legal-india-qlora-v2 |
| 1B Adapter | llama-3.2-1b-legal-india-qlora |
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "invincibleambuj/llama-3.2-3b-legal-india-qlora-v2",
max_seq_length = 2048,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
inputs = tokenizer(
"<|start_header_id|>system<|end_header_id|>\n\nYou are an Indian Legal AI Assistant built by Ambuj Kumar Tripathi.<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nWhat is IPC Section 302?<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>\n\n",
return_tensors="pt"
).to("cuda")
outputs = model.generate(**inputs, max_new_tokens=300, repetition_penalty=1.15)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
olive convert-adapters --adapter_path .\model\ --output_path legal-india --dtype float16
Exported adapter weights to onnx.onnx_adapter
This model was fine-tuned and deployed by Ambuj Kumar Tripathi for educational, research, and skill-development purposes only.
The training data used in this project was collected from publicly available legal-learning resources and a Kaggle dataset used strictly for learning, experimentation, and non-commercial fine-tuning. This repository and its releases are not intended to provide legal advice, are not offered as a commercial legal product, and should be treated as an experimental AI learning project.
⚠️ This model is provided strictly for educational, research, and skill-development purposes only. It does not constitute legal advice and should not be used for real-world legal compliance or proceedings. Outputs must be independently verified. Always consult a qualified advocate for specific legal matters.