From 8f4b5b9c7157031afb3cb12ea3c6e29c0f11c7b4 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Fri, 6 Oct 2023 19:01:17 +0000 Subject: [PATCH] register custom model --- fastchat/serve/gradio_block_arena_anony.py | 3 +++ fastchat/serve/gradio_web_server.py | 3 +++ fastchat/serve/gradio_web_server_multi.py | 1 + 3 files changed, 7 insertions(+) diff --git a/fastchat/serve/gradio_block_arena_anony.py b/fastchat/serve/gradio_block_arena_anony.py index 2b5bd7429..90e195096 100644 --- a/fastchat/serve/gradio_block_arena_anony.py +++ b/fastchat/serve/gradio_block_arena_anony.py @@ -221,6 +221,9 @@ def add_text( w = SAMPLING_WEIGHTS.get(a, 1.0) * SAMPLING_WEIGHTS.get(b, 1.0) if a in SAMPLING_BOOST_MODELS or b in SAMPLING_BOOST_MODELS: w *= 10 + if (a in {"gpt-4", "deluxe-chat-v1"} and + b in {"gpt-4", "deluxe-chat-v1"}): + w *= 8 model_pairs.append((a, b)) model_pairs_weights.append(w) diff --git a/fastchat/serve/gradio_web_server.py b/fastchat/serve/gradio_web_server.py index 532603b18..64d953359 100644 --- a/fastchat/serve/gradio_web_server.py +++ b/fastchat/serve/gradio_web_server.py @@ -146,6 +146,9 @@ def get_model_list( models += ["palm-2"] models = list(set(models)) + if "deluxe-chat-v1" in models: + del models[models.index("deluxe-chat-v1")] + priority = {k: f"___{i:02d}" for i, k in enumerate(model_info)} models.sort(key=lambda x: priority.get(x, x)) logger.info(f"Models: {models}") diff --git a/fastchat/serve/gradio_web_server_multi.py b/fastchat/serve/gradio_web_server_multi.py index 92618d911..f1dbca963 100644 --- a/fastchat/serve/gradio_web_server_multi.py +++ b/fastchat/serve/gradio_web_server_multi.py @@ -87,6 +87,7 @@ def load_demo(url_params, request: gr.Request): models_anony += ["claude-2", "claude-instant-1"] if args.add_palm: models_anony += ["palm-2"] + models_anony.append("deluxe-chat-v1") side_by_side_anony_updates = load_demo_side_by_side_anony(models_anony, url_params) side_by_side_named_updates = load_demo_side_by_side_named(models, url_params)