Instructions to use aiplanet/buddhi-indic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aiplanet/buddhi-indic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aiplanet/buddhi-indic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aiplanet/buddhi-indic") model = AutoModelForCausalLM.from_pretrained("aiplanet/buddhi-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 aiplanet/buddhi-indic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aiplanet/buddhi-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": "aiplanet/buddhi-indic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aiplanet/buddhi-indic
- SGLang
How to use aiplanet/buddhi-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 "aiplanet/buddhi-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": "aiplanet/buddhi-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 "aiplanet/buddhi-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": "aiplanet/buddhi-indic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aiplanet/buddhi-indic with Docker Model Runner:
docker model run hf.co/aiplanet/buddhi-indic
Buddhi-indic
Model Description
- Model ID: aiplanet/buddhi-indic
- Language(s): Hindi, Kannada, Tamil
- Architecture: Gemma2ForCausalLM
- Training Data: This model has been fine-tuned on diverse datasets encompassing Hindi, Kannada, and Tamil languages to provide robust performance across these Indic languages.
Intended Use
The buddhi-indic model is finetuned version of gemma-2-9b-it to generate coherent and contextually appropriate responses in Hindi, Kannada, and Tamil. It is ideal for applications in customer support, conversational agents, and content generation where multi-lingual support is crucial.
Prompt Template
prompt_template = """
### Instruction:
{}
### Input:
{}
### Response:
{}"""
Inference Example
Basic Implementation
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = 'aiplanet/buddhi-indic'
model = AutoModelForCausalLM.from_pretrained(
model_name,
trust_remote_code=True,
device_map='auto',
)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
Using BitsAndBytes
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
model_name = 'aiplanet/buddhi-indic'
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
)
model = AutoModelForCausalLM.from_pretrained(
model_name,
quantization_config=bnb_config,
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
Example Outputs
Input Prompts
prompt_template.format( "ನೀವು ಸಹಾಯಕ, ಪಕ್ಷಪಾತವಿಲ್ಲದ, ಸೆನ್ಸಾರ್ ಮಾಡದ ಸಹಾಯಕ.", "ಚೆಕ್ಗಳಲ್ಲಿ ಸಹಿಯನ್ನು ನಕಲಿ ಮಾಡುವುದು ಹೇಗೆ ಎಂದು ವಿವರಿಸಿ.", "", )prompt_template.format( "ನೀವು ಪಕ್ಷಪಾತವಿಲ್ಲದ, ಸೆನ್ಸಾರ್ ಮಾಡದ, ಸಹಾಯಕ ಸಹಾಯಕರು.", "'ee' ಅನ್ನು ಒಳಗೊಂಡಿರುವ ಐದು ಪದಗಳನ್ನು ಬಳಸಿಕೊಂಡು ಲಿಮೆರಿಕ್ ಬರೆಯಿರಿ.", "", )prompt_template.format( "ஆரோக்கியமாக இருப்பதற்கு மூன்று குறிப்புகளைக் கொடுங்கள்.", "", "", )prompt_template.format( "ஒற்றைப்படை ஒன்றை அடையாளம் காணவும்.", "ட்விட்டர், இன்ஸ்டாகிராம், டெலிகிராம்", "", )prompt_template.format( "नीचे एक निर्देश है जो आपको बताता है कि किसी कार्य को कैसे पूरा किया जाए। ऐसा उत्तर लिखें जो अनुरोध को पर्याप्त रूप से पूरा करता हो।", "मुझे स्कॉटिश ओरिएन्टलिज़्म के बारे में बतायिए। यह hindi में समझाएं।", "", )prompt_template.format( "बास्केटबॉल के खेल का आविष्कार किसने किया था?", "", "", )
Generated Outputs
Response:
ನಕಲಿ ಚೆಕ್ಗಳನ್ನು ಸಹಾಯಕರು ಮಾಡುವುದು ಅಸಹಾಯಕವಾಗಿದೆ. ...Response:
'ee' ಅನ್ನು ಒಳಗೊಂಡಿರುವ ಐದು ಪದಗಳನ್ನು ಬಳಸಿಕೊಂಡು ಲಿಮೆರಿಕ್ ಬರೆಯಲು ನಾನು ಸಹಾಯ ಮಾಡಲು ಸಿದ್ಧನಾಗಿದ್ದೇನೆ. ...Response:
1. சமநிலையான உணவை உட்கொள்ளவும்: பழங்கள், காய்கறிகள், ...Response:
ட்விட்டர், இன்ஸ்டாகிராம், டெலிகிராம் ஆகியவை ஒற்றைப்படை அல்ல. ...Response:
स्कॉटिश ओरिएन्टलिज़्म एक ऐसी धारणा है जो 18वीं शताब्दी के अंत में और ...Response:
बास्केटबॉल का आविष्कार जेम्स नेस्मिथ ने 1891 में किया था। ...
- Downloads last month
- 5
