Skip to content

Commit be5db52

Browse files
infwinstonsimon-moBabyChouSr
authored
Merge operation & multimodal arena (#3425)
Co-authored-by: simon-mo <[email protected]> Co-authored-by: Christopher Chou <[email protected]>
1 parent b84ca7a commit be5db52

17 files changed

+1527
-1039
lines changed

fastchat/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
CONVERSATION_LIMIT_MSG = "YOU HAVE REACHED THE CONVERSATION LENGTH LIMIT. PLEASE CLEAR HISTORY AND START A NEW CONVERSATION."
2222
INACTIVE_MSG = "THIS SESSION HAS BEEN INACTIVE FOR TOO LONG. PLEASE REFRESH THIS PAGE."
2323
SLOW_MODEL_MSG = "⚠️ Both models will show the responses all at once. Please stay patient as it may take over 30 seconds."
24-
RATE_LIMIT_MSG = "**RATE LIMIT OF THIS MODEL IS REACHED. PLEASE COME BACK LATER OR USE BATTLE MODE (the 1st tab).**"
24+
RATE_LIMIT_MSG = "**RATE LIMIT OF THIS MODEL IS REACHED. PLEASE COME BACK LATER OR USE <span style='color: red; font-weight: bold;'>[BATTLE MODE](https://chat.lmsys.org)</span> (the 1st tab).**"
2525
# Maximum input length
2626
INPUT_CHAR_LEN_LIMIT = int(os.getenv("FASTCHAT_INPUT_CHAR_LEN_LIMIT", 12000))
2727
BLIND_MODE_INPUT_CHAR_LEN_LIMIT = int(
28-
os.getenv("FASTCHAT_BLIND_MODE_INPUT_CHAR_LEN_LIMIT", 24000)
28+
os.getenv("FASTCHAT_BLIND_MODE_INPUT_CHAR_LEN_LIMIT", 30000)
2929
)
3030
# Maximum conversation turns
3131
CONVERSATION_TURN_LIMIT = 50

fastchat/conversation.py

Lines changed: 123 additions & 110 deletions
Large diffs are not rendered by default.

fastchat/model/model_adapter.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"claude-3-haiku-20240307-vertex",
6262
"claude-3-sonnet-20240229",
6363
"claude-3-sonnet-20240229-vertex",
64+
"claude-3-5-sonnet-20240620",
6465
"claude-3-opus-20240229",
6566
"claude-instant-1",
6667
"claude-instant-1.2",
@@ -80,6 +81,10 @@
8081
"gpt-4-0125-preview",
8182
"gpt-4-turbo-browsing",
8283
"gpt-4-turbo-2024-04-09",
84+
"gpt2-chatbot",
85+
"im-also-a-good-gpt2-chatbot",
86+
"im-a-good-gpt2-chatbot",
87+
"gpt-4o-2024-05-13",
8388
)
8489

8590

@@ -1111,6 +1116,10 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
11111116
return get_conv_template("api_based_default")
11121117
if "gpt-4-turbo-2024-04-09" in model_path:
11131118
return get_conv_template("gpt-4-turbo-2024-04-09")
1119+
if "gpt2-chatbot" in model_path:
1120+
return get_conv_template("gpt-4-turbo-2024-04-09")
1121+
if "gpt-4o" in model_path:
1122+
return get_conv_template("gpt-4-turbo-2024-04-09")
11141123
return get_conv_template("chatgpt")
11151124

11161125

@@ -1157,6 +1166,8 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
11571166
return get_conv_template("claude-3-haiku-20240307")
11581167
if "claude-3-sonnet" in model_path:
11591168
return get_conv_template("claude-3-sonnet-20240229")
1169+
if "claude-3-5-sonnet" in model_path:
1170+
return get_conv_template("claude-3-5-sonnet-20240620")
11601171
if "claude-3-opus" in model_path:
11611172
return get_conv_template("claude-3-opus-20240229")
11621173
return get_conv_template("claude")
@@ -2179,6 +2190,21 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
21792190
return get_conv_template("deepseek-chat")
21802191

21812192

2193+
class GeminiAdapter(BaseModelAdapter):
2194+
"""The model adapter for Gemini"""
2195+
2196+
def match(self, model_path: str):
2197+
return "gemini" in model_path.lower() or "bard" in model_path.lower()
2198+
2199+
def load_model(self, model_path: str, from_pretrained_kwargs: dict):
2200+
raise NotImplementedError()
2201+
2202+
def get_default_conv_template(self, model_path: str) -> Conversation:
2203+
if "gemini-1.5-pro" in model_path:
2204+
return get_conv_template("gemini-1.5-pro")
2205+
return get_conv_template("gemini")
2206+
2207+
21822208
class Yuan2Adapter(BaseModelAdapter):
21832209
"""The model adapter for Yuan2.0"""
21842210

@@ -2470,7 +2496,6 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
24702496
register_model_adapter(InternLMChatAdapter)
24712497
register_model_adapter(StarChatAdapter)
24722498
register_model_adapter(Llama2Adapter)
2473-
register_model_adapter(Llama3Adapter)
24742499
register_model_adapter(CuteGPTAdapter)
24752500
register_model_adapter(OpenOrcaAdapter)
24762501
register_model_adapter(DolphinAdapter)
@@ -2519,6 +2544,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
25192544
register_model_adapter(CllmAdapter)
25202545
register_model_adapter(RekaAdapter)
25212546
register_model_adapter(SmaugChatAdapter)
2547+
register_model_adapter(Llama3Adapter)
25222548

25232549
# After all adapters, try the default base adapter.
25242550
register_model_adapter(BaseModelAdapter)

fastchat/model/model_registry.py

Lines changed: 176 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def get_model_info(name: str) -> ModelInfo:
4242

4343
register_model_info(
4444
[
45+
"claude-3-5-sonnet-20240620",
4546
"claude-3-haiku-20240307",
4647
"claude-3-sonnet-20240229",
4748
"claude-3-opus-20240229",
@@ -55,7 +56,139 @@ def get_model_info(name: str) -> ModelInfo:
5556
)
5657

5758
register_model_info(
58-
["reka-flash", "reka-flash-online"],
59+
["gemma-2-27b-it", "gemma-2-9b-it"],
60+
"Gemma 2",
61+
"https://ai.google.dev/gemma",
62+
"Gemma 2 by Google",
63+
)
64+
65+
register_model_info(
66+
[
67+
"gemini-1.5-pro-api-0409-preview",
68+
"gemini-1.5-pro-tuned",
69+
"gemini-1.5-pro-api-preview",
70+
"gemini-1.5-flash-api-preview",
71+
"gemini-1.5-flash-api-0514",
72+
"gemini-1.5-pro-api-0514",
73+
"gemini-advanced-0514",
74+
],
75+
"Gemini",
76+
"https://deepmind.google/technologies/gemini/",
77+
"Gemini by Google",
78+
)
79+
80+
register_model_info(
81+
["deepseek-coder-v2"],
82+
"DeepSeek Coder v2",
83+
"https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Instruct",
84+
"An advanced code model by DeepSeek",
85+
)
86+
87+
register_model_info(
88+
["nemotron-4-340b"],
89+
"Nemotron-4 340B",
90+
"https://huggingface.co/nvidia/Nemotron-4-340B-Instruct",
91+
"Cutting-edge Open model by Nvidia",
92+
)
93+
94+
register_model_info(
95+
["llama-3-70b-instruct", "llama-3-8b-instruct"],
96+
"Llama 3",
97+
"https://ai.meta.com/blog/meta-llama-3/",
98+
"Open foundation and chat models by Meta",
99+
)
100+
101+
register_model_info(
102+
[
103+
"qwen2-72b-instruct",
104+
"qwen-max-0403",
105+
"qwen-max-0428",
106+
],
107+
"Qwen Max",
108+
"https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction",
109+
"The Frontier Qwen Model by Alibaba",
110+
)
111+
112+
register_model_info(
113+
[
114+
"gpt-4o-2024-05-13",
115+
],
116+
"GPT-4o",
117+
"https://openai.com/index/hello-gpt-4o/",
118+
"The flagship model across audio, vision, and text by OpenAI",
119+
)
120+
121+
register_model_info(
122+
[
123+
"gpt-4-turbo",
124+
"gpt-4o-2024-05-13",
125+
"gpt-4-turbo-2024-04-09",
126+
"gpt-4-1106-preview",
127+
"gpt-4-0125-preview",
128+
"gpt2-chatbot",
129+
"im-also-a-good-gpt2-chatbot",
130+
"im-a-good-gpt2-chatbot",
131+
],
132+
"GPT-4-Turbo",
133+
"https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo",
134+
"GPT-4-Turbo by OpenAI",
135+
)
136+
137+
register_model_info(
138+
[
139+
"gpt-3.5-turbo",
140+
"gpt-3.5-turbo-0125",
141+
"gpt-3.5-turbo-1106",
142+
"gpt-3.5-turbo-0314",
143+
"gpt-3.5-turbo-0613",
144+
],
145+
"GPT-3.5",
146+
"https://platform.openai.com/docs/models/gpt-3-5",
147+
"GPT-3.5-Turbo by OpenAI",
148+
)
149+
150+
register_model_info(
151+
["yi-large-preview", "yi-large"],
152+
"Yi-Large",
153+
"https://x.com/01AI_Yi/status/1789894091620458667",
154+
"State-of-the-art model by 01 AI",
155+
)
156+
157+
register_model_info(
158+
["yi-1.5-34b-chat", "yi-34b-chat", "yi-6b-chat"],
159+
"Yi-Chat",
160+
"https://huggingface.co/01-ai/",
161+
"A large language model by 01 AI",
162+
)
163+
164+
register_model_info(
165+
[
166+
"phi-3-medium-4k-instruct",
167+
"phi-3-small-8k-instruct",
168+
"phi-3-mini-4k-instruct",
169+
"phi-3-mini-128k-instruct",
170+
],
171+
"Phi-3",
172+
"https://azure.microsoft.com/en-us/blog/introducing-phi-3-redefining-whats-possible-with-slms/",
173+
"A capable and cost-effective small language models (SLMs) by Microsoft",
174+
)
175+
176+
register_model_info(
177+
["reka-core-20240501"],
178+
"Reka Core",
179+
"https://www.reka.ai/news/reka-core-our-frontier-class-multimodal-language-model",
180+
"Frontier Multimodal Language Model by Reka",
181+
)
182+
183+
register_model_info(
184+
["gemini-pro", "gemini-pro-dev-api"],
185+
"Gemini",
186+
"https://blog.google/technology/ai/google-gemini-pro-imagen-duet-ai-update/",
187+
"Gemini by Google",
188+
)
189+
190+
register_model_info(
191+
["reka-flash-preview-20240611", "reka-flash", "reka-flash-online"],
59192
"Reka Flash",
60193
"https://www.reka.ai/news/reka-flash-efficient-and-capable-multimodal-language-models",
61194
"Multimodal model by Reka",
@@ -75,22 +208,23 @@ def get_model_info(name: str) -> ModelInfo:
75208
"Command-R by Cohere",
76209
)
77210

78-
register_model_info(
79-
[
80-
"zephyr-orpo-141b-A35b-v0.1",
81-
],
82-
"Zephyr 141B-A35B",
83-
"https://huggingface.co/HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1",
84-
"ORPO fine-tuned of Mixtral-8x22B-v0.1",
85-
)
86-
87211
register_model_info(
88212
["gemma-1.1-7b-it", "gemma-1.1-2b-it", "gemma-7b-it", "gemma-2b-it"],
89213
"Gemma",
90214
"https://blog.google/technology/developers/gemma-open-models/",
91215
"Gemma by Google",
92216
)
93217

218+
register_model_info(
219+
[
220+
"codestral-2405",
221+
"mixtral-8x22b-instruct-v0.1",
222+
],
223+
"Mixtral of experts",
224+
"https://mistral.ai/news/mixtral-8x22b/",
225+
"A Mixture-of-Experts model by Mistral AI",
226+
)
227+
94228
register_model_info(
95229
[
96230
"mixtral-8x7b-instruct-v0.1",
@@ -105,6 +239,15 @@ def get_model_info(name: str) -> ModelInfo:
105239
"A Mixture-of-Experts model by Mistral AI",
106240
)
107241

242+
register_model_info(
243+
[
244+
"qwen1.5-110b-chat",
245+
],
246+
"Qwen 1.5",
247+
"https://qwenlm.github.io/blog/qwen1.5-110b/",
248+
"The First 100B+ Model of the Qwen1.5 Series",
249+
)
250+
108251
register_model_info(
109252
[
110253
"qwen1.5-72b-chat",
@@ -121,14 +264,36 @@ def get_model_info(name: str) -> ModelInfo:
121264
"A large language model by Alibaba Cloud",
122265
)
123266

267+
register_model_info(
268+
["glm-4-0520", "glm-4-0116"],
269+
"GLM-4",
270+
"https://zhipuai.cn/devday",
271+
"Next-Gen Foundation Model by Zhipu AI",
272+
)
273+
274+
register_model_info(
275+
["snowflake-arctic-instruct"],
276+
"Snowflake Arctic Instruct",
277+
"https://www.snowflake.com/blog/arctic-open-efficient-foundation-language-models-snowflake/",
278+
"Dense-MoE transformer by Snowflake AI",
279+
)
124280

125281
register_model_info(
126-
["dbrx-instruct"],
282+
["dbrx-instruct", "dbrx-next"],
127283
"DBRX Instruct",
128284
"https://www.databricks.com/blog/introducing-dbrx-new-state-art-open-llm",
129285
"DBRX by Databricks Mosaic AI",
130286
)
131287

288+
register_model_info(
289+
[
290+
"zephyr-orpo-141b-A35b-v0.1",
291+
],
292+
"Zephyr 141B-A35B",
293+
"https://huggingface.co/HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1",
294+
"ORPO fine-tuned of Mixtral-8x22B-v0.1",
295+
)
296+
132297
register_model_info(
133298
["starling-lm-7b-beta", "starling-lm-7b-alpha"],
134299
"Starling-LM-7B",
@@ -152,8 +317,6 @@ def get_model_info(name: str) -> ModelInfo:
152317

153318
register_model_info(
154319
[
155-
"gemini-pro",
156-
"gemini-pro-dev-api",
157320
"gemini-1.0-pro-vision",
158321
"gemini-1.5-pro-preview-0409",
159322
],
@@ -176,38 +339,13 @@ def get_model_info(name: str) -> ModelInfo:
176339
"A model trained using depth up-scaling by Upstage AI",
177340
)
178341

179-
register_model_info(
180-
[
181-
"gpt-4-turbo",
182-
"gpt-4-turbo-2024-04-09",
183-
"gpt-4-1106-preview",
184-
"gpt-4-0125-preview",
185-
],
186-
"GPT-4-Turbo",
187-
"https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo",
188-
"GPT-4-Turbo by OpenAI",
189-
)
190-
191342
register_model_info(
192343
["gpt-4-turbo-browsing"],
193344
"GPT-4-Turbo with browsing",
194345
"https://platform.openai.com/docs/assistants/overview",
195346
"GPT-4-Turbo with browsing by OpenAI",
196347
)
197348

198-
register_model_info(
199-
[
200-
"gpt-3.5-turbo",
201-
"gpt-3.5-turbo-0125",
202-
"gpt-3.5-turbo-1106",
203-
"gpt-3.5-turbo-0314",
204-
"gpt-3.5-turbo-0613",
205-
],
206-
"GPT-3.5",
207-
"https://platform.openai.com/docs/models/gpt-3-5",
208-
"GPT-3.5-Turbo by OpenAI",
209-
)
210-
211349
register_model_info(
212350
["gpt-4", "gpt-4-0314", "gpt-4-0613"],
213351
"GPT-4",
@@ -250,13 +388,6 @@ def get_model_info(name: str) -> ModelInfo:
250388
"A chat assistant fine-tuned on user-shared conversations by LMSYS",
251389
)
252390

253-
register_model_info(
254-
["yi-34b-chat", "yi-6b-chat"],
255-
"Yi-Chat",
256-
"https://huggingface.co/01-ai/Yi-34B-Chat",
257-
"A large language model by 01 AI",
258-
)
259-
260391
register_model_info(
261392
[
262393
"codellama-70b-instruct",
@@ -755,10 +886,3 @@ def get_model_info(name: str) -> ModelInfo:
755886
"https://huggingface.co/cllm",
756887
"consistency-llm is a new generation of parallel decoder LLMs with fast generation speed.",
757888
)
758-
759-
register_model_info(
760-
["reka-flash", "reka-flash-20240226"],
761-
"Reka Flash",
762-
"https://reka.ai/reka-flash",
763-
"Multimodal model by Reka",
764-
)

0 commit comments

Comments
 (0)