brettleehari/cricketbench-v1
Viewer • Updated • 170 • 20
How to use brettleehari/cricketmind-nemotron-mini with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="brettleehari/cricketmind-nemotron-mini")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("brettleehari/cricketmind-nemotron-mini")
model = AutoModelForCausalLM.from_pretrained("brettleehari/cricketmind-nemotron-mini")
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]:]))How to use brettleehari/cricketmind-nemotron-mini with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "brettleehari/cricketmind-nemotron-mini"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "brettleehari/cricketmind-nemotron-mini",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/brettleehari/cricketmind-nemotron-mini
How to use brettleehari/cricketmind-nemotron-mini with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "brettleehari/cricketmind-nemotron-mini" \
--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": "brettleehari/cricketmind-nemotron-mini",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "brettleehari/cricketmind-nemotron-mini" \
--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": "brettleehari/cricketmind-nemotron-mini",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use brettleehari/cricketmind-nemotron-mini with Docker Model Runner:
docker model run hf.co/brettleehari/cricketmind-nemotron-mini
A fine-tuned version of nvidia/Nemotron-Mini-4B-Instruct specialized in MCC Laws of Cricket and match situation analysis.
LLM-as-judge evaluation (Claude) across 20 questions in 4 categories:
| Category | CricketMind | Baseline Nemotron | Improvement |
|---|---|---|---|
| Laws Recall (30%) | 60.0% | 40% | +20pp |
| Conditional Reasoning (35%) | 70.0% | 25% | +45pp |
| Match Situation (25%) | 80.0% | 30% | +50pp |
| Edge Case (10%) | 50.0% | 20% | +30pp |
| Overall | 67.5% | 30.2% | +37.3pp |
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "brettleehari/cricketmind-nemotron-mini"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_name,
dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
prompt = """### Instruction:
You are CricketMind, an expert in the Laws of Cricket. Cite Law numbers and reason step by step.
### Input:
A batter is struck on the pad outside the line of off stump. They played a shot. Is it out LBW?
### Response:
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.1)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training data and evaluation suite: brettleehari/cricketbench-v1
Hariprasad Sudharshan — AI Product Manager
Base model
nvidia/Nemotron-Mini-4B-Instruct