Downloads · 30 days
5
7% of all-time downloads
SkyAsl/Qwen3-olympiad-math-thinking-2507
Qwen3-olympiad-math-thinking-2507 is a text generation model from SkyAsl. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This model is an adapter version of Qwen/Qwen3-4B-Thinking-2507, trained with LoRA using unsloth framework on the hf-imo-colab/olympiads-ref-base-math-word.
Downloads · 30 days
5
7% of all-time downloads
All-time downloads
69
Public
Repo size
144 MB
Likes
0
Public
Click a slice to open those files.
.safetensors132 MB · 89%
From the Hugging Face model README
This model is an adapter version of Qwen/Qwen3-4B-Thinking-2507, trained with LoRA using unsloth framework on the hf-imo-colab/olympiads-ref-base-math-word.
pip install transformers peft torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
from peft import PeftModel
import torch
model_id = "SkyAsl/Qwen3-olympiad-math-thinking-2507"
tokenizer = AutoTokenizer.from_pretrained(model_id)
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Thinking-2507")
model = PeftModel.from_pretrained(base_model, model_id)
prompt = ""
input_text = (
f"<|user|>\n{prompt}\n"
f"<|assistant|>\n<think>\n"
)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
streamer = TextStreamer(tokenizer, skip_prompt=True)
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=3000, # Recommended to keep max_new_tokens high because of the long CoT.
temperature=0.7,
top_p=0.9,
do_sample=True,
repetition_penalty=1.2,
streamer=streamer
)
print(tokenizer.decode(output[0], skip_special_tokens=False))
The training format follows:
<|user|>
{prompt}
<|assistant|>
<think>
{solution}
</think>
{response}
| Setting | Value |
|---|---|
| Method | LoRA (PEFT) |
| Rank (r) | 16 |
| Alpha | 32 |
| LoraDropout | 0.05 |
| Max Length | 4096 |
| Batch Size | 4 |
| Grad Accum | 8 |
| LR | 2e-4 |
| Optimizer | adamw_torch_fused |
| Scheduler | cosine |
| Epochs | 2 |
| Epoch | Training Loss | Validation Loss |
|---|---|---|
| 1 | 0.870800 | 0.886106 |
| 2 | 0.844400 | 0.871447 |
hf-imo-colab/olympiads-ref-base-math-word