--- base_model: unsloth/meta-llama-3.1-8b-bnb-4bit language: - en license: apache-2.0 tags: - text-generation-inference - transformers - unsloth - llama - trl - sft --- Indian Legal Assistant: A LLaMA-based Model for Indian Legal Text Generation This repository contains information and code for the Indian Legal Assistant, a LLaMA-based model finetuned on Indian legal texts. The model is designed to assist with various legal tasks and queries related to Indian law. Table of Contents Model Description Model Details Installation Usage Evaluation Contributing License Model Description The Indian Legal Assistant is a text generation model specifically trained to understand and generate text related to Indian law. It is suitable for various legal tasks such as: Legal question answering Case summarization Legal document analysis Statute interpretation Model Details Model Name: Indian_Legal_Assistant Developer: varma007ut Model Size: 8.03B parameters Architecture: LLaMA Language: English License: Apache 2.0 Hugging Face Repository: varma007ut/Indian_Legal_Assistant Installation To use this model, install the required libraries: bash Copy code 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 python Copy code from transformers import pipeline pipe = pipeline("text-generation", model="varma007ut/Indian_Legal_Assistant") 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 python Copy code from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("varma007ut/Indian_Legal_Assistant") model = AutoModelForCausalLM.from_pretrained("varma007ut/Indian_Legal_Assistant") 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 python Copy code from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="varma007ut/Indian_Legal_Assistant", 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.