llama-3.2-1B-ft-v0.1-qlora - Surgical Python Coder

This model is a fine-tuned version of Llama 3.2 1B specialized for clean, surgical Python code generation. It was trained on 8k high-quality Python examples from the Vezora/Tested-22k-Python-Alpaca dataset.

πŸš€ Performance (Pass@1)

Using a greedy decoding strategy (temperature 0.1), this model demonstrates a significant reasoning jump:

Model Pass@1 (Coding Benchmark)
Llama 3.2 1B (Base) 0.0%
llama-3.2-1B-ft-v0.1-qlora (Fine-Tuned) 66.7%

πŸ› οΈ Key Improvements

  • Instruction Following: Unlike the base model, this version correctly triggers the Assistant role.
  • Python Syntax: High adherence to PEP8 and clean function structures.
  • Surgical Accuracy: Optimized to provide direct code solutions with minimal conversational fluff.

πŸ’» Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("NEldin10/llama-3.2-1B-ft-v0.1-qlora-merged")
model = AutoModelForCausalLM.from_pretrained("NEldin10/llama-3.2-1B-ft-v0.1-qlora-merged")

prompt = "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nYou are a surgical coding expert.<|eot_id|><|start_header_id|>user<|end_header_id|>\n\nWrite a function to find the GCD of two numbers.<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0]))
Downloads last month
16
Safetensors
Model size
1B params
Tensor type
F32
Β·
F16
Β·
U8
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for NEldin10/llama-3.2-1B-ft-v0.1-qlora-merged

Quantized
(243)
this model

Dataset used to train NEldin10/llama-3.2-1B-ft-v0.1-qlora-merged