@@ -35,112 +35,40 @@ fn try_model_nice_name_to_model_name_and_parameters(
3535 "meta-llama/Meta-Llama-3-8B-Instruct" => Some ( (
3636 "meta-llama/Meta-Llama-3-8B-Instruct" ,
3737 serde_json:: json!( {
38- "task" : "conversationa " ,
38+ "task" : "conversational " ,
3939 "model" : "meta-llama/Meta-Llama-3-8B-Instruct"
4040 } )
4141 . into ( ) ,
4242 ) ) ,
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" ,
10045 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"
10448 } )
10549 . into ( ) ,
10650 ) ) ,
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" ,
11053 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"
11456 } )
11557 . into ( ) ,
11658 ) ) ,
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" ,
12061 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"
12464 } )
12565 . into ( ) ,
12666 ) ) ,
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" ,
13069 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"
14472 } )
14573 . into ( ) ,
14674 ) ) ,
@@ -149,15 +77,6 @@ fn try_model_nice_name_to_model_name_and_parameters(
14977 }
15078}
15179
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-
16180struct AsyncToSyncJsonIterator ( std:: pin:: Pin < Box < dyn Stream < Item = anyhow:: Result < Json > > + Send > > ) ;
16281
16382impl Iterator for AsyncToSyncJsonIterator {
@@ -265,9 +184,7 @@ mistralai/Mistral-7B-v0.1
265184 // TODO: Add n
266185
267186 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 {
271188 args. as_object_mut ( ) . unwrap ( ) . insert (
272189 "chat_template" . to_string ( ) ,
273190 serde_json:: to_value ( t) . unwrap ( ) ,
@@ -355,9 +272,7 @@ mistralai/Mistral-7B-v0.1
355272 // TODO: Add n
356273
357274 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 {
361276 args. as_object_mut ( ) . unwrap ( ) . insert (
362277 "chat_template" . to_string ( ) ,
363278 serde_json:: to_value ( t) . unwrap ( ) ,
0 commit comments