Text Generation
PEFT
Safetensors
English
lora
qlora
code
html
css
javascript
web-development
conversational
Instructions to use lhordking/webcoder-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use lhordking/webcoder-7b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct") model = PeftModel.from_pretrained(base_model, "lhordking/webcoder-7b") - Notebooks
- Google Colab
- Kaggle
| license: apache-2.0 | |
| base_model: Qwen/Qwen2.5-Coder-7B-Instruct | |
| tags: | |
| - lora | |
| - qlora | |
| - code | |
| - html | |
| - css | |
| - javascript | |
| - web-development | |
| - peft | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| # WebCoder-7B — Website Specialist LoRA | |
| A QLoRA fine-tune of [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct) specialized for generating complete, production-ready websites using HTML, CSS, and JavaScript. | |
| ## Model Details | |
| - **Base model:** Qwen/Qwen2.5-Coder-7B-Instruct | |
| - **Fine-tuning method:** QLoRA (4-bit) | |
| - **LoRA rank:** 64 | |
| - **Precision:** bf16 | |
| - **Training samples:** 7,731 | |
| - **Epochs:** 3 | |
| - **Max length:** 1024 tokens | |
| ## Training Data | |
| - Hoglet-33/webdev-coding-dataset | |
| - sahil2801/CodeAlpaca-20k (web-filtered) | |
| - HuggingFaceH4/CodeAlpaca_20K (web-filtered) | |
| - HuggingFaceM4/WebSight (local cache) | |
| ## Usage | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from peft import PeftModel | |
| import torch | |
| base = AutoModelForCausalLM.from_pretrained( | |
| "Qwen/Qwen2.5-Coder-7B-Instruct", | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto" | |
| ) | |
| tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct") | |
| model = PeftModel.from_pretrained(base, "lhordking/webcoder-7b") | |
| prompt = "Create a responsive dark mode landing page for a SaaS product" | |
| inputs = tokenizer(prompt, return_tensors="pt").to(model.device) | |
| output = model.generate(**inputs, max_new_tokens=1024) | |
| print(tokenizer.decode(output[0], skip_special_tokens=True)) | |
| ``` | |
| ## Example Prompts | |
| - `"Create a responsive navbar with dark mode toggle"` | |
| - `"Build a SaaS landing page with hero section and pricing table"` | |
| - `"Make a login form with email and password validation"` | |
| - `"Create a portfolio page with project cards and animations"` | |
| ## Limitations | |
| - Best results with HTML/CSS/JS prompts | |
| - Output quality improves with specific, detailed prompts | |
| - May need more training data for complex full-stack applications | |