Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- vi
|
4 |
+
- en
|
5 |
+
base_model:
|
6 |
+
- microsoft/phi-4
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
tags:
|
9 |
+
- cybersecurity
|
10 |
+
- text-generation-inference
|
11 |
+
- transformers
|
12 |
+
|
13 |
+
---
|
14 |
+
|
15 |
+
## Model Overview
|
16 |
+
| | |
|
17 |
+
|-------------------------|-------------------------------------------------------------------------------|
|
18 |
+
| **Developers** | Meta |
|
19 |
+
| **Architecture** | 14B parameters, dense decoder-only Transformer model |
|
20 |
+
| **Inputs** | Text, best suited for prompts in the chat format |
|
21 |
+
| **Context length** | 16K tokens |
|
22 |
+
| **Outputs** | Generated text in response to input |
|
23 |
+
| **License** | MIT |
|
24 |
+
|
25 |
+
## Training Datasets
|
26 |
+
Our training data is an extension of the data used for `cyber-llm-14b` and includes a wide variety of sources from:
|
27 |
+
|
28 |
+
1. Publicly available blogs, papers, reference from: https://github.com/PEASEC/cybersecurity_dataset.
|
29 |
+
|
30 |
+
2. Newly created synthetic, "textbook-like" data for the purpose of teaching cybersecurity (use GPT-4o).
|
31 |
+
|
32 |
+
3. Acquired academic books and Q&A datasets
|
33 |
+
|
34 |
+
|
35 |
+
## Usage
|
36 |
+
|
37 |
+
### Input Formats
|
38 |
+
|
39 |
+
Given the nature of the training data, `cyber-llm-14b` is best suited for prompts using the chat format as follows:
|
40 |
+
|
41 |
+
```bash
|
42 |
+
<|begin_of_text|><|start_header_id|>user<|end_header_id|>
|
43 |
+
Hello!<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
44 |
+
Hey there! How are you?<|eot_id|><|start_header_id|>user<|end_header_id|>
|
45 |
+
I'm great thanks!<|eot_id|>
|
46 |
+
```
|
47 |
+
|
48 |
+
### With `transformers`
|
49 |
+
|
50 |
+
```python
|
51 |
+
import transformers
|
52 |
+
|
53 |
+
pipeline = transformers.pipeline(
|
54 |
+
"text-generation",
|
55 |
+
model="viettelsecurity-ai/cyber-llm-14b",
|
56 |
+
model_kwargs={"torch_dtype": "auto"},
|
57 |
+
device_map="auto",
|
58 |
+
)
|
59 |
+
|
60 |
+
messages = [
|
61 |
+
{"role": "system", "content": "You are a SOC-tier3"},
|
62 |
+
{"role": "user", "content": "What is the url phishing?"},
|
63 |
+
]
|
64 |
+
|
65 |
+
outputs = pipeline(messages, max_new_tokens=2048)
|
66 |
+
print(outputs[0]["generated_text"][-1])
|
67 |
+
```
|