Instructions to use marathi-llm/MahaMarathi-7B-v24.01-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use marathi-llm/MahaMarathi-7B-v24.01-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="marathi-llm/MahaMarathi-7B-v24.01-Base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("marathi-llm/MahaMarathi-7B-v24.01-Base") model = AutoModelForCausalLM.from_pretrained("marathi-llm/MahaMarathi-7B-v24.01-Base") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use marathi-llm/MahaMarathi-7B-v24.01-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "marathi-llm/MahaMarathi-7B-v24.01-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marathi-llm/MahaMarathi-7B-v24.01-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/marathi-llm/MahaMarathi-7B-v24.01-Base
- SGLang
How to use marathi-llm/MahaMarathi-7B-v24.01-Base 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 "marathi-llm/MahaMarathi-7B-v24.01-Base" \ --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": "marathi-llm/MahaMarathi-7B-v24.01-Base", "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 "marathi-llm/MahaMarathi-7B-v24.01-Base" \ --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": "marathi-llm/MahaMarathi-7B-v24.01-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use marathi-llm/MahaMarathi-7B-v24.01-Base with Docker Model Runner:
docker model run hf.co/marathi-llm/MahaMarathi-7B-v24.01-Base
MahaMarathi 7B, is a domain adapted, continually pre-trained, and instruction fine-tuned native Marathi large language model (LLM) with 7 billion parameters based on Llama2+Mistral, and trained on a large corpus of Marathi text.
महामराठी हे 7अब्ज पॅरामीटर्स वापरून पूर्व-प्रशिक्षित आणि सुचनांच्या आधारे फाईन ट्यून केलेले मूळ मराठी महाभाषा समीकरण संच आहे ज्याला लार्ज लँग्वेज मॉडेल (एल. एल. एम.) असेही म्हणतात. 83 दशलक्षाहून अधिक स्थानिक भाषिकांसाठी तयार केलेले हे कृत्रिम बुद्धिमत्तेवर (ए. आय.) आधारित तंत्रज्ञान आहे जे मराठीतील कठीण संभाषणे आणि सूचना सहज हाताळण्यास सक्षम आहे.
This released model is a base model and not meant to be used as is. It is recommended to first finetune it on downstream tasks that you are interested in.
# Usage
import torch
from transformers import LlamaTokenizer, LlamaForCausalLM
tokenizer = LlamaTokenizer.from_pretrained('marathi-llm/MahaMarathi-7B-v24.01-Base')
model = LlamaForCausalLM.from_pretrained('marathi-llm/MahaMarathi-7B-v24.01-Base', torch_dtype=torch.bfloat16)
prompt = "मी एक ए. आय. द्वारा तयार केलेले महाभाषा समीकरण संच आहे."
inputs = tokenizer(prompt, return_tensors="pt")
# Generate
generate_ids = model.generate(inputs.input_ids, max_length=30)
tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
| Example 1 | Example 2 |
|---|---|
![]() |
![]() |
- Downloads last month
- 40

