ThuraAung1601/reform-dafny-loop-inv-gen
Viewer • Updated • 8.45k • 113
How to use ThuraAung1601/Qwen2.5-Coder-0.5B-Instruct_reform-dafny-loop-inv-gen-alldata_SFT with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-0.5B-Instruct")
model = PeftModel.from_pretrained(base_model, "ThuraAung1601/Qwen2.5-Coder-0.5B-Instruct_reform-dafny-loop-inv-gen-alldata_SFT")Qwen/Qwen2.5-Coder-0.5B-Instruct fine-tuned to add loop invariants to Dafny programs so that they verify, on ThuraAung1601/reform-dafny-loop-inv-gen: LoRA SFT. Trained without natural-language chain of thought: the output is the complete program.
from peft import AutoPeftModelForCausalLM
model = AutoPeftModelForCausalLM.from_pretrained("ThuraAung1601/Qwen2.5-Coder-0.5B-Instruct_reform-dafny-loop-inv-gen-alldata_SFT")
Prompt -- system message:
You are an expert in Dafny formal verification. You are given a Dafny program whose loops are missing their loop invariants. Output the complete program with loop invariants added so that it verifies with `dafny verify`. Do not change anything else in the program. Output only the program in a ```dafny code block.
user message: the program inside a ```dafny code block.
Base model
Qwen/Qwen2.5-0.5B