-
Notifications
You must be signed in to change notification settings - Fork 3
/
param.py
62 lines (57 loc) · 1.45 KB
/
param.py
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
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
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--seed",
type=int,
default=None,
help="Random seed for reproduction."
)
parser.add_argument("--llm_config_file", type=str, default=None, help="LLM configs")
parser.add_argument(
"--output_path",
type=str,
default=None,
help="Path to export responses and evaluation results",
)
parser.add_argument(
"--data_path",
type=str,
default=None,
help="Path to input dataset.",
)
parser.add_argument(
"--jb_file",
type=str,
default="jailbreak_prompts.csv"
)
parser.add_argument(
"--attack_file",
type=str,
default="attack_prompt.json"
)
parser.add_argument(
"--prompt_path",
type=str,
default=None,
help="Path of defense prompts."
)
parser.add_argument(
"--batch_size",
type=int,
default=20,
help="Batch size to inference."
)
parser.add_argument(
"--defense_template_index",
type=int,
default=0,
help="The defense template to use (different tone)."
)
parser.add_argument(
"--resume",
action="store_true",
help="Whether to resume from previous stored file. If the file does not exist test from scracth.",
)
args = parser.parse_args()
return args