Skip to content

Commit 273c685

Browse files
committed
updated data visualizer UI
1 parent 49cdc8a commit 273c685

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

fastchat/serve/gradio_web_server.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,48 @@ def get_model_description_md(models):
791791
ct += 1
792792
return model_description_md
793793

794-
794+
def build_visualizer():
795+
visualizer_markdown = """
796+
# 🧭 Arena Visualizer
797+
Data explorer provides interactive tools to explore and draw insights from our leaderboard data.
798+
"""
799+
800+
gr.Markdown(visualizer_markdown, elem_id="visualizer_markdown")
801+
802+
with gr.Tabs() as tabs:
803+
with gr.Tab("Topic Explorer", id=0):
804+
topic_markdown = """
805+
## *Welcome to the Topic Explorer*
806+
This tool lets you dive into user-submitted prompts, organized into general categories and detailed subcategories. Using the sunburst chart, you can easily explore the data and understand how different topics are distributed.
807+
808+
### How to Use:
809+
- Hover Over Segments: View the category name, the number of prompts, and their percentage.
810+
- Click to Explore:
811+
- Click on a main category to see its subcategories.
812+
- Click on subcategories to see example prompts in the sidebar.
813+
- Undo and Reset: Click the center of the chart to return to the top level.
814+
815+
Start exploring and discover interesting trends in the data!
816+
817+
"""
818+
gr.Markdown(topic_markdown)
819+
820+
frame = """
821+
<iframe width="100%" scrolling="no" style="height: 800px; border: 1px solid lightgrey; border-radius: 10px;"
822+
src="https://storage.googleapis.com/public-arena-no-cors/index.html">
823+
</iframe>
824+
"""
825+
gr.HTML(frame)
826+
827+
828+
with gr.Tab("Price Analysis", id=1):
829+
price_markdown = """
830+
## *Price Control Data Visualizations*
831+
Below are scatter-plots depicting a model's arena score against its cost effectiveness
832+
and output token price.
833+
"""
834+
gr.Markdown(price_markdown)
835+
795836
def build_about():
796837
about_markdown = """
797838
# About Us

fastchat/serve/gradio_web_server_multi.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
set_global_vars,
3838
block_css,
3939
build_single_model_ui,
40+
build_visualizer,
4041
build_about,
4142
get_model_list,
4243
load_demo_single,
@@ -200,13 +201,8 @@ def build_demo(
200201
show_plot=True,
201202
)
202203

203-
with gr.Tab("🔍 Data Explorer", id=5):
204-
frame = """
205-
<iframe width="100%" style="height: 1000px;"
206-
src="https://storage.googleapis.com/public-arena-no-cors/index.html">
207-
</iframe>
208-
"""
209-
gr.HTML(frame)
204+
with gr.Tab("🔍 Data Visualizer", id=5):
205+
build_visualizer()
210206

211207
with gr.Tab("ℹ️ About Us", id=4):
212208
about = build_about()

0 commit comments

Comments
 (0)