import gradio as gr
import pandas as pd
import plotly.graph_objects as go
df = pd.read_csv("code_eval_board.csv")
df = df.sort_values(by=["Average score"], ascending=False)
headers = df.columns.to_list()
def plot_throughput(bs=1):
throughput_column = 'Throughput (tokens/s)' if bs==1 else 'Throughput (tokens/s) bs=50'
df['symbol'] = 2 # Triangle
df['color'] = ''
df.loc[df['Models'].str.contains('StarCoder|SantaCoder'), 'color'] = 'orange'
df.loc[df['Models'].str.contains('CodeGen'), 'color'] = 'pink'
df.loc[df['Models'].str.contains('Replit'), 'color'] = 'purple'
df.loc[df['Models'].str.contains('Wizard'), 'color'] = '#00b3b3'
df.loc[df['Models'].str.contains('CodeGeeX'), 'color'] = '#00cc00'
fig = go.Figure()
for i in df.index:
fig.add_trace(go.Scatter(
x=[df.loc[i, throughput_column]],
y=[df.loc[i, 'Average score']],
mode='markers',
marker=dict(
size=[df.loc[i, 'Size (B)'] + 10],
color=df.loc[i, 'color'],
symbol=df.loc[i, 'symbol']
),
name=df.loc[i, 'Models'],
hovertemplate =
'%{text}
' +
f'{throughput_column}: %{{x}}
'+
'Average Score: %{y}
' +
'Peak Memory (MB): ' + str(df.loc[i, 'Peak Memory (MB)']) + '
' +
'Human Eval (Python): ' + str(df.loc[i, 'humaneval-python']),
text=[df.loc[i, 'Models']],
showlegend=True
))
fig.update_layout(
autosize=False,
width=700,
height=600,
title=f'Average Score Vs Throughput (A100-80GB, Float16, Batch Size {bs})',
xaxis_title=f'{throughput_column}',
yaxis_title='Average Code Score',
)
return fig
demo = gr.Blocks()
with demo:
with gr.Row():
gr.Markdown(
"""
We compare performance of base multilingual code generation models on HumanEval benchmark and MultiPL-E. Following the 🤗 Open LLM-Perf Leaderboard 🏋️, we also measure throughput and provide\ information about the models. We only compare pre-trained multilingual code models, that people can start from as base models for their trainings.
""" ) with gr.Column(): with gr.Tabs(elem_classes="A100-tabs") as A100_tabs: with gr.TabItem("🔍 Evaluation table", id=0): leaderboard_df = gr.components.Dataframe( value=df, headers=headers, datatype=["str" for _ in range(len(headers))] ) """ with gr.TabItem("📊 Performance Plot", id=1): with gr.Row(): bs_1_plot = gr.components.Plot( value=plot_throughput(bs=1), elem_id="bs1-plot", show_label=False, ) bs_50_plt = gr.components.Plot( value=plot_throughput(bs=50), elem_id="bs50-plot", show_label=False, )""" with gr.Row(): gr.Markdown( """Notes:num_models - (rank -1)
and average their rankings.