Instructions to use kmeanskaran/IPC-gemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kmeanskaran/IPC-gemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kmeanskaran/IPC-gemma") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kmeanskaran/IPC-gemma") model = AutoModelForCausalLM.from_pretrained("kmeanskaran/IPC-gemma") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kmeanskaran/IPC-gemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kmeanskaran/IPC-gemma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kmeanskaran/IPC-gemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kmeanskaran/IPC-gemma
- SGLang
How to use kmeanskaran/IPC-gemma 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 "kmeanskaran/IPC-gemma" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kmeanskaran/IPC-gemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "kmeanskaran/IPC-gemma" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kmeanskaran/IPC-gemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kmeanskaran/IPC-gemma with Docker Model Runner:
docker model run hf.co/kmeanskaran/IPC-gemma
Model Card for Model ID
Model Description
IPC-Gemma: AI Model for Indian Legal Code Analysis
IPC-Gemma is an advanced AI model designed to assist with tasks related to the Indian Penal Code (IPC). Trained on a comprehensive dataset of IPC sections and legal case information, this model is capable of analyzing textual descriptions of illegal activities and providing relevant insights.
Key features of IPC-Gemma:
IPC Section Lookup: Given a description of an illegal act, the model can quickly identify the corresponding IPC section that covers that offense.
Offense and Punishment Prediction: Based on the input description, IPC-Gemma can predict the specific offense committed and the associated punishment or penalty.
Interpretable Outputs: Along with the predicted offense and punishment, the model provides the relevant IPC section details to offer transparency and context around its analysis.
Legal Domain Expertise: Leveraging the Gemma language model architecture, IPC-Gemma has been fine-tuned to excel in understanding and reasoning about legal terminology and concepts.
This model is particularly useful for legal professionals, law enforcement agencies, and individuals seeking to better understand the Indian legal system. By automating the process of identifying offenses and their corresponding punishments, IPC-Gemma can save time, improve accuracy, and enhance decision-making in a variety of legal and criminal justice applications.
Whether you need to quickly look up the relevant IPC section for a given scenario or analyze the potential consequences of an illegal act, IPC-Gemma is a powerful AI tool that can provide valuable insights and support.
- Developed by: Karan Shingde
- Language(s) (NLP): English
- Finetuned from model: google/gemma-2b-it
Training Data
Training Data Link: https://huggingface.co/datasets/karan842/ipc-sections
Hardware
Kaggle GPU-P100
Model Card Authors [optional]
Karan Shingde: karanshindgde@gmail.com
- Downloads last month
- 5