Instructions to use nalandabh/bihar-360m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nalandabh/bihar-360m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nalandabh/bihar-360m") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nalandabh/bihar-360m") model = AutoModelForCausalLM.from_pretrained("nalandabh/bihar-360m", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nalandabh/bihar-360m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nalandabh/bihar-360m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nalandabh/bihar-360m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nalandabh/bihar-360m
- SGLang
How to use nalandabh/bihar-360m 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 "nalandabh/bihar-360m" \ --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": "nalandabh/bihar-360m", "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 "nalandabh/bihar-360m" \ --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": "nalandabh/bihar-360m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nalandabh/bihar-360m with Docker Model Runner:
docker model run hf.co/nalandabh/bihar-360m
bihar-360m
A small (360M) English model that answers questions about Bihar, India, from a passage you give it. If the passage doesn't contain the answer, it says so.
It is a reader, not an encyclopedia: without a passage it will guess. Check important answers.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "nalandabh/bihar-360m"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
SYSTEM = ("You are a helpful assistant for questions about Bihar. Answer only from the provided context. "
"If the context does not contain the answer, say you don't have that information.")
passage = "Paste a passage about Bihar here."
question = "Your question here?"
messages = [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": f"Context:\n{passage}\n\nQuestion: {question}"},
]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=150, do_sample=False)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
Use this exact prompt format. When the passage lacks the answer, the reply is: "I don't have that information in the provided text."
Training
Fine-tuned from SmolLM2-360M-Instruct with LoRA. Question-answer pairs were generated from Bihar text chunks with Qwen3-8B and filtered for accuracy. English only.
Text sources: English Wikipedia (CC BY-SA 4.0), Wikidata (CC0) and pages from Grokipedia (grokipedia.com). See ATTRIBUTION.md for the page list.
Limits
v0.1, an early version. English only. Not for legal, medical or official decisions.
- Downloads last month
- -
Model tree for nalandabh/bihar-360m
Base model
HuggingFaceTB/SmolLM2-360M