x0root/qwen2-7b-orca-math-lora
qwen2-7b-orca-math-lora
A LoRA fine-tune of Qwen2-7B-Instruct trained with supervised fine-tuning on a curated blend of mathematical reasoning and general instruction-following data. Training was performed using Unsloth for memory-efficient adaptation on a single GPU.
Model Details
Training Details
LoRA Configuration
Training Hyperparameters
Training Data
The model was trained on a concatenated and shuffled mixture of three datasets (seed 3407):
All examples were formatted using the ChatML conversation template before training. The loss was computed on assistant responses only; user turns and system prompts were excluded from the gradient.
Intended Use
This model is suited for tasks involving:
- Grade-school and competition-level math word problems
- Step-by-step arithmetic and algebraic reasoning
- General instruction following and question answering in English
It is not intended for safety-critical applications, factual knowledge retrieval, or domains outside its training distribution.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "x0root/qwen2-7b-orca-math-lora"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
messages = [
{"role": "user", "content": "A train travels 300 km in 4 hours. What is its average speed?"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))For faster inference with the original 4-bit quantized weights, load via Unsloth:
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="x0root/qwen2-7b-orca-math-lora",
max_seq_length=2048,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)