This is a
fully merged fine-tuned model based on
Qwen/Qwen3-0.6B-Base. It was trained on a rich developer-focused Q&A dataset covering Flask internals. Fine-tuning was done using LoRA (Low-Rank Adaptation) and later merged into the base model for ease of deployment.
Flask’s documentation, while comprehensive, often lacks developer-centric summaries or Q&A-style explanations. This project bridges that gap by:
1{
2 "instruction": "What does `before_request` do in Flask?",
3 "input": "This function runs before each request, useful for checking login sessions, etc.",
4 "output": "`before_request` is a Flask decorator used to register a function that runs before each request. It is commonly used to implement access control logic or session checks."
5}
6
7## 🧪 Fine-Tuning Details
8
9- **Model**: Qwen/Qwen3-0.6B-Base
10- **PEFT Type**: LoRA (r=8, alpha=16)
11- **Quantization**: 4-bit NF4 using `bitsandbytes`
12- **Training Library**: `transformers`, `peft`, `datasets`
13- **Device**: Single NVIDIA RTX 3060 6GB VRAM (consumer laptop)
14- **Dataset**: 1000+ cleaned Q&A pairs from Flask official documentation
15
16---
17
18## 🧠 Prompt Format
19
20The model was fine-tuned on Alpaca-style prompts:
21
22```text
23### Instruction:
24<What do you want to know?>
25
26### Input:
27<Any supporting context>
28
29### Response:
30<Model-generated answer>
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("devanshdhir/qwen3-flask-full", trust_remote_code=True)
4tokenizer = AutoTokenizer.from_pretrained("devanshdhir/qwen3-flask-full", trust_remote_code=True)
5
6prompt = """### Instruction:
7What is the purpose of `url_defaults` in Flask?
8### Input:
9Related excerpt from docs...
10### Response:"""
11
12inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
13outputs = model.generate(**inputs, max_new_tokens=300)
14print(tokenizer.decode(outputs[0], skip_special_tokens=True))
15