Downloads · 30 days
0
alpayH/qwen2-0.5b-lora-opencodeinstruct
qwen2-0.5b-lora-opencodeinstruct is a machine learning model from alpayH. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This model is a LoRA fine-tuned version of Qwen/Qwen2-0.5B-Instruct on the OpenCodeInstruct dataset.
Downloads · 30 days
0
Access
Public
Updated Oct 13, 2025
Repo size
223 MB
Likes
0
Public
Click a slice to open those files.
.pt141 MB · 48%
From the Hugging Face model README
This model is a LoRA fine-tuned version of Qwen/Qwen2-0.5B-Instruct on the OpenCodeInstruct dataset.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-0.5B-Instruct")
# Load LoRA adapters
model = PeftModel.from_pretrained(base_model, "alpayH/qwen2-0.5b-lora-opencodeinstruct")
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("alpayH/qwen2-0.5b-lora-opencodeinstruct")
# Generate code
prompt = "### Instruction:\nWrite a Python function to reverse a string\n\n### Response:\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=512)
print(tokenizer.decode(outputs[0]))
This model has been evaluated on LiveCodeBench. See the main repository for evaluation results.
Apache 2.0