Sai2076 commited on
Commit
2604fa7
·
verified ·
1 Parent(s): 9b4c727

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +189 -156
README.md CHANGED
@@ -2,199 +2,232 @@
2
  library_name: transformers
3
  tags:
4
  - unsloth
 
 
 
 
 
 
5
  ---
6
 
7
- # Model Card for Model ID
8
-
9
- <!-- Provide a quick summary of what the model is/does. -->
10
 
 
 
11
 
 
12
 
13
  ## Model Details
14
 
15
  ### Model Description
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
- <!-- Provide a longer summary of what this model is. -->
18
-
19
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
20
-
21
- - **Developed by:** [More Information Needed]
22
- - **Funded by [optional]:** [More Information Needed]
23
- - **Shared by [optional]:** [More Information Needed]
24
- - **Model type:** [More Information Needed]
25
- - **Language(s) (NLP):** [More Information Needed]
26
- - **License:** [More Information Needed]
27
- - **Finetuned from model [optional]:** [More Information Needed]
28
-
29
- ### Model Sources [optional]
30
-
31
- <!-- Provide the basic links for the model. -->
32
-
33
- - **Repository:** [More Information Needed]
34
- - **Paper [optional]:** [More Information Needed]
35
- - **Demo [optional]:** [More Information Needed]
36
-
37
- ## Uses
38
 
39
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
40
 
41
  ### Direct Use
 
 
42
 
43
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
44
 
45
- [More Information Needed]
 
 
46
 
47
- ### Downstream Use [optional]
48
-
49
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
50
-
51
- [More Information Needed]
52
-
53
- ### Out-of-Scope Use
54
-
55
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
56
-
57
- [More Information Needed]
58
 
59
  ## Bias, Risks, and Limitations
 
 
 
 
60
 
61
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
62
-
63
- [More Information Needed]
64
 
65
- ### Recommendations
66
 
67
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
68
 
69
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
 
 
70
 
71
- ## How to Get Started with the Model
72
 
73
- Use the code below to get started with the model.
74
 
75
- [More Information Needed]
 
 
 
 
 
 
76
 
77
- ## Training Details
 
 
 
 
78
 
79
- ### Training Data
80
 
81
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
82
 
83
- [More Information Needed]
 
 
 
84
 
85
  ### Training Procedure
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
88
-
89
- #### Preprocessing [optional]
90
-
91
- [More Information Needed]
92
-
93
-
94
- #### Training Hyperparameters
95
-
96
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
97
-
98
- #### Speeds, Sizes, Times [optional]
99
-
100
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
101
-
102
- [More Information Needed]
103
 
104
  ## Evaluation
105
 
106
- <!-- This section describes the evaluation protocols and provides the results. -->
107
-
108
- ### Testing Data, Factors & Metrics
109
-
110
- #### Testing Data
111
-
112
- <!-- This should link to a Dataset Card if possible. -->
113
-
114
- [More Information Needed]
115
-
116
- #### Factors
117
-
118
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
119
-
120
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
- #### Metrics
123
-
124
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
125
-
126
- [More Information Needed]
127
-
128
- ### Results
129
-
130
- [More Information Needed]
131
-
132
- #### Summary
133
-
134
-
135
-
136
- ## Model Examination [optional]
137
-
138
- <!-- Relevant interpretability work for the model goes here -->
139
-
140
- [More Information Needed]
141
-
142
- ## Environmental Impact
143
-
144
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
145
-
146
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
147
-
148
- - **Hardware Type:** [More Information Needed]
149
- - **Hours used:** [More Information Needed]
150
- - **Cloud Provider:** [More Information Needed]
151
- - **Compute Region:** [More Information Needed]
152
- - **Carbon Emitted:** [More Information Needed]
153
-
154
- ## Technical Specifications [optional]
155
-
156
- ### Model Architecture and Objective
157
-
158
- [More Information Needed]
159
-
160
- ### Compute Infrastructure
161
-
162
- [More Information Needed]
163
-
164
- #### Hardware
165
-
166
- [More Information Needed]
167
-
168
- #### Software
169
-
170
- [More Information Needed]
171
-
172
- ## Citation [optional]
173
-
174
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
175
-
176
- **BibTeX:**
177
-
178
- [More Information Needed]
179
-
180
- **APA:**
181
-
182
- [More Information Needed]
183
-
184
- ## Glossary [optional]
185
-
186
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
187
-
188
- [More Information Needed]
189
-
190
- ## More Information [optional]
191
 
192
- [More Information Needed]
 
 
 
 
193
 
194
- ## Model Card Authors [optional]
195
 
196
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
- ## Model Card Contact
199
 
200
- [More Information Needed]
 
 
 
2
  library_name: transformers
3
  tags:
4
  - unsloth
5
+ - qlora
6
+ - lora
7
+ - llama-3.2
8
+ - instruction-tuned
9
+ - bf16
10
+ - 4bit
11
  ---
12
 
13
+ # Model Card: UAB-NLP/ProjGen_Finetuned_llama
 
 
14
 
15
+ A **LLaMA-3.2** based instruction-tuned model fine-tuned with **Unsloth + QLoRA** using 🤗 **Transformers**.
16
+ This model is part of the **ProjGen project**, aimed at enhancing developer productivity through automated project generation and structured code scaffolding.
17
 
18
+ ---
19
 
20
  ## Model Details
21
 
22
  ### Model Description
23
+ - **Base model:** `meta-llama/Llama-3.2-<SIZE>-Instruct` <!-- replace SIZE with e.g. 8B/70B -->
24
+ - **Finetuning method:** Unsloth + QLoRA (LoRA adapters)
25
+ - **Precision (train):** 4-bit NF4 quantization (bitsandbytes) + bf16 compute
26
+ - **Context length:** 4096
27
+ - **Task(s):** Instruction following & project/code generation
28
+ - **License:** Inherits from Meta’s LLaMA-3.2 license
29
+ - **Developed by:** UAB-NLP Group (Sai Praneeth Kumar, University of Alabama at Birmingham)
30
+ - **Finetuned from:** `meta-llama/Llama-3.2-<SIZE>-Instruct`
31
+ - **Shared by:** [UAB-NLP](https://huggingface.co/UAB-NLP)
32
+
33
+ ### Model Sources
34
+ - **Repository:** [UAB-NLP/ProjGen_Finetuned_llama](https://huggingface.co/UAB-NLP/ProjGen_Finetuned_llama)
35
+ - **Project Paper:** ProjGen – Enhanced Developer Productivity for Flask Project Generation with a RAG-Enhanced Fine-Tuned Local LLM
36
 
37
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
+ ## Intended Uses & Limitations
40
 
41
  ### Direct Use
42
+ - Generating Flask/Django/Streamlit project structures automatically.
43
+ - Instruction-following tasks related to software engineering and code generation.
44
 
45
+ ### Downstream Use
46
+ - Further fine-tuning on domain-specific datasets (e.g., medical imaging, finance, etc.).
47
+ - Integration into developer assistants and productivity tools.
48
 
49
+ ### Out-of-Scope / Limitations
50
+ - Not suitable for medical, legal, or financial decision-making without human review.
51
+ - May hallucinate or produce insecure/inefficient code if not monitored.
52
 
53
+ ---
 
 
 
 
 
 
 
 
 
 
54
 
55
  ## Bias, Risks, and Limitations
56
+ The model inherits risks from the base **LLaMA-3.2** model:
57
+ - Possible hallucinations and factual inaccuracies.
58
+ - Dataset/domain biases reflected in responses.
59
+ - Outputs should be validated before production deployment.
60
 
61
+ **Recommendation:** Always pair outputs with testing, validation, and human oversight.
 
 
62
 
63
+ ---
64
 
65
+ ## Getting Started
66
 
67
+ ### Inference (PEFT adapter form)
68
+ ```python
69
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
70
 
71
+ model_id = "UAB-NLP/ProjGen_Finetuned_llama"
72
 
73
+ tok = AutoTokenizer.from_pretrained(model_id)
74
 
75
+ bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True)
76
+ model = AutoModelForCausalLM.from_pretrained(
77
+ model_id,
78
+ quantization_config=bnb,
79
+ device_map="auto",
80
+ torch_dtype="auto"
81
+ )
82
 
83
+ prompt = "Generate a Flask project with login, dashboard, and reports."
84
+ inputs = tok(prompt, return_tensors="pt").to(model.device)
85
+ outputs = model.generate(**inputs, max_new_tokens=512)
86
+ print(tok.decode(outputs[0], skip_special_tokens=True))
87
+ ```
88
 
89
+ ---
90
 
91
+ ## Training Details
92
 
93
+ ### Data
94
+ - **Dataset:** Custom **ProjGen dataset** built from structured Flask/Django/Streamlit projects and instructions.
95
+ - **Size:** [Fill in #samples / tokens]
96
+ - **Preprocessing:** Chat-style instruction formatting (system/user/assistant), deduplication, truncation at 4096 tokens.
97
 
98
  ### Training Procedure
99
+ - **Quantization:** 4-bit NF4 + double quantization (bitsandbytes)
100
+ - **LoRA Config:**
101
+ - `r`: 16
102
+ - `alpha`: 32
103
+ - `dropout`: 0.05
104
+ - Target modules: q_proj, k_proj, v_proj, o_proj, gate_up_proj, down_proj
105
+ - **Optimizer:** Paged AdamW (32-bit)
106
+ - **LR / Schedule:** 2e-4 with cosine decay + warmup
107
+ - **Batch size:** [fill in effective batch size]
108
+ - **Epochs/Steps:** 60 steps
109
+ - **Precision:** bf16 mixed precision
110
+ - **Grad checkpointing:** Enabled
111
+ - **Flash attention:** Enabled (Unsloth optimization)
112
+
113
+ ### Training Hardware
114
+ - **GPU:** RTX 4070 (12GB VRAM) [replace with actual if different]
115
+ - **Training runtime:** 331.47 seconds
116
+ - **Steps per second:** 0.181
117
+ - **Samples per second:** 1.448
118
+ - **Final training loss:** 0.4899
119
+ - **Total FLOPs:** 3.8674e15 FLOPs
120
+ - **Checkpoint size:** ~ (adapter size: ~200MB; merged model size depends on base LLaMA size)
121
 
122
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  ## Evaluation
125
 
126
+ ### Training Loss Curve
127
+ ![Training Loss Curve](sandbox:/mnt/data/training_loss_curve.png)
128
+
129
+ ### Training Loss Table (per step)
130
+ | Step | Training Loss |
131
+ |------|---------------|
132
+ | 1 | 0.9276 |
133
+ | 2 | 1.0030 |
134
+ | 3 | 1.0463 |
135
+ | 4 | 0.9592 |
136
+ | 5 | 0.9903 |
137
+ | 6 | 0.9239 |
138
+ | 7 | 0.7762 |
139
+ | 8 | 0.6905 |
140
+ | 9 | 0.6130 |
141
+ | 10 | 0.5687 |
142
+ | 11 | 0.6292 |
143
+ | 12 | 0.5927 |
144
+ | 13 | 0.5880 |
145
+ | 14 | 0.5021 |
146
+ | 15 | 0.5303 |
147
+ | 16 | 0.4216 |
148
+ | 17 | 0.4692 |
149
+ | 18 | 0.5330 |
150
+ | 19 | 0.4350 |
151
+ | 20 | 0.4003 |
152
+ | 21 | 0.3515 |
153
+ | 22 | 0.4201 |
154
+ | 23 | 0.4200 |
155
+ | 24 | 0.3666 |
156
+ | 25 | 0.4260 |
157
+ | 26 | 0.4261 |
158
+ | 27 | 0.3206 |
159
+ | 28 | 0.4385 |
160
+ | 29 | 0.3475 |
161
+ | 30 | 0.4438 |
162
+ | 31 | 0.4648 |
163
+ | 32 | 0.4088 |
164
+ | 33 | 0.4422 |
165
+ | 34 | 0.4209 |
166
+ | 35 | 0.3593 |
167
+ | 36 | 0.3433 |
168
+ | 37 | 0.3874 |
169
+ | 38 | 0.3604 |
170
+ | 39 | 0.4374 |
171
+ | 40 | 0.4048 |
172
+ | 41 | 0.3604 |
173
+ | 42 | 0.4087 |
174
+ | 43 | 0.3240 |
175
+ | 44 | 0.4375 |
176
+ | 45 | 0.4195 |
177
+ | 46 | 0.3881 |
178
+ | 47 | 0.4383 |
179
+ | 48 | 0.3506 |
180
+ | 49 | 0.4687 |
181
+ | 50 | 0.3709 |
182
+ | 51 | 0.3951 |
183
+ | 52 | 0.4012 |
184
+ | 53 | 0.4020 |
185
+ | 54 | 0.3977 |
186
+ | 55 | 0.2816 |
187
+ | 56 | 0.4136 |
188
+ | 57 | 0.4400 |
189
+ | 58 | 0.3268 |
190
+ | 59 | 0.4218 |
191
+ | 60 | 0.3629 |
192
+
193
+ **Final averaged train loss:** 0.4899
194
 
195
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
 
197
+ ## Environmental Impact (estimate)
198
+ - **Hardware:** RTX 4070 (12GB VRAM) [replace with actual]
199
+ - **Hours:** ~0.09 h (331 seconds)
200
+ - **Region/Provider:** [cloud/on-prem]
201
+ - **Estimated CO₂e:** Use [ML CO₂ Impact](https://mlco2.github.io/impact#compute)
202
 
203
+ ---
204
 
205
+ ## Citation
206
+
207
+ If you use this model, please cite the base model and this project:
208
+
209
+ **BibTeX (base, example):**
210
+ ```bibtex
211
+ @article{touvron2023llama,
212
+ title={LLaMA: Open and Efficient Foundation Language Models},
213
+ author={Touvron, Hugo and others},
214
+ journal={arXiv preprint arXiv:XXXX.XXXXX},
215
+ year={2023}
216
+ }
217
+ ```
218
+
219
+ **Your work (fill in):**
220
+ ```bibtex
221
+ @misc{projgen2025,
222
+ title = {ProjGen: Enhanced Developer Productivity for Flask Project Generation with a RAG-Enhanced Fine-Tuned Local LLM},
223
+ author = {Sai Praneeth, Renduchinthala and UAB-NLP Group},
224
+ year = {2025},
225
+ howpublished = {\url{https://huggingface.co/UAB-NLP/ProjGen_Finetuned_llama}}
226
+ }
227
+ ```
228
 
229
+ ---
230
 
231
+ ## Contact
232
+ - **Author:** Sai Praneeth Kumar (UAB, UAB-NLP Group)
233
+ - **HF Profile:** [UAB-NLP](https://huggingface.co/UAB-NLP)