How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="Cannae-AI/GsMath-Llama-1B")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Cannae-AI/GsMath-Llama-1B")
model = AutoModelForCausalLM.from_pretrained("Cannae-AI/GsMath-Llama-1B")
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]:]))
Quick Links

GsMath-Llama-1B

Model Description:

This is a fine-tuned version of unsloth/Llama-3.2-1B!

  • recommended settings for inference: min_p = 0.1 and temperature = 1.5 , Read this Tweet to understand why.
  • License : apache-2.0
  • Finetuned from model : unsloth/Llama-3.2-1B

Benchmarks:

We evaluate both models on GSM8K using the standard lm-eval 5-shot exact-match protocol. Under identical decoding and extraction settings,GsMath-Llama-1B outperforms Meta’s Llama-3.2-1B by 2x,demonstrating an improvement in small-model mathematical capability.

Model Params GSM8K (5-shot, EM)
GsMath-Llama-1B 1B 0.137
Llama-3.2-1B 1B 0.068

GsMath-Llama-1B

Downloads last month
-
Safetensors
Model size
1B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Cannae-AI/GsMath-Llama-1B

Finetuned
(123)
this model
Quantizations
1 model

Collection including Cannae-AI/GsMath-Llama-1B