Skip to content

Commit 3b0c906

Browse files
committed
add prompt-to-leaderboard tab
1 parent 03d376c commit 3b0c906

File tree

3 files changed

+334
-52
lines changed

3 files changed

+334
-52
lines changed

fastchat/serve/gradio_web_server_multi.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
load_demo_single,
3939
get_ip,
4040
)
41-
from fastchat.serve.monitor.monitor import build_leaderboard_tab
41+
from fastchat.serve.monitor.monitor import (
42+
build_leaderboard_tab,
43+
build_prompt_to_leaderboard_tab,
44+
)
4245
from fastchat.utils import (
4346
build_logger,
4447
get_window_url_params_js,
@@ -252,11 +255,17 @@ def build_demo(
252255
arena_hard_table,
253256
show_plot=True,
254257
)
258+
if args.prompt_to_leaderboard_examples:
259+
with gr.Tab("🏆 Prompt-to-Leaderboard", id=4):
260+
build_prompt_to_leaderboard_tab(
261+
leaderboard_table_file,
262+
args.prompt_to_leaderboard_examples,
263+
)
255264
if args.show_visualizer:
256-
with gr.Tab("🔍 Arena Visualizer", id=5):
265+
with gr.Tab("🔍 Arena Visualizer", id=6):
257266
build_visualizer()
258267

259-
with gr.Tab("ℹ️ About Us", id=4):
268+
with gr.Tab("ℹ️ About Us", id=5):
260269
build_about()
261270

262271
context_state = gr.State(context)
@@ -368,6 +377,12 @@ def build_demo(
368377
default=False,
369378
help="Show the Data Visualizer tab",
370379
)
380+
parser.add_argument(
381+
"--prompt-to-leaderboard-examples",
382+
type=str,
383+
default=None,
384+
help="Point to the file where Prompt-to-Leaderboard examples are stored, also enable its tab",
385+
)
371386
args = parser.parse_args()
372387
logger.info(f"args: {args}")
373388

0 commit comments

Comments
 (0)