Yamamoto commited on
Commit
450a4c4
·
1 Parent(s): a2f88df

feat: model card

Browse files
Files changed (1) hide show
  1. README.md +141 -1
README.md CHANGED
@@ -7,4 +7,144 @@ base_model:
7
  - deepseek-ai/deepseek-coder-6.7b-base
8
  tags:
9
  - code
10
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  - deepseek-ai/deepseek-coder-6.7b-base
8
  tags:
9
  - code
10
+ - web-design
11
+ - frontend
12
+ - html
13
+ - css
14
+ - javascript
15
+ - lora
16
+ - peft
17
+ ---
18
+
19
+ # DeepSeek Coder 6.7B - Website Design Fine-tuned
20
+
21
+ A fine-tuned version of DeepSeek Coder 6.7B specifically trained to generate website designs based on design specifications and requirements.
22
+
23
+ ## Model Description
24
+
25
+ This model is a LoRA fine-tuned version of `deepseek-ai/deepseek-coder-6.7b-base` trained on a dataset of website designs. The model has been specialized to understand design requirements (industry, tone, layout, etc.) and generate appropriate HTML/CSS/JavaScript implementations for brand-specific websites.
26
+
27
+ - **Base Model**: `deepseek-ai/deepseek-coder-6.7b-base`
28
+ - **Fine-tuning Method**: LoRA (Low-Rank Adaptation)
29
+ - **Training Dataset**: `stellaray777/1000s-websites`
30
+ - **Quantization**: 4-bit (NF4) with BitsAndBytes
31
+
32
+ ## Training Details
33
+
34
+ ### Training Configuration
35
+
36
+ - **Epochs**: 3
37
+ - **Batch Size**: 1 (gradient accumulation: 4)
38
+ - **Learning Rate**: 2e-4
39
+ - **LoRA Configuration**:
40
+ - `r`: 8
41
+ - `alpha`: 16
42
+ - `target_modules`: ["q_proj", "v_proj"]
43
+ - `lora_dropout`: 0.05
44
+ - **Max Sequence Length**: 2048 tokens
45
+ - **Optimizer**: paged_adamw_8bit
46
+ - **Learning Rate Scheduler**: cosine
47
+ - **Warmup Steps**: 50
48
+
49
+ ### Training Infrastructure
50
+
51
+ - **Quantization**: 4-bit NF4 quantization for memory efficiency
52
+ - **Gradient Checkpointing**: Enabled
53
+ - **Mixed Precision**: FP16
54
+
55
+ ## Intended Use
56
+
57
+ This model is designed for:
58
+
59
+ - Generating website designs based on design specifications
60
+ - Creating HTML/CSS/JavaScript code for brand-specific websites
61
+ - Understanding design requirements (industry, tone, layout, photo usage, motion) and translating them to code
62
+ - Assisting front-end developers in rapid website prototyping
63
+
64
+ ## How to Use
65
+
66
+ ### Installation
67
+
68
+ ```bash
69
+ pip install transformers torch peft bitsandbytes accelerate
70
+ ```
71
+
72
+ ### Basic Usage
73
+
74
+ ```python
75
+ from transformers import AutoModelForCausalLM, AutoTokenizer
76
+ from peft import PeftModel
77
+ import torch
78
+
79
+ # Load base model and tokenizer
80
+ base_model = "deepseek-ai/deepseek-coder-6.7b-base"
81
+ model = AutoModelForCausalLM.from_pretrained(
82
+ base_model,
83
+ load_in_4bit=True,
84
+ device_map="auto",
85
+ trust_remote_code=True
86
+ )
87
+ tokenizer = AutoTokenizer.from_pretrained(base_model)
88
+
89
+ # Load LoRA weights
90
+ model = PeftModel.from_pretrained(model, "stellaray777/1000s-websites")
91
+
92
+ # Prepare input
93
+ messages = [
94
+ {
95
+ "role": "system",
96
+ "content": "You are a senior creative front-end engineer who designs brand-specific websites."
97
+ },
98
+ {
99
+ "role": "user",
100
+ "content": "Industry: Healthcare\nTone: Professional, Trustworthy\nPage type: Landing page\nLayout: Grid-based\nPhoto usage: Medium\nTask: Design the website based on the provided HTML structure and styling."
101
+ }
102
+ ]
103
+
104
+ # Generate response
105
+ input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
106
+ inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
107
+
108
+ with torch.no_grad():
109
+ outputs = model.generate(**inputs, max_new_tokens=2048, temperature=0.7)
110
+
111
+ response = tokenizer.decode(outputs[0], skip_special_tokens=True)
112
+ print(response)
113
+ ```
114
+
115
+ ### Interactive Chatbot
116
+
117
+ Use the provided test script:
118
+
119
+ ```bash
120
+ # From Hugging Face Hub
121
+ python src/test_trained_model.py
122
+
123
+ # From local cloned model
124
+ python src/test_trained_model.py --local
125
+ ```
126
+
127
+ ## Limitations
128
+
129
+ - The model is fine-tuned on a specific dataset of website designs and may not generalize well to all design styles
130
+ - Generated code may require manual review and adjustments
131
+ - The model may not always produce production-ready code and should be used as a starting point
132
+ - Performance depends on the quality and specificity of the design requirements provided
133
+
134
+ ## Model Card Contact
135
+
136
+ For questions, issues, or contributions, please refer to the main project repository.
137
+
138
+ ## Citation
139
+
140
+ If you use this model, please cite:
141
+
142
+ ```bibtex
143
+ @misc{deepseek-coder-website-design,
144
+ title={DeepSeek Coder 6.7B - Website Design Fine-tuned},
145
+ author={Stellaray777},
146
+ year={2024},
147
+ publisher={Hugging Face},
148
+ howpublished={\url{https://huggingface.co/stellaray777/1000s-websites}}
149
+ }
150
+ ```