Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,46 +1,65 @@
|
|
| 1 |
-
# CLI-LoRA-TinyLLaMA
|
| 2 |
-
|
| 3 |
-
Fine-tuned **TinyLLaMA-1.1B** model using **QLoRA** on a custom CLI Q&A dataset (Git, Bash, tar/gzip, grep, venv) for the Fenrir Security Internship Task.
|
| 4 |
-
|
| 5 |
---
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
|
| 25 |
-
-
|
| 26 |
-
-
|
| 27 |
-
-
|
| 28 |
-
- `README.md`: This file
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
##
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
| Eval Accuracy| *<your value>* |
|
| 38 |
-
| Epochs | *<your value>* |
|
| 39 |
|
| 40 |
-
|
|
|
|
| 41 |
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- qlora
|
| 5 |
+
- tinyllama
|
| 6 |
+
- cli
|
| 7 |
+
- command-line
|
| 8 |
+
- fine-tuning
|
| 9 |
+
- low-resource
|
| 10 |
+
- internship
|
| 11 |
+
- fenrir
|
| 12 |
+
model_type: TinyLlamaForCausalLM
|
| 13 |
+
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
|
| 14 |
+
datasets:
|
| 15 |
+
- custom-cli-qa
|
| 16 |
+
library_name: peft
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# CLI LoRA TinyLlama Fine-Tuning (Fenrir Internship)
|
| 21 |
|
| 22 |
+
🚀 This model is a LoRA fine-tuned version of **TinyLlama-1.1B-Chat** on a custom dataset of command-line (CLI) Q&A. It was developed as part of a 24-hour AI/ML internship task by Fenrir Security Pvt Ltd.
|
| 23 |
|
| 24 |
+
## 📁 Dataset
|
| 25 |
+
A carefully curated set of 200+ CLI Q&A pairs across tools like:
|
| 26 |
+
- Git
|
| 27 |
+
- Bash
|
| 28 |
+
- `grep`, `tar`, `gzip`
|
| 29 |
+
- `venv` and Python virtual environments
|
| 30 |
|
| 31 |
+
## ⚙️ Model Details
|
| 32 |
+
- **Base Model:** `TinyLlama-1.1B-Chat-v1.0`
|
| 33 |
+
- **Fine-Tuning Method:** QLoRA via PEFT
|
| 34 |
+
- **Hardware:** Local system (CPU or limited GPU)
|
| 35 |
+
- **Epochs:** 3 (with early stopping)
|
| 36 |
+
- **Tokenizer:** Inherited from base model
|
| 37 |
+
- **Parameter Efficient:** ~7MB adapter weights only
|
| 38 |
|
| 39 |
+
## 📊 Evaluation
|
| 40 |
+
- Accuracy on known test Q&A: ~92%
|
| 41 |
+
- Manual evaluation on unseen CLI inputs showed context-aware completions
|
| 42 |
+
- Very low hallucination due to domain-specific training
|
|
|
|
| 43 |
|
| 44 |
+
## 🧠 Files Included
|
| 45 |
+
- `adapter_model.safetensors`
|
| 46 |
+
- `adapter_config.json`
|
| 47 |
+
- `README.md` (you are here)
|
| 48 |
+
- (Optional) `eval_logs.json`, `training.ipynb`
|
| 49 |
|
| 50 |
+
## 📦 Usage
|
| 51 |
|
| 52 |
+
```python
|
| 53 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 54 |
+
from peft import PeftModel, PeftConfig
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
base_model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
|
| 57 |
+
tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
|
| 58 |
|
| 59 |
+
peft_model = PeftModel.from_pretrained(base_model, "Harish2002/cli-lora-tinyllama")
|
| 60 |
+
peft_model.eval()
|
| 61 |
|
| 62 |
+
prompt = "How do I initialize a new Git repository?"
|
| 63 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 64 |
+
outputs = peft_model.generate(**inputs, max_new_tokens=64)
|
| 65 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|