L3Cube-MahaNLP: Marathi Natural Language Processing Datasets, Models, and Library
Paper • 2205.14728 • Published
How to use l3cube-pune/marathi-gpt-gemma-7b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="l3cube-pune/marathi-gpt-gemma-7b") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("l3cube-pune/marathi-gpt-gemma-7b")
model = AutoModelForCausalLM.from_pretrained("l3cube-pune/marathi-gpt-gemma-7b")How to use l3cube-pune/marathi-gpt-gemma-7b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "l3cube-pune/marathi-gpt-gemma-7b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "l3cube-pune/marathi-gpt-gemma-7b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/l3cube-pune/marathi-gpt-gemma-7b
How to use l3cube-pune/marathi-gpt-gemma-7b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "l3cube-pune/marathi-gpt-gemma-7b" \
--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": "l3cube-pune/marathi-gpt-gemma-7b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "l3cube-pune/marathi-gpt-gemma-7b" \
--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": "l3cube-pune/marathi-gpt-gemma-7b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use l3cube-pune/marathi-gpt-gemma-7b with Docker Model Runner:
docker model run hf.co/l3cube-pune/marathi-gpt-gemma-7b
MahaGemma-7B is a Marathi Gemma model. It is a Gemma 7B (google/gemma-7b) model LoRA fine-tuned on translated Marathi datasets. [dataset link] (https://github.com/l3cube-pune/MarathiNLP)
This is part of the MahaNLP initiative. More details coming soon.
Prompt format:
<bos>\n### Instruction:\nमहाराष्ट्राची राजधानी काय आहे?\n\n### Input:\n\n\n### Response:\nमहाराष्ट्राची राजधानी मुंबई आहे
Citing
@article{joshi2022l3cube,
title={L3cube-mahanlp: Marathi natural language processing datasets, models, and library},
author={Joshi, Raviraj},
journal={arXiv preprint arXiv:2205.14728},
year={2022}
}
Model Family:
MahaGemma-2B
MahaGemma-7B