Downloads · 30 days
8
5% of all-time downloads
gopi30/phase-1-sft-legal-alligned
phase-1-sft-legal-alligned is a text generation model from gopi30. Use it when you need the model to write or continue text. It is set up for peft.
LegalSafe-Falcon-7B is a safety-aligned large language model fine-tuned for the Indian legal domain. The model focuses on reducing toxic, biased, and unsafe outputs while maintaining high accuracy in legal reasoning a…
Downloads · 30 days
8
5% of all-time downloads
All-time downloads
162
Public
Repo size
1.6 GB
Likes
0
Public
Click a slice to open those files.
.pt1 GB · 66%
From the Hugging Face model README
LegalSafe-Falcon-7B is a safety-aligned large language model fine-tuned for the Indian legal domain. The model focuses on reducing toxic, biased, and unsafe outputs while maintaining high accuracy in legal reasoning and responses. It integrates Constitutional AI principles and Reinforcement Learning from AI Feedback (RLAIF) to improve ethical alignment.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "gopi30/phase-1-sft-legal-alligned"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "Explain the concept of fundamental rights in Indian law."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0]))