-
Notifications
You must be signed in to change notification settings - Fork 64
/
config.py
99 lines (89 loc) · 3.21 KB
/
config.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
from enum import Enum
VICUNA_PATH = "/home/pchao/vicuna-13b-v1.5"
LLAMA_PATH = "/home/pchao/Llama-2-7b-chat-hf"
ATTACK_TEMP = 1
TARGET_TEMP = 0
ATTACK_TOP_P = 0.9
TARGET_TOP_P = 1
## MODEL PARAMETERS ##
class Model(Enum):
vicuna = "vicuna-13b-v1.5"
llama_2 = "llama-2-7b-chat-hf"
gpt_3_5 = "gpt-3.5-turbo-1106"
gpt_4 = "gpt-4-0125-preview"
claude_1 = "claude-instant-1.2"
claude_2 = "claude-2.1"
gemini = "gemini-pro"
mixtral = "mixtral"
MODEL_NAMES = [model.value for model in Model]
HF_MODEL_NAMES: dict[Model, str] = {
Model.llama_2: "meta-llama/Llama-2-7b-chat-hf",
Model.vicuna: "lmsys/vicuna-13b-v1.5",
Model.mixtral: "mistralai/Mixtral-8x7B-Instruct-v0.1"
}
TOGETHER_MODEL_NAMES: dict[Model, str] = {
Model.llama_2: "together_ai/togethercomputer/llama-2-7b-chat",
Model.vicuna: "together_ai/lmsys/vicuna-13b-v1.5",
Model.mixtral: "together_ai/mistralai/Mixtral-8x7B-Instruct-v0.1"
}
FASTCHAT_TEMPLATE_NAMES: dict[Model, str] = {
Model.gpt_3_5: "gpt-3.5-turbo",
Model.gpt_4: "gpt-4",
Model.claude_1: "claude-instant-1.2",
Model.claude_2: "claude-2.1",
Model.gemini: "gemini-pro",
Model.vicuna: "vicuna_v1.1",
Model.llama_2: "llama-2-7b-chat-hf",
Model.mixtral: "mixtral",
}
API_KEY_NAMES: dict[Model, str] = {
Model.gpt_3_5: "OPENAI_API_KEY",
Model.gpt_4: "OPENAI_API_KEY",
Model.claude_1: "ANTHROPIC_API_KEY",
Model.claude_2: "ANTHROPIC_API_KEY",
Model.gemini: "GEMINI_API_KEY",
Model.vicuna: "TOGETHER_API_KEY",
Model.llama_2: "TOGETHER_API_KEY",
Model.mixtral: "TOGETHER_API_KEY",
}
LITELLM_TEMPLATES: dict[Model, dict] = {
Model.vicuna: {"roles":{
"system": {"pre_message": "", "post_message": " "},
"user": {"pre_message": "USER: ", "post_message": " ASSISTANT:"},
"assistant": {
"pre_message": "",
"post_message": "",
},
},
"post_message":"</s>",
"initial_prompt_value" : "",
"eos_tokens": ["</s>"]
},
Model.llama_2: {"roles":{
"system": {"pre_message": "[INST] <<SYS>>\n", "post_message": "\n<</SYS>>\n\n"},
"user": {"pre_message": "", "post_message": " [/INST]"},
"assistant": {"pre_message": "", "post_message": ""},
},
"post_message" : " </s><s>",
"initial_prompt_value" : "",
"eos_tokens" : ["</s>", "[/INST]"]
},
Model.mixtral: {"roles":{
"system": {
"pre_message": "[INST] ",
"post_message": " [/INST]"
},
"user": {
"pre_message": "[INST] ",
"post_message": " [/INST]"
},
"assistant": {
"pre_message": " ",
"post_message": "",
}
},
"post_message": "</s>",
"initial_prompt_value" : "<s>",
"eos_tokens": ["</s>", "[/INST]"]
}
}