Downloads · 30 days
163
1% of all-time downloads
varma007ut/Indian_Legal_Assitant
Indian_Legal_Assitant is a text generation model from varma007ut. 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.
This repository contains information and code for using the Indian Legal Assistant, a LLaMA-based model finetuned on Indian legal texts. This model is designed to assist with various legal tasks and queries related to…
Downloads · 30 days
163
1% of all-time downloads
All-time downloads
20.5K
Public
Repo size
40.7 GB
Likes
25
Public
Click a slice to open those files.
.bin16.1 GB · 65%
From the Hugging Face model README
This repository contains information and code for using the Indian Legal Assistant, a LLaMA-based model finetuned on Indian legal texts. This model is designed to assist with various legal tasks and queries related to Indian law.
The Indian Legal Assistant is a text generation model specifically trained to understand and generate text related to Indian law. It can be used for tasks such as:
| Attribute | Value |
|---|---|
| Model Name | Indian_Legal_Assitant |
| Developer | varma007ut |
| Model Size | 8.03B parameters |
| Architecture | LLaMA |
| Language | English |
| License | Apache 2.0 |
| Hugging Face Repo | varma007ut/Indian_Legal_Assitant |
To use this model, you'll need to install the required libraries:
pip install transformers torch
# For GGUF support
pip install llama-cpp-python
There are several ways to use the Indian Legal Assistant model:
from transformers import pipeline
pipe = pipeline("text-generation", model="varma007ut/Indian_Legal_Assitant")
prompt = "Summarize the key points of the Indian Contract Act, 1872:"
result = pipe(prompt, max_length=200)
print(result[0]['generated_text'])
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("varma007ut/Indian_Legal_Assitant")
model = AutoModelForCausalLM.from_pretrained("varma007ut/Indian_Legal_Assitant")
prompt = "What are the fundamental rights in the Indian Constitution?"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=200)
print(tokenizer.decode(outputs[0]))
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="varma007ut/Indian_Legal_Assitant",
filename="ggml-model-q4_0.gguf", # Replace with the actual GGUF filename if different
)
response = llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "Explain the concept of judicial review in India."
}
]
)
print(response['choices'][0]['message']['content'])
This model supports Hugging Face Inference Endpoints. You can deploy the model and use it via API calls. Refer to the Hugging Face documentation for more information on setting up and using Inference Endpoints.
To evaluate the model's performance:
Example using BLEU score:
from datasets import load_metric
bleu = load_metric("bleu")
predictions = model.generate(encoded_input)
results = bleu.compute(predictions=predictions, references=references)
We welcome contributions to improve the model or extend its capabilities. Please see our Contributing Guidelines for more details.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Note: While this model is based on the LLaMA architecture, it has been finetuned on Indian legal texts. Ensure compliance with all relevant licenses and terms of use when using this model.