Downloads · 30 days
0
yamraj047/ultra-nepal-legal-mistral-7b
ultra-nepal-legal-mistral-7b is a text generation model from yamraj047. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
A Mistral 7B model fine-tuned specifically for Nepal legal system queries, with focus on the National Penal Code 2017.
Downloads · 30 days
0
Access
Public
Updated Jan 29, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md5.8 KB · 79%
From the Hugging Face model README
A Mistral 7B model fine-tuned specifically for Nepal legal system queries, with focus on the National Penal Code 2017.
This model is based on Mistral-7B-v0.1 and has been fine-tuned using LoRA (Low-Rank Adaptation) on 6,400 Nepal legal instruction-following examples. It can explain legal provisions, answer questions about Nepal law, and provide summaries of legal concepts in simple language.
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained("yamraj047/ultra-nepal-legal-mistral-7b")
tokenizer = AutoTokenizer.from_pretrained("yamraj047/ultra-nepal-legal-mistral-7b")
# Ask a legal question
prompt = """### Instruction:
Explain this legal provision in simple language.
### Input:
What is the punishment for theft under National Penal Code 2017?
### Response:
"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
# Extract just the answer
answer = response.split("### Response:")[-1].strip()
print(answer)
The model can answer questions like:
For best results, use this format:
### Instruction:
[What you want the model to do - e.g., "Explain this in simple language"]
### Input:
[Your specific legal question]
### Response:
Q: What is the punishment for theft under National Penal Code 2017?
The punishment for theft under National Penal Code 2017 is imprisonment for up to seven years and a fine of up to seventy thousand rupees. This means that if someone steals something, they could end up spending time in prison and having to pay a large fine.
Q: Explain the scope and jurisdiction of National Penal Code 2017
National Penal Code 2017 is the primary criminal law of Nepal, which sets out the criminal offenses and their corresponding punishments. The code applies to all crimes committed within the territory of Nepal, including those committed by Nepalese citizens or foreigners...
⚠️ IMPORTANT DISCLAIMERS:
Not Legal Advice: This model provides general legal information but is NOT a substitute for professional legal advice. Always consult qualified legal professionals for legal matters.
Training Data Limitations:
Language: Primarily trained on English text with Nepal legal terminology. May not perform well on queries in Nepali language.
Accuracy: While the model performs well on test cases, it can still make mistakes or hallucinate information. Always verify important legal information.
Bias: May reflect biases present in the training data.
✅ Appropriate Uses:
❌ Inappropriate Uses:
If you use this model in your research or application, please cite:
@misc{nepal-legal-mistral-7b,
author = {yamraj047},
title = {Nepal Legal Mistral 7B},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/yamraj047/ultra-nepal-legal-mistral-7b}
}
This model is released under the Apache 2.0 license, same as the base Mistral model.
For questions, issues, or feedback about this model, please open an issue on the model repository.
Disclaimer: This is an AI model for educational and research purposes. It does not provide legal advice and should not be used as a substitute for consultation with qualified legal professionals.