Views
No views yet
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
3from peft import PeftModel
4
5BASE_MODEL = "Qwen/Qwen2.5-Coder-3B-Instruct"
6ADAPTER = "YOUR_USERNAME/Qwen2.5-3B-SWE-Agent-QLoRA"
7
8tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
9
10bnb_config = BitsAndBytesConfig(
11 load_in_4bit=True,
12 bnb_4bit_quant_type="nf4",
13 bnb_4bit_use_double_quant=True,
14 bnb_4bit_compute_dtype=torch.float16,
15)
16
17model = AutoModelForCausalLM.from_pretrained(
18 BASE_MODEL,
19 device_map="auto",
20 quantization_config=bnb_config,
21)
22
23model = PeftModel.from_pretrained(model, ADAPTER)
24
25prompt = "Fix failing tests in a Python repository."
26
27inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
28
29outputs = model.generate(
30 **inputs,
31 max_new_tokens=512,
32)
33
34print(tokenizer.decode(outputs[0], skip_special_tokens=True))Fix failing tests in the repository.Create a JSON tool plan to debug the issue.Analyze the codebase and modify the failing function.1@article{baumann2026swechat,
2 title={SWE-chat: Coding Agent Interactions From Real Users in the Wild},
3 author={Baumann, Joachim and Padmakumar, Vishakh and Li, Xiang and Yang, John and Yang, Diyi and Koyejo, Sanmi},
4 year={2026},
5 journal={arXiv preprint arXiv:2604.20779},
6 url={https://arxiv.org/abs/2604.20779}
7}