Views
No views yet
| Model | pass@1 | Passed |
|---|---|---|
| Baseline (Qwen3.5-4B) | 0.4939 | 81/164 |
| Fine-tuned (this model) | 0.5793 | 95/164 |
_extract_code function that stripped indentation from generated code. After fixing the extraction to preserve indentation and properly handle explanatory text (which the base model generates before code), the baseline was re-evaluated at 49.39% (81/164).AutoModelForCausalLM + AutoTokenizer (transformers direct, avoids Unsloth multimodal issues)def block to avoid multiple function generations1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model = AutoModelForCausalLM.from_pretrained(
5 "ericnunes/qwen35-4b-fable5-sft",
6 torch_dtype=torch.bfloat16,
7 device_map="auto",
8)
9tokenizer = AutoTokenizer.from_pretrained("ericnunes/qwen35-4b-fable5-sft")
10
11messages = [
12 {"role": "user", "content": "Write a Python function to check if a number is prime."}
13]
14text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
15inputs = tokenizer(text, return_tensors="pt").to(model.device)
16outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False, pad_token_id=tokenizer.eos_token_id)
17print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))model-Q4_K_M.gguf (2.57 GB) — recommended for most use casesmodel-Q8_0.gguf (4.26 GB) — higher precisionmodel-f16.gguf (8.03 GB) — full precision