Instructions to use CoRover/BharatGPT-3B-Indic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CoRover/BharatGPT-3B-Indic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CoRover/BharatGPT-3B-Indic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, LlamaForCasualLM tokenizer = AutoTokenizer.from_pretrained("CoRover/BharatGPT-3B-Indic") model = LlamaForCasualLM.from_pretrained("CoRover/BharatGPT-3B-Indic") 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
- vLLM
How to use CoRover/BharatGPT-3B-Indic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CoRover/BharatGPT-3B-Indic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CoRover/BharatGPT-3B-Indic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CoRover/BharatGPT-3B-Indic
- SGLang
How to use CoRover/BharatGPT-3B-Indic 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 "CoRover/BharatGPT-3B-Indic" \ --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": "CoRover/BharatGPT-3B-Indic", "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 "CoRover/BharatGPT-3B-Indic" \ --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": "CoRover/BharatGPT-3B-Indic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CoRover/BharatGPT-3B-Indic with Docker Model Runner:
docker model run hf.co/CoRover/BharatGPT-3B-Indic
Model Description
This model is fine-tuned and designed to generate multilingual outputs across multiple Indic languages. The model has been trained on a diverse and curated dataset comprising Hindi, Punjabi, Marathi, Malayalam, Oriya, Kannada, Gujarati, Bengali, Urdu, Tamil, and Telugu. It is optimized to handle natural language tasks such as translation, summarization, and conversational generation across these languages. This model is trained on authentic Indian conversational data in 12 languages. However, it is not designed for direct use as a standalone chatbot, as it lacks the latest data updates. It is best suited for S-RAG (Secure Retrieval-Augmented Generation) or fine-tuning with your own data. For enhanced performance, integration with Conversational Gen AI platform is recommended (though not mandatory). This platform enables the creation of multi-modal and multi-lingual AI Agents, Co-Pilots, and Virtual Assistants (such as ChatBots, VoiceBots, and VideoBots) using a sovereign AI and composite AI approach. It leverages classic NLP, grounded generative AI, and Generally Available LLMs to deliver powerful, versatile solutions.
- Developed by: CoRover.ai
- Model type: Finetuned (Language Model for Multilingual Text Generation and Text Completion)
- Language(s) (NLP): Hindi, Punjabi, Marathi, Malayalam, Oriya, Kannada, Gujarati, Bengali, Urdu, Tamil, Telugu
- Learn (Become C-CAP: CoRover Certified AI Professional): Get Certified in 1 Hour
How to Get Started with the Model
Make sure to update your transformers and bitsandbytes installation via pip install -U transformers & pip install -U bitsandbytes
Use the code below to get started with the model.
English
import torch
from transformers import pipeline
model_id = "CoRover/BharatGPT-3B-Indic"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a helpful assistant who responds in English"},
{"role": "user", "content": "who created you?"},
]
outputs = pipe(
messages,
max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
Hindi
import torch
from transformers import pipeline
model_id = "CoRover/BharatGPT-3B-Indic"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a helpful assistant who responds in Hindi"},
{"role": "user", "content": "भारत की राजधानी क्या है"},
]
outputs = pipe(
messages,
max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
Gujarati
import torch
from transformers import pipeline
model_id = "CoRover/BharatGPT-3B-Indic"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a helpful assistant who responds in Gujarati"},
{"role": "user", "content": "શું છે ભારતની રાજધાની"},
]
outputs = pipe(
messages,
max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
Marathi
import torch
from transformers import pipeline
model_id = "CoRover/BharatGPT-3B-Indic"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a helpful assistant who responds in Marathi"},
{"role": "user", "content": "भारताची राजधानी कोणती?"},
]
outputs = pipe(
messages,
max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
Malayalam
import torch
from transformers import pipeline
model_id = "CoRover/BharatGPT-3B-Indic"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a helpful assistant who responds in Malayalam"},
{"role": "user", "content": "ഭരത് കി രാജധാനി ഉണ്ട്"},
]
outputs = pipe(
messages,
max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
Training Details
Training Data
- Language Spectrum: A balanced representation of Hindi, Punjabi, Marathi, Malayalam, Oriya, Kannada, Gujarati, Bengali, Urdu, Tamil, and Telugu, capturing the unique syntactic structures of each language.
Usage and Limitations
License: Non-Commercial. For academic and research purposes only. For commercial use, please visit Conversational Gen AI platform or Contact Us.
Terms of Use: Terms and Conditions
Responsible AI Framework: CoRover's Responsible AI Framework
Hardware & Software
To ensure top-tier performance and scalability, the model was fine-tuned using state-of-the-art hardware and software configurations:
- NVIDIA A100 GPUs, renowned for their unmatched computational power and efficiency in deep learning tasks, were leveraged. These GPUs, with their advanced tensor cores, provided the ability to train large-scale models with reduced training time and enhanced precision. High-bandwidth GPU interconnects ensured seamless parallel processing for handling massive multilingual datasets.
- Downloads last month
- 127