SanjanaCodes
commited on
Commit
•
840fbfa
1
Parent(s):
48e6e5f
Update README.md
Browse files
README.md
CHANGED
@@ -1,52 +1,39 @@
|
|
1 |
-
|
2 |
-
|
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 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
31 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
# Generate Response
|
38 |
-
output = model.generate(**inputs, max_length=150)
|
39 |
-
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
40 |
-
Training Details
|
41 |
-
Dataset
|
42 |
-
Fine-tuned on a curated dataset with:
|
43 |
-
Instruction-following data.
|
44 |
-
Security-focused prompts.
|
45 |
-
Adversarial prompts for robustness.
|
46 |
-
Training Procedure
|
47 |
-
Framework: PyTorch
|
48 |
-
Hardware: GPU-enabled nodes
|
49 |
-
Optimization Techniques:
|
50 |
-
Mixed Precision Training
|
51 |
-
Gradient Checkpointing
|
52 |
-
Evaluation Metrics: Attack Success Rate (ASR), Robustness Score
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
tags:
|
4 |
+
- causal-lm
|
5 |
+
- secure-model
|
6 |
+
- merged-lora
|
7 |
+
license: apache-2.0
|
8 |
+
---
|
9 |
+
|
10 |
+
# Llama-3.1-8b-Instruct-Secure
|
11 |
+
|
12 |
+
This model is fine-tuned with LoRA adapters for secure behavior and low ASR (Attack Success Rate).
|
13 |
+
|
14 |
+
## Model Details
|
15 |
+
|
16 |
+
- **Base Model**: Llama-3.1-8b-Instruct
|
17 |
+
- **Fine-tuning**: LoRA method
|
18 |
+
- **Purpose**: Secure language model with defenses against jailbreaking.
|
19 |
+
|
20 |
+
## Training Details
|
21 |
+
|
22 |
+
- **Dataset**: Custom synthetic data
|
23 |
+
- **Framework**: PyTorch
|
24 |
+
- **Sharding**: Model is saved in shards of 100MB to ensure compatibility.
|
25 |
+
|
26 |
+
## Usage
|
27 |
+
|
28 |
+
Load the model and tokenizer as follows:
|
29 |
+
|
30 |
+
```python
|
31 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
32 |
+
|
33 |
+
model_name = "SanjanaCodes/Llama-3.1-8b-Instruct-Secure"
|
34 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
35 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
36 |
|
37 |
+
inputs = tokenizer("Your input prompt here", return_tensors="pt")
|
38 |
+
outputs = model.generate(**inputs)
|
39 |
+
print(tokenizer.decode(outputs[0]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|