Add model card (rich)
Browse files
README.md
CHANGED
|
@@ -1,199 +1,97 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
###
|
| 79 |
-
|
| 80 |
-
<!-- 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. -->
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
-
|
| 84 |
-
### Training Procedure
|
| 85 |
-
|
| 86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
-
|
| 103 |
-
## Evaluation
|
| 104 |
-
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
-
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
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).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
-
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- qwen
|
| 9 |
+
- unsloth
|
| 10 |
+
- cybersecurity
|
| 11 |
+
- instruction-tuning
|
| 12 |
+
- lora
|
| 13 |
+
- kaggle
|
| 14 |
+
base_model: unsloth/Qwen3-0.6B
|
| 15 |
+
datasets:
|
| 16 |
+
- zobayer0x01/cybersecurity-qa
|
| 17 |
+
metrics:
|
| 18 |
+
- sacrebleu
|
| 19 |
+
- rougeL
|
| 20 |
+
- f1
|
| 21 |
+
- exact_match
|
| 22 |
---
|
| 23 |
|
| 24 |
+
# qwen3-0-6b — Cybersecurity QA (LORA 8bit)
|
| 25 |
+
Fine-tuned on Kaggle using **LORA**. (Quant: LoRA + 8-bit (bnb int8))
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
### Model Summary
|
| 29 |
+
- Base: `unsloth/Qwen3-0.6B`
|
| 30 |
+
- Trainable params: **10,092,544** / total **606,142,464**
|
| 31 |
+
- Train wall time (s): 26498.1
|
| 32 |
+
- Files: adapter_model.safetensors + adapter_config.json (LoRA) + tokenizer files
|
| 33 |
+
|
| 34 |
+
### Data
|
| 35 |
+
- Dataset: `zobayer0x01/cybersecurity-qa`
|
| 36 |
+
- Samples: **total=42484**, train=38235, val=2000
|
| 37 |
+
- Prompting: Chat template with a fixed system prompt:
|
| 38 |
+
```text
|
| 39 |
+
You are a helpful assistant specialized in cybersecurity Q&A.
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
### Training Config
|
| 44 |
+
| Field | Value |
|
| 45 |
+
|---|---|
|
| 46 |
+
| Method | **LORA** |
|
| 47 |
+
| Precision | fp16 |
|
| 48 |
+
| Quantization | LoRA + 8-bit (bnb int8) |
|
| 49 |
+
| Mode | steps |
|
| 50 |
+
| Num Epochs | 1 |
|
| 51 |
+
| Max Steps | 2000 |
|
| 52 |
+
| Eval Steps | 400 |
|
| 53 |
+
| Save Steps | 400 |
|
| 54 |
+
| LR | 0.0001 |
|
| 55 |
+
| Max Length | 768 |
|
| 56 |
+
| per_device_batch_size | 1 |
|
| 57 |
+
| grad_accum | 8 |
|
| 58 |
+
|
| 59 |
+
### Evaluation (greedy)
|
| 60 |
+
| Metric | Score |
|
| 61 |
+
|---|---:|
|
| 62 |
+
| BLEU-4 | 1.27 |
|
| 63 |
+
| ROUGE-L | 14.07 |
|
| 64 |
+
| F1 | 27.83 |
|
| 65 |
+
| EM (Exact Match) | 0.00 |
|
| 66 |
+
|
| 67 |
+
> Notes: We normalize whitespace/punctuations, compute token-level P/R/F1, and use `evaluate`'s `sacrebleu/rouge/chrf`.
|
| 68 |
+
|
| 69 |
+
## How to use
|
| 70 |
+
```python
|
| 71 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 72 |
+
from peft import PeftModel
|
| 73 |
+
tok = AutoTokenizer.from_pretrained("nhonhoccode/qwen3-0-6b-cybersecqa-lora-8bit-20251102-2209")
|
| 74 |
+
base = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3-0.6B")
|
| 75 |
+
mdl = PeftModel.from_pretrained(base, "nhonhoccode/qwen3-0-6b-cybersecqa-lora-8bit-20251102-2209") # Loads LoRA adapter
|
| 76 |
+
prompt = tok.apply_chat_template(
|
| 77 |
+
[{"role":"system","content":"You are a helpful assistant specialized in cybersecurity Q&A."},
|
| 78 |
+
{"role":"user","content":"Explain SQL injection in one paragraph."}],
|
| 79 |
+
tokenize=False, add_generation_prompt=True
|
| 80 |
+
)
|
| 81 |
+
ids = tok(prompt, return_tensors="pt").input_ids
|
| 82 |
+
out = mdl.generate(ids, max_new_tokens=128, do_sample=False)
|
| 83 |
+
print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True))
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
### Intended Use & Limitations
|
| 87 |
+
- Domain: cybersecurity Q&A; not guaranteed to be accurate for legal/medical purposes.
|
| 88 |
+
- The model can hallucinate or produce outdated guidance—verify before applying in production.
|
| 89 |
+
- Safety: No explicit content filtering. Add guardrails (moderation, retrieval augmentation) for deployment.
|
| 90 |
+
|
| 91 |
+
### Reproducibility (env)
|
| 92 |
+
- `transformers>=4.43,<5`, `accelerate>=0.33,<0.34`, `peft>=0.11,<0.13`, `datasets>=2.18,<3`, `evaluate>=0.4,<0.5`,
|
| 93 |
+
`rouge-score`, `sacrebleu`, `huggingface_hub>=0.23,<0.26`, `bitsandbytes`
|
| 94 |
+
- GPU: T4-class; LoRA recommended for low VRAM.
|
| 95 |
+
|
| 96 |
+
### Changelog
|
| 97 |
+
- 2025-11-02 22:09 — Initial release (LORA-8bit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|