For Maths
Collection
1 item
β’
Updated
A lightweight 3B parameter model fine-tuned for Reasoning.
Specialized in Algebra, Logic Puzzles, and Step-by-Step Reasoning.
Emo-v1 is a fine-tuned version of Qwen/Qwen2.5-3B-Instruct, optimized for mathematical reasoning and logic.
Unlike standard chat models that often guess answers, Emo-Qwen is trained to decompose problems into explicit steps before providing a final solution. It mimics the "Chain of Thought" (CoT) process found in larger reasoning models (like OpenAI's o1), making it surprisingly capable for its small size.
nvidia/OpenMathInstruct-2 dataset, covering algebra, calculus, and probability.import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# 1. Load Model
model_id = "PrimeTJ/Emo-v1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
# 2. Define the Prompt
system_prompt = "You are a helpful math assistant. Think step by step."
user_prompt = "A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost?"
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt}
]
# 3. Generate
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=1024,
temperature=0.6 # Low temperature for logic
)
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)