Views
No views yet
Qwen/Qwen2.5-Coder-3B-Instructfrappe.get_doc, frappe.db.*, etc.)1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4BASE_MODEL = "Qwen/Qwen2.5-Coder-3B-Instruct"
5ADAPTER = "your-username/frappe-coder-3b-lora"
6
7tokenizer = AutoTokenizer.from_pretrained(ADAPTER)
8model = AutoModelForCausalLM.from_pretrained(BASE_MODEL, torch_dtype="auto")
9model = PeftModel.from_pretrained(model, ADAPTER)
10model.eval()1prompt = """### Instruction:
2Write a Frappe controller method that sends an email notification when a Sales Order is submitted.
3
4### Response:
5"""
6
7inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
8outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.2)
9print(tokenizer.decode(outputs[0], skip_special_tokens=True))frappe_dataset) built from:| Parameter | Value |
|---|---|
| Base model | Qwen2.5-Coder-3B-Instruct |
| Fine-tune method | LoRA (PEFT) |
| Precision | bf16 mixed precision |
| Framework | Hugging Face Transformers + PEFT |
| Hardware | Kaggle GPU (T4/P100) |
| Parameter | Value |
|---|---|
r (rank) | 16 |
lora_alpha | 32 |
target_modules | q_proj, v_proj |
lora_dropout | 0.05 |
bias | none |
Update these values with your actual training config.
1@misc{qwen2.5coder,
2 title = {Qwen2.5-Coder},
3 author = {Qwen Team, Alibaba Cloud},
4 year = {2024},
5 url = {https://huggingface.co/Qwen/Qwen2.5-Coder-3B-Instruct}
6}
---
**To use this:** paste it into the `README.md` at the root of your HF repo. Fill in your actual LoRA hyperparameters (rank, alpha, target modules) from your training config — those are the most important fields to get right.