Update README.md
Browse files
README.md
CHANGED
|
@@ -2,199 +2,174 @@
|
|
| 2 |
library_name: transformers
|
| 3 |
tags:
|
| 4 |
- unsloth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
-
# Model Card
|
| 8 |
-
|
| 9 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 10 |
|
|
|
|
|
|
|
| 11 |
|
|
|
|
| 12 |
|
| 13 |
## Model Details
|
| 14 |
|
| 15 |
### Model Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
|
| 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 |
-
|
| 40 |
|
| 41 |
### Direct Use
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 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 |
-
|
| 62 |
-
|
| 63 |
-
[More Information Needed]
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
|
| 73 |
-
|
| 74 |
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
|
| 80 |
|
| 81 |
-
|
| 82 |
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
### Training Procedure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
-
|
| 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 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 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 |
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
|
| 194 |
-
|
| 195 |
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
-
|
| 199 |
|
| 200 |
-
|
|
|
|
|
|
|
|
|
| 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: Sai2076/LLLMA_FINETUNED_PROJEN
|
|
|
|
|
|
|
| 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:** Sai Praneeth (UAB, ProjGen Project)
|
| 30 |
+
- **Finetuned from:** `meta-llama/Llama-3.2-<SIZE>-Instruct`
|
| 31 |
+
- **Shared by:** [Sai2076](https://huggingface.co/Sai2076)
|
| 32 |
+
|
| 33 |
+
### Model Sources
|
| 34 |
+
- **Repository:** [Sai2076/LLLMA_FINETUNED_PROJEN](https://huggingface.co/Sai2076/LLLMA_FINETUNED_PROJEN)
|
| 35 |
+
- **Project Paper:** ProjGen – Enhanced Developer Productivity for Flask Project Generation with a RAG-Enhanced Fine-Tuned Local LLM
|
| 36 |
+
- **Demo (optional):** [link to demo if available]
|
| 37 |
|
| 38 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
+
## Intended Uses & Limitations
|
| 41 |
|
| 42 |
### Direct Use
|
| 43 |
+
- Generating Flask/Django/Streamlit project structures automatically.
|
| 44 |
+
- Instruction-following tasks related to software engineering and code generation.
|
| 45 |
|
| 46 |
+
### Downstream Use
|
| 47 |
+
- Further fine-tuning on domain-specific datasets (e.g., medical imaging, finance, etc.).
|
| 48 |
+
- Integration into developer assistants and productivity tools.
|
| 49 |
|
| 50 |
+
### Out-of-Scope / Limitations
|
| 51 |
+
- Not suitable for medical, legal, or financial decision-making without human review.
|
| 52 |
+
- May hallucinate or produce insecure/inefficient code if not monitored.
|
| 53 |
|
| 54 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
## Bias, Risks, and Limitations
|
| 57 |
+
The model inherits risks from the base **LLaMA-3.2** model:
|
| 58 |
+
- Possible hallucinations and factual inaccuracies.
|
| 59 |
+
- Dataset/domain biases reflected in responses.
|
| 60 |
+
- Outputs should be validated before production deployment.
|
| 61 |
|
| 62 |
+
**Recommendation:** Always pair outputs with testing, validation, and human oversight.
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
---
|
| 65 |
|
| 66 |
+
## Getting Started
|
| 67 |
|
| 68 |
+
### Inference (PEFT adapter form)
|
| 69 |
+
```python
|
| 70 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
| 71 |
|
| 72 |
+
model_id = "Sai2076/LLLMA_FINETUNED_PROJEN"
|
| 73 |
|
| 74 |
+
tok = AutoTokenizer.from_pretrained(model_id)
|
| 75 |
|
| 76 |
+
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True)
|
| 77 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 78 |
+
model_id,
|
| 79 |
+
quantization_config=bnb,
|
| 80 |
+
device_map="auto",
|
| 81 |
+
torch_dtype="auto"
|
| 82 |
+
)
|
| 83 |
|
| 84 |
+
prompt = "Generate a Flask project with login, dashboard, and reports."
|
| 85 |
+
inputs = tok(prompt, return_tensors="pt").to(model.device)
|
| 86 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 87 |
+
print(tok.decode(outputs[0], skip_special_tokens=True))
|
| 88 |
+
```
|
| 89 |
|
| 90 |
+
---
|
| 91 |
|
| 92 |
+
## Training Details
|
| 93 |
|
| 94 |
+
### Data
|
| 95 |
+
- **Dataset:** Custom **ProjGen dataset** built from structured Flask/Django/Streamlit projects and instructions.
|
| 96 |
+
- **Size:** [Fill in #samples / tokens]
|
| 97 |
+
- **Preprocessing:** Chat-style instruction formatting (system/user/assistant), deduplication, truncation at 4096 tokens.
|
| 98 |
|
| 99 |
### Training Procedure
|
| 100 |
+
- **Quantization:** 4-bit NF4 + double quantization (bitsandbytes)
|
| 101 |
+
- **LoRA Config:**
|
| 102 |
+
- `r`: 16
|
| 103 |
+
- `alpha`: 32
|
| 104 |
+
- `dropout`: 0.05
|
| 105 |
+
- Target modules: q_proj, k_proj, v_proj, o_proj, gate_up_proj, down_proj
|
| 106 |
+
- **Optimizer:** Paged AdamW (32-bit)
|
| 107 |
+
- **LR / Schedule:** 2e-4 with cosine decay + warmup
|
| 108 |
+
- **Batch size:** [fill in effective batch size]
|
| 109 |
+
- **Epochs/Steps:** [fill in from ipynb]
|
| 110 |
+
- **Precision:** bf16 mixed precision
|
| 111 |
+
- **Grad checkpointing:** Enabled
|
| 112 |
+
- **Flash attention:** Enabled (Unsloth optimization)
|
| 113 |
+
|
| 114 |
+
### Training Hardware
|
| 115 |
+
- **GPU:** RTX 4070 (12GB VRAM) [replace with actual if different]
|
| 116 |
+
- **Training time:** [fill in hours]
|
| 117 |
+
- **Checkpoint size:** ~ (adapter size: ~200MB; merged model size depends on base LLaMA size)
|
| 118 |
|
| 119 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
## Evaluation
|
| 122 |
|
| 123 |
+
### Data & Metrics
|
| 124 |
+
- **Validation set:** Held-out portion of ProjGen dataset
|
| 125 |
+
- **Metrics:**
|
| 126 |
+
- Instruction Following: Exact Match, ROUGE-L
|
| 127 |
+
- Code Generation: Pass@k (via unit test evaluation)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
### Results
|
| 130 |
+
| Metric | Value | Notes |
|
| 131 |
+
|-----------------------|--------|-----------------------|
|
| 132 |
+
| Validation Loss | ___ | From training logs |
|
| 133 |
+
| Exact Match / F1 | ___ | |
|
| 134 |
+
| ROUGE-L / BLEU | ___ | |
|
| 135 |
+
| Pass@1 | ___ | |
|
| 136 |
|
| 137 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
+
## Environmental Impact (estimate)
|
| 140 |
+
- **Hardware:** RTX 4070 (12GB VRAM) [replace with actual]
|
| 141 |
+
- **Hours:** [fill in H]
|
| 142 |
+
- **Region/Provider:** [cloud/on-prem]
|
| 143 |
+
- **Estimated CO₂e:** Use [ML CO₂ Impact](https://mlco2.github.io/impact#compute)
|
| 144 |
|
| 145 |
+
---
|
| 146 |
|
| 147 |
+
## Citation
|
| 148 |
+
|
| 149 |
+
If you use this model, please cite the base model and this project:
|
| 150 |
+
|
| 151 |
+
**BibTeX (base, example):**
|
| 152 |
+
```bibtex
|
| 153 |
+
@article{touvron2023llama,
|
| 154 |
+
title={LLaMA: Open and Efficient Foundation Language Models},
|
| 155 |
+
author={Touvron, Hugo and others},
|
| 156 |
+
journal={arXiv preprint arXiv:XXXX.XXXXX},
|
| 157 |
+
year={2023}
|
| 158 |
+
}
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
**Your work (fill in):**
|
| 162 |
+
```bibtex
|
| 163 |
+
@misc{projgen2025,
|
| 164 |
+
title = {ProjGen: Enhanced Developer Productivity for Flask Project Generation with a RAG-Enhanced Fine-Tuned Local LLM},
|
| 165 |
+
author = {Sai Praneeth, Renduchinthala},
|
| 166 |
+
year = {2025},
|
| 167 |
+
howpublished = {\url{https://huggingface.co/Sai2076/LLLMA_FINETUNED_PROJEN}}
|
| 168 |
+
}
|
| 169 |
+
```
|
| 170 |
|
| 171 |
+
---
|
| 172 |
|
| 173 |
+
## Contact
|
| 174 |
+
- **Author:** Sai Praneeth Kumar (UAB)
|
| 175 |
+
- **HF Profile:** [Sai2076](https://huggingface.co/Sai2076)
|