Harish2002 commited on
Commit
d86cb57
Β·
verified Β·
1 Parent(s): 4f80e7c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +52 -33
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
- ## πŸ”§ Project Overview
8
-
9
- - **Base model**: [TinyLLaMA/TinyLLaMA-1.1B-Chat-v1.0](https://huggingface.co/TinyLLaMA/TinyLLaMA-1.1B-Chat-v1.0)
10
- - **Fine-tuning method**: QLoRA
11
- - **Library**: `transformers`, `peft`, `trl`, `datasets`
12
- - **Training file**: [`training.ipynb`](./training.ipynb)
13
-
 
 
 
 
 
 
 
 
14
  ---
15
 
16
- ## 🧠 Objective
17
 
18
- To fine-tune a small language model on real-world command-line Q&A data (no LLM-generated text) and build a command-line chatbot agent capable of providing accurate CLI support.
19
 
20
- ---
 
 
 
 
 
21
 
22
- ## πŸ“‚ Files Included
 
 
 
 
 
 
23
 
24
- - `training.ipynb`: Full training notebook (cleaned, token-free)
25
- - `adapter_config.json`: LoRA adapter configuration
26
- - `adapter_model.safetensors`: Trained adapter weights
27
- - `eval_logs.json`: Sample evaluation results (accuracy, loss, etc.)
28
- - `README.md`: This file
29
 
30
- ---
 
 
 
 
31
 
32
- ## πŸ“Š Results
33
 
34
- | Metric | Value |
35
- |--------------|---------------|
36
- | Training Loss| *<your value>* |
37
- | Eval Accuracy| *<your value>* |
38
- | Epochs | *<your value>* |
39
 
40
- ---
 
41
 
42
- ## πŸ“Ž Sample Q&A
 
43
 
44
- ```bash
45
- Q: How to stash changes in Git?
46
- A: Use `git stash` to save your changes temporarily. Retrieve later using `git stash pop`.
 
 
 
 
 
 
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))