Instructions to use cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq") model = AutoModelForCausalLM.from_pretrained("cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq
- SGLang
How to use cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq 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 "cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq" \ --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": "cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq", "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 "cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq" \ --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": "cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq with Docker Model Runner:
docker model run hf.co/cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq
OpenHathi Base GPTQ
- Model creator: Sarvam AI
- Original model: sarvamai/OpenHathi-7B-Hi-v0.1-Base
Description
This repo contains GPTQ model files for Sarvam's OpenHathi.
Files are made using AutoGPTQ with following config.
quantization_config : {"bits": 4,
"group_size": 128,
"damp_percent": 0.1,
"desc_act": true,
}
We use a custom dataset which has both Hindi and English wiki articles. We truncate to max_length=1024 and model may not perform well beyond that context size.
Prompt template
This is a base model not tuned for any instructions. Feel free to use any format. Alpaca/Vicuna works fine.
Oobagooba
Standard oobagooba works with exllama2 / autogptq loader
Using in code
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
from transformers import AutoTokenizer
model_dir = 'cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq'
model = AutoGPTQForCausalLM.from_quantized(model_dir, device="cuda:0")
tokenizer = AutoTokenizer.from_pretrained(model_dir, fast=True)
tokens = tokenizer("do aur do", return_tensors="pt").to(model.device)
print(tokenizer.decode(model.generate(**tokens, max_length=1024)[0]))
- Downloads last month
- 15
Model tree for cmeraki/OpenHathi-7B-Hi-v0.1-Base-gptq
Base model
meta-llama/Llama-2-7b-chat-hf