Text Generation
Transformers
Safetensors
PEFT
English
legal-ai
lora
qlora
indian-law
legal-simplification
accessibility
irac
unsloth
conversational
Instructions to use joyboseroy/nyayasaar-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use joyboseroy/nyayasaar-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="joyboseroy/nyayasaar-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("joyboseroy/nyayasaar-lora", dtype="auto") - PEFT
How to use joyboseroy/nyayasaar-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use joyboseroy/nyayasaar-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "joyboseroy/nyayasaar-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "joyboseroy/nyayasaar-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/joyboseroy/nyayasaar-lora
- SGLang
How to use joyboseroy/nyayasaar-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "joyboseroy/nyayasaar-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "joyboseroy/nyayasaar-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "joyboseroy/nyayasaar-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "joyboseroy/nyayasaar-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use joyboseroy/nyayasaar-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for joyboseroy/nyayasaar-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for joyboseroy/nyayasaar-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for joyboseroy/nyayasaar-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="joyboseroy/nyayasaar-lora", max_seq_length=2048, ) - Docker Model Runner
How to use joyboseroy/nyayasaar-lora with Docker Model Runner:
docker model run hf.co/joyboseroy/nyayasaar-lora
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,64 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: unsloth/Qwen2.5-0.5B-Instruct-bnb-4bit
|
| 4 |
+
tags:
|
| 5 |
+
- legal-ai
|
| 6 |
+
- lora
|
| 7 |
+
- peft
|
| 8 |
+
- qlora
|
| 9 |
+
- indian-law
|
| 10 |
+
- legal-simplification
|
| 11 |
+
- accessibility
|
| 12 |
+
- irac
|
| 13 |
+
- transformers
|
| 14 |
+
- unsloth
|
| 15 |
+
language:
|
| 16 |
+
- en
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
datasets:
|
| 19 |
+
- joyboseroy/inIRAC
|
| 20 |
+
library_name: transformers
|
| 21 |
---
|
| 22 |
+
|
| 23 |
+
# NyayaSaar-LoRA
|
| 24 |
+
|
| 25 |
+
NyayaSaar-LoRA is a lightweight LoRA adapter fine-tuned to simplify structured Indian legal reasoning into plain English.
|
| 26 |
+
|
| 27 |
+
The project focuses on improving accessibility to legal reasoning for non-lawyers interacting with the Indian legal system.
|
| 28 |
+
|
| 29 |
+
This model was trained using parameter-efficient fine-tuning (LoRA/QLoRA) on structured IRAC-style legal reasoning examples derived from the inIRAC dataset.
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
# Motivation
|
| 34 |
+
|
| 35 |
+
Indian legal documents are often difficult for ordinary citizens to understand because of:
|
| 36 |
+
|
| 37 |
+
- archaic terminology,
|
| 38 |
+
- procedural complexity,
|
| 39 |
+
- dense sentence structures,
|
| 40 |
+
- and formal legal phrasing.
|
| 41 |
+
|
| 42 |
+
NyayaSaar-LoRA explores whether small language models can learn to preserve legal meaning while simplifying language and improving readability.
|
| 43 |
+
|
| 44 |
+
The project prioritizes:
|
| 45 |
+
|
| 46 |
+
- accessibility,
|
| 47 |
+
- explainability,
|
| 48 |
+
- low-resource adaptation,
|
| 49 |
+
- and efficient fine-tuning.
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
# Example
|
| 54 |
+
|
| 55 |
+
## Input
|
| 56 |
+
|
| 57 |
+
```text
|
| 58 |
+
Issue: Whether the detention order violates Article 22.
|
| 59 |
+
|
| 60 |
+
Rule: Preventive detention laws require procedural safeguards.
|
| 61 |
+
|
| 62 |
+
Application: The petitioner argued safeguards were not followed.
|
| 63 |
+
|
| 64 |
+
Conclusion: The detention order is quashed.
|