Views
No views yet
1{
2 "instruction": "Fix the bug in the following Python code",
3 "input": "<buggy code>",
4 "output": "<correct code>"
5}+ → -)> → <)| Split | Samples |
|---|---|
| Train | ~374 |
| Validation | ~90 |
| Test | ~500 |
| Parameter | Value |
|---|---|
| Rank (r) | 16 |
| Alpha | 32 |
| Dropout | 0.05 |
| Target Modules | q_proj, k_proj, v_proj, o_proj |
| Parameter | Value |
|---|---|
| Epochs | 3 |
| Learning Rate | 2e-4 |
| Batch Size | 1 |
| Gradient Accumulation | 8 |
| Precision | FP16 |
| Optimizer | AdamW |
| Metric | Base Model | Fine-Tuned Model |
|---|---|---|
| Syntax Fix Accuracy | Low | Noticeably Higher |
| Indentation Correction | Inconsistent | Reliable |
| Variable Error Fixing | Occasional | Improved |
| Complex Logic Bugs | Limited | Limited (unchanged) |
| Instruction Adherence | Moderate | High |
Note: Quantitative metrics (e.g., exact match accuracy, CodeBLEU) were not computed due to dataset and tooling constraints.
1for i in range(5)
2 print(i)1for i in range(5):
2 print(i)1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base_model = AutoModelForCausalLM.from_pretrained(
5 "microsoft/phi-3-mini-4k-instruct"
6)
7
8tokenizer = AutoTokenizer.from_pretrained(
9 "microsoft/phi-3-mini-4k-instruct"
10)
11
12model = PeftModel.from_pretrained(
13 base_model,
14 "Sud1212/phi3-debug-llm-lora"
15)
16
17prompt = "Fix the bug:\nfor i in range(5)\n print(i)"
18
19inputs = tokenizer(prompt, return_tensors="pt")
20outputs = model.generate(**inputs, max_new_tokens=100)
21
22print(tokenizer.decode(outputs[0], skip_special_tokens=True))