Instructions to use varma007ut/Indian_Legal_Assitant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use varma007ut/Indian_Legal_Assitant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="varma007ut/Indian_Legal_Assitant")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("varma007ut/Indian_Legal_Assitant") model = AutoModelForCausalLM.from_pretrained("varma007ut/Indian_Legal_Assitant") - llama-cpp-python
How to use varma007ut/Indian_Legal_Assitant with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="varma007ut/Indian_Legal_Assitant", filename="outpt_file.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use varma007ut/Indian_Legal_Assitant with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf varma007ut/Indian_Legal_Assitant # Run inference directly in the terminal: llama-cli -hf varma007ut/Indian_Legal_Assitant
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf varma007ut/Indian_Legal_Assitant # Run inference directly in the terminal: llama-cli -hf varma007ut/Indian_Legal_Assitant
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf varma007ut/Indian_Legal_Assitant # Run inference directly in the terminal: ./llama-cli -hf varma007ut/Indian_Legal_Assitant
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf varma007ut/Indian_Legal_Assitant # Run inference directly in the terminal: ./build/bin/llama-cli -hf varma007ut/Indian_Legal_Assitant
Use Docker
docker model run hf.co/varma007ut/Indian_Legal_Assitant
- LM Studio
- Jan
- vLLM
How to use varma007ut/Indian_Legal_Assitant with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "varma007ut/Indian_Legal_Assitant" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "varma007ut/Indian_Legal_Assitant", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/varma007ut/Indian_Legal_Assitant
- SGLang
How to use varma007ut/Indian_Legal_Assitant 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 "varma007ut/Indian_Legal_Assitant" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "varma007ut/Indian_Legal_Assitant", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "varma007ut/Indian_Legal_Assitant" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "varma007ut/Indian_Legal_Assitant", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use varma007ut/Indian_Legal_Assitant with Ollama:
ollama run hf.co/varma007ut/Indian_Legal_Assitant
- Unsloth Studio new
How to use varma007ut/Indian_Legal_Assitant 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 varma007ut/Indian_Legal_Assitant 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 varma007ut/Indian_Legal_Assitant to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for varma007ut/Indian_Legal_Assitant to start chatting
- Docker Model Runner
How to use varma007ut/Indian_Legal_Assitant with Docker Model Runner:
docker model run hf.co/varma007ut/Indian_Legal_Assitant
- Lemonade
How to use varma007ut/Indian_Legal_Assitant with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull varma007ut/Indian_Legal_Assitant
Run and chat with the model
lemonade run user.Indian_Legal_Assitant-{{QUANT_TAG}}List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf varma007ut/Indian_Legal_Assitant# Run inference directly in the terminal:
llama-cli -hf varma007ut/Indian_Legal_AssitantUse pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf varma007ut/Indian_Legal_Assitant# Run inference directly in the terminal:
./llama-cli -hf varma007ut/Indian_Legal_AssitantBuild from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf varma007ut/Indian_Legal_Assitant# Run inference directly in the terminal:
./build/bin/llama-cli -hf varma007ut/Indian_Legal_AssitantUse Docker
docker model run hf.co/varma007ut/Indian_Legal_AssitantIndian Legal Assistant: A LLaMA-based Model for Indian Legal Text Generation
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.
Faculty In Charge
- Guide: Dr. Kalimuthu K
- Project Coordinator: Dr. Sandeep Kumar P
Team Members
- RA2111004010006: Ganesha Sai Varma
- RA2111004010008: Surendra Reddy
- RA2111004010055: Sampath Voona
Model Description
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:
- Legal question answering
- Case summarization
- Legal document analysis
- Statute interpretation
Model Details
| 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 |
Installation
To use this model, you'll need to install the required libraries:
pip install transformers torch
# For GGUF support
pip install llama-cpp-python
Usage
There are several ways to use the Indian Legal Assistant model:
1. Using Hugging Face Pipeline
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'])
2. Using Hugging Face Transformers directly
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]))
3. Using GGUF format with llama-cpp-python
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'])
4. Using Inference Endpoints
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.
Evaluation
To evaluate the model's performance:
- Prepare a test set of Indian legal queries or tasks.
- Use standard NLP evaluation metrics such as perplexity, BLEU score, or task-specific metrics.
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)
Contributing
We welcome contributions to improve the model or extend its capabilities. Please see our Contributing Guidelines for more details.
License
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.
- Downloads last month
- 1,905
We're not able to determine the quantization variants.
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf varma007ut/Indian_Legal_Assitant# Run inference directly in the terminal: llama-cli -hf varma007ut/Indian_Legal_Assitant