Math Fine Tune 🔮
Collection
2 items • Updated
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("NotASI/Qwen2-0.5B-Math")
model = AutoModelForCausalLM.from_pretrained("NotASI/Qwen2-0.5B-Math")
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]:]))Coding model comming soon!
This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
This model was trained on microsoft/orca-math-word-problems-200k for 3 epochs with rsLoRA + QLoRA.
The model follows the Alpaca format:
<|im_start|>system
You are a professional mathematician.|im_end|>
<|im_start|>user
{}<|im_end|>
<|im_start|>assistant
{}
Base model
unsloth/Qwen2-0.5B-Instruct-bnb-4bit
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NotASI/Qwen2-0.5B-Math") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)