@@ -35,112 +35,40 @@ fn try_model_nice_name_to_model_name_and_parameters(
35
35
"meta-llama/Meta-Llama-3-8B-Instruct" => Some ( (
36
36
"meta-llama/Meta-Llama-3-8B-Instruct" ,
37
37
serde_json:: json!( {
38
- "task" : "conversationa " ,
38
+ "task" : "conversational " ,
39
39
"model" : "meta-llama/Meta-Llama-3-8B-Instruct"
40
40
} )
41
41
. into ( ) ,
42
42
) ) ,
43
-
44
- "mistralai/Mistral-7B-Instruct-v0.1" => Some ( (
45
- "mistralai/Mistral-7B-Instruct-v0.1" ,
46
- serde_json:: json!( {
47
- "task" : "conversational" ,
48
- "model" : "mistralai/Mistral-7B-Instruct-v0.1" ,
49
- "device_map" : "auto" ,
50
- "torch_dtype" : "bfloat16"
51
- } )
52
- . into ( ) ,
53
- ) ) ,
54
-
55
- "TheBloke/Llama-2-7B-Chat-GPTQ" => Some ( (
56
- "TheBloke/Llama-2-7B-Chat-GPTQ" ,
57
- serde_json:: json!( {
58
- "task" : "conversational" ,
59
- "model" : "TheBloke/Llama-2-7B-Chat-GPTQ" ,
60
- "device_map" : "auto" ,
61
- "revision" : "main"
62
- } )
63
- . into ( ) ,
64
- ) ) ,
65
-
66
- "teknium/OpenHermes-2.5-Mistral-7B" => Some ( (
67
- "teknium/OpenHermes-2.5-Mistral-7B" ,
68
- serde_json:: json!( {
69
- "task" : "conversational" ,
70
- "model" : "teknium/OpenHermes-2.5-Mistral-7B" ,
71
- "device_map" : "auto" ,
72
- "torch_dtype" : "bfloat16"
73
- } )
74
- . into ( ) ,
75
- ) ) ,
76
-
77
- "Open-Orca/Mistral-7B-OpenOrca" => Some ( (
78
- "Open-Orca/Mistral-7B-OpenOrca" ,
79
- serde_json:: json!( {
80
- "task" : "conversational" ,
81
- "model" : "Open-Orca/Mistral-7B-OpenOrca" ,
82
- "device_map" : "auto" ,
83
- "torch_dtype" : "bfloat16"
84
- } )
85
- . into ( ) ,
86
- ) ) ,
87
-
88
- "Undi95/Toppy-M-7B" => Some ( (
89
- "Undi95/Toppy-M-7B" ,
90
- serde_json:: json!( {
91
- "model" : "Undi95/Toppy-M-7B" ,
92
- "device_map" : "auto" ,
93
- "torch_dtype" : "bfloat16"
94
- } )
95
- . into ( ) ,
96
- ) ) ,
97
-
98
- "Undi95/ReMM-SLERP-L2-13B" => Some ( (
99
- "Undi95/ReMM-SLERP-L2-13B" ,
43
+ "meta-llama/Meta-Llama-3-70B-Instruct" => Some ( (
44
+ "meta-llama/Meta-Llama-3-70B-Instruct" ,
100
45
serde_json:: json!( {
101
- "model" : "Undi95/ReMM-SLERP-L2-13B" ,
102
- "device_map" : "auto" ,
103
- "torch_dtype" : "bfloat16"
46
+ "task" : "conversational" ,
47
+ "model" : "meta-llama/Meta-Llama-3-70B-Instruct"
104
48
} )
105
49
. into ( ) ,
106
50
) ) ,
107
-
108
- "Gryphe/MythoMax-L2-13b" => Some ( (
109
- "Gryphe/MythoMax-L2-13b" ,
51
+ "microsoft/Phi-3-mini-128k-instruct" => Some ( (
52
+ "microsoft/Phi-3-mini-128k-instruct" ,
110
53
serde_json:: json!( {
111
- "model" : "Gryphe/MythoMax-L2-13b" ,
112
- "device_map" : "auto" ,
113
- "torch_dtype" : "bfloat16"
54
+ "task" : "conversational" ,
55
+ "model" : "microsoft/Phi-3-mini-128k-instruct"
114
56
} )
115
57
. into ( ) ,
116
58
) ) ,
117
-
118
- "PygmalionAI/mythalion-13b" => Some ( (
119
- "PygmalionAI/mythalion-13b" ,
59
+ "mistralai/Mixtral-8x7B-Instruct-v0.1" => Some ( (
60
+ "mistralai/Mixtral-8x7B-Instruct-v0.1" ,
120
61
serde_json:: json!( {
121
- "model" : "PygmalionAI/mythalion-13b" ,
122
- "device_map" : "auto" ,
123
- "torch_dtype" : "bfloat16"
62
+ "task" : "conversational" ,
63
+ "model" : "mistralai/Mixtral-8x7B-Instruct-v0.1"
124
64
} )
125
65
. into ( ) ,
126
66
) ) ,
127
-
128
- "deepseek-ai/deepseek-llm-7b-chat" => Some ( (
129
- "deepseek-ai/deepseek-llm-7b-chat" ,
67
+ "mistralai/Mistral-7B-Instruct-v0.2" => Some ( (
68
+ "mistralai/Mistral-7B-Instruct-v0.2" ,
130
69
serde_json:: json!( {
131
- "model" : "deepseek-ai/deepseek-llm-7b-chat" ,
132
- "device_map" : "auto" ,
133
- "torch_dtype" : "bfloat16"
134
- } )
135
- . into ( ) ,
136
- ) ) ,
137
-
138
- "Phind/Phind-CodeLlama-34B-v2" => Some ( (
139
- "Phind/Phind-CodeLlama-34B-v2" ,
140
- serde_json:: json!( {
141
- "model" : "Phind/Phind-CodeLlama-34B-v2" ,
142
- "device_map" : "auto" ,
143
- "torch_dtype" : "bfloat16"
70
+ "task" : "conversational" ,
71
+ "model" : "mistralai/Mistral-7B-Instruct-v0.2"
144
72
} )
145
73
. into ( ) ,
146
74
) ) ,
@@ -149,15 +77,6 @@ fn try_model_nice_name_to_model_name_and_parameters(
149
77
}
150
78
}
151
79
152
- fn try_get_model_chat_template ( model_name : & str ) -> Option < & ' static str > {
153
- match model_name {
154
- // Any Alpaca instruct tuned model
155
- "Undi95/Toppy-M-7B" | "Undi95/ReMM-SLERP-L2-13B" | "Gryphe/MythoMax-L2-13b" | "Phind/Phind-CodeLlama-34B-v2" => Some ( "{% for message in messages %}\n {% if message['role'] == 'user' %}\n {{ '### Instruction:\n ' + message['content'] + '\n '}}\n {% elif message['role'] == 'system' %}\n {{ message['content'] + '\n '}}\n {% elif message['role'] == 'model' %}\n {{ '### Response:>\n ' + message['content'] + eos_token + '\n '}}\n {% endif %}\n {% if loop.last and add_generation_prompt %}\n {{ '### Response:' }}\n {% endif %}\n {% endfor %}" ) ,
156
- "PygmalionAI/mythalion-13b" => Some ( "{% for message in messages %}\n {% if message['role'] == 'user' %}\n {{ '<|user|>\n ' + message['content'] + eos_token }}\n {% elif message['role'] == 'system' %}\n {{ '<|system|>\n ' + message['content'] + eos_token }}\n {% elif message['role'] == 'model' %}\n {{ '<|model|>\n ' + message['content'] + eos_token }}\n {% endif %}\n {% if loop.last and add_generation_prompt %}\n {{ '<|model|>' }}\n {% endif %}\n {% endfor %}" ) ,
157
- _ => None
158
- }
159
- }
160
-
161
80
struct AsyncToSyncJsonIterator ( std:: pin:: Pin < Box < dyn Stream < Item = anyhow:: Result < Json > > + Send > > ) ;
162
81
163
82
impl Iterator for AsyncToSyncJsonIterator {
@@ -265,9 +184,7 @@ mistralai/Mistral-7B-v0.1
265
184
// TODO: Add n
266
185
267
186
let mut args = serde_json:: json!( { "max_tokens" : max_tokens, "temperature" : temperature } ) ;
268
- if let Some ( t) = chat_template
269
- . or_else ( || try_get_model_chat_template ( & model_name) . map ( |s| s. to_string ( ) ) )
270
- {
187
+ if let Some ( t) = chat_template {
271
188
args. as_object_mut ( ) . unwrap ( ) . insert (
272
189
"chat_template" . to_string ( ) ,
273
190
serde_json:: to_value ( t) . unwrap ( ) ,
@@ -355,9 +272,7 @@ mistralai/Mistral-7B-v0.1
355
272
// TODO: Add n
356
273
357
274
let mut args = serde_json:: json!( { "max_tokens" : max_tokens, "temperature" : temperature } ) ;
358
- if let Some ( t) = chat_template
359
- . or_else ( || try_get_model_chat_template ( & model_name) . map ( |s| s. to_string ( ) ) )
360
- {
275
+ if let Some ( t) = chat_template {
361
276
args. as_object_mut ( ) . unwrap ( ) . insert (
362
277
"chat_template" . to_string ( ) ,
363
278
serde_json:: to_value ( t) . unwrap ( ) ,
0 commit comments