Commit
·
cea9470
1
Parent(s):
b2c43be
feat: quantization per channel
Browse files- README.md +7 -7
- config.json +2 -2
- model.onnx +2 -2
- model.quant.onnx +2 -2
- tokenizer_config.json +1 -2
README.md
CHANGED
|
@@ -38,16 +38,16 @@ This repository provides a ONNX converted and quantized version of meta-llama/Ll
|
|
| 38 |
## 📥 Evaluation Dataset
|
| 39 |
|
| 40 |
We use [`jackhhao/jailbreak-classification`](https://huggingface.co/datasets/jackhhao/jailbreak-classification)
|
| 41 |
-
for the evaluation
|
| 42 |
|
| 43 |
## 🧪 Evaluation Results
|
| 44 |
|
| 45 |
-
| Model | Accuracy | Precision | Recall | F1 Score | AUC-ROC |
|
| 46 |
-
|
| 47 |
-
| Llama-Prompt-Guard-2-22M | 0.
|
| 48 |
-
| Llama-Prompt-Guard-2-22M-q | 0.
|
| 49 |
-
| Llama-Prompt-Guard-2-86M | 0.
|
| 50 |
-
| Llama-Prompt-Guard-2-86M-q | 0.
|
| 51 |
|
| 52 |
## 🤗 Usage
|
| 53 |
|
|
|
|
| 38 |
## 📥 Evaluation Dataset
|
| 39 |
|
| 40 |
We use [`jackhhao/jailbreak-classification`](https://huggingface.co/datasets/jackhhao/jailbreak-classification)
|
| 41 |
+
for the evaluation (train+test)
|
| 42 |
|
| 43 |
## 🧪 Evaluation Results
|
| 44 |
|
| 45 |
+
| Model | Accuracy | Precision | Recall | F1 Score | AUC-ROC |
|
| 46 |
+
|----------------------------|----------|-----------|--------|----------|---------|
|
| 47 |
+
| Llama-Prompt-Guard-2-22M | 0.9564 | 0.9888 | 0.9249 | 0.9558 | 0.9234 |
|
| 48 |
+
| Llama-Prompt-Guard-2-22M-q | 0.9579 | 0.9967 | 0.9204 | 0.9449 | 0.9180 |
|
| 49 |
+
| Llama-Prompt-Guard-2-86M | 0.9801 | 0.9984 | 0.9625 | 0.9801 | 0.9519 |
|
| 50 |
+
| Llama-Prompt-Guard-2-86M-q | 0.8989 | 1.0000 | 0.8018 | 0.89 | 0.7452 |
|
| 51 |
|
| 52 |
## 🤗 Usage
|
| 53 |
|
config.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"DebertaV2ForSequenceClassification"
|
| 4 |
],
|
|
@@ -9,7 +10,6 @@
|
|
| 9 |
"initializer_range": 0.02,
|
| 10 |
"intermediate_size": 1536,
|
| 11 |
"layer_norm_eps": 1e-07,
|
| 12 |
-
"legacy": true,
|
| 13 |
"max_position_embeddings": 512,
|
| 14 |
"max_relative_positions": -1,
|
| 15 |
"model_type": "deberta-v2",
|
|
@@ -29,7 +29,7 @@
|
|
| 29 |
"relative_attention": true,
|
| 30 |
"share_att_key": true,
|
| 31 |
"torch_dtype": "float32",
|
| 32 |
-
"transformers_version": "4.
|
| 33 |
"type_vocab_size": 0,
|
| 34 |
"vocab_size": 128100,
|
| 35 |
"id2label": {
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "meta-llama/Llama-Prompt-Guard-2-22M",
|
| 3 |
"architectures": [
|
| 4 |
"DebertaV2ForSequenceClassification"
|
| 5 |
],
|
|
|
|
| 10 |
"initializer_range": 0.02,
|
| 11 |
"intermediate_size": 1536,
|
| 12 |
"layer_norm_eps": 1e-07,
|
|
|
|
| 13 |
"max_position_embeddings": 512,
|
| 14 |
"max_relative_positions": -1,
|
| 15 |
"model_type": "deberta-v2",
|
|
|
|
| 29 |
"relative_attention": true,
|
| 30 |
"share_att_key": true,
|
| 31 |
"torch_dtype": "float32",
|
| 32 |
+
"transformers_version": "4.40.2",
|
| 33 |
"type_vocab_size": 0,
|
| 34 |
"vocab_size": 128100,
|
| 35 |
"id2label": {
|
model.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c6f4d2ebf59be36f3557ad484bf11a51f1b356f570958d1ec1cbbe322a8dfddf
|
| 3 |
+
size 284217797
|
model.quant.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ceefc0eedded030caf427faf828729b25a97f3ce70a043987aa68b912fdf836a
|
| 3 |
+
size 72752037
|
tokenizer_config.json
CHANGED
|
@@ -46,7 +46,6 @@
|
|
| 46 |
"cls_token": "[CLS]",
|
| 47 |
"do_lower_case": false,
|
| 48 |
"eos_token": "[SEP]",
|
| 49 |
-
"extra_special_tokens": {},
|
| 50 |
"mask_token": "[MASK]",
|
| 51 |
"max_length": 512,
|
| 52 |
"model_max_length": 1000000000000000019884624838656,
|
|
@@ -58,7 +57,7 @@
|
|
| 58 |
"sp_model_kwargs": {},
|
| 59 |
"split_by_punct": false,
|
| 60 |
"stride": 0,
|
| 61 |
-
"tokenizer_class": "
|
| 62 |
"truncation_side": "right",
|
| 63 |
"truncation_strategy": "longest_first",
|
| 64 |
"unk_token": "[UNK]",
|
|
|
|
| 46 |
"cls_token": "[CLS]",
|
| 47 |
"do_lower_case": false,
|
| 48 |
"eos_token": "[SEP]",
|
|
|
|
| 49 |
"mask_token": "[MASK]",
|
| 50 |
"max_length": 512,
|
| 51 |
"model_max_length": 1000000000000000019884624838656,
|
|
|
|
| 57 |
"sp_model_kwargs": {},
|
| 58 |
"split_by_punct": false,
|
| 59 |
"stride": 0,
|
| 60 |
+
"tokenizer_class": "DebertaV2Tokenizer",
|
| 61 |
"truncation_side": "right",
|
| 62 |
"truncation_strategy": "longest_first",
|
| 63 |
"unk_token": "[UNK]",
|