Spaces:
Running
Running
website
Browse files- spit-fight-website/.DS_Store +0 -0
- spit-fight-website/.idea/.gitignore +3 -0
- spit-fight-website/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- spit-fight-website/.idea/misc.xml +4 -0
- spit-fight-website/.idea/modules.xml +8 -0
- spit-fight-website/.idea/spit-fight-website.iml +8 -0
- spit-fight-website/img/.DS_Store +0 -0
- spit-fight-website/img/image.png +0 -0
- spit-fight-website/leaderboard.py +94 -0
- spit-fight-website/requirements.txt +2 -0
- spit-fight-website/tables/test.csv +6 -0
spit-fight-website/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
spit-fight-website/.idea/.gitignore
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Default ignored files
|
| 2 |
+
/shelf/
|
| 3 |
+
/workspace.xml
|
spit-fight-website/.idea/inspectionProfiles/profiles_settings.xml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<component name="InspectionProjectProfileManager">
|
| 2 |
+
<settings>
|
| 3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
| 4 |
+
<version value="1.0" />
|
| 5 |
+
</settings>
|
| 6 |
+
</component>
|
spit-fight-website/.idea/misc.xml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7" project-jdk-type="Python SDK" />
|
| 4 |
+
</project>
|
spit-fight-website/.idea/modules.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ProjectModuleManager">
|
| 4 |
+
<modules>
|
| 5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/spit-fight-website.iml" filepath="$PROJECT_DIR$/.idea/spit-fight-website.iml" />
|
| 6 |
+
</modules>
|
| 7 |
+
</component>
|
| 8 |
+
</project>
|
spit-fight-website/.idea/spit-fight-website.iml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<module type="PYTHON_MODULE" version="4">
|
| 3 |
+
<component name="NewModuleRootManager">
|
| 4 |
+
<content url="file://$MODULE_DIR$" />
|
| 5 |
+
<orderEntry type="inheritedJdk" />
|
| 6 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
| 7 |
+
</component>
|
| 8 |
+
</module>
|
spit-fight-website/img/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
spit-fight-website/img/image.png
ADDED
|
spit-fight-website/leaderboard.py
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import requests
|
| 3 |
+
import pandas as pd
|
| 4 |
+
from huggingface_hub.hf_api import SpaceInfo
|
| 5 |
+
import matplotlib.pyplot as plt
|
| 6 |
+
import plotly.express as px
|
| 7 |
+
|
| 8 |
+
model_perf_table = 'tables/test.csv'
|
| 9 |
+
logo_path = 'img/image.png'
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def get_blocks_party_spaces():
|
| 13 |
+
df = pd.read_csv(model_perf_table)
|
| 14 |
+
df = df.sort_values(by=['score'],ascending=False)
|
| 15 |
+
return df
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def get_blocks_party_spaces_with_formula(formula=None):
|
| 19 |
+
# get the dataframe
|
| 20 |
+
df = get_blocks_party_spaces()
|
| 21 |
+
if formula:
|
| 22 |
+
try:
|
| 23 |
+
df[str(formula)] = df.eval(formula)
|
| 24 |
+
except:
|
| 25 |
+
pass # Handle this error properly in your code
|
| 26 |
+
return df
|
| 27 |
+
|
| 28 |
+
def create_scatter(x, y, z):
|
| 29 |
+
df = get_blocks_party_spaces()
|
| 30 |
+
|
| 31 |
+
if z is None or z == 'None':
|
| 32 |
+
fig = plt.figure()
|
| 33 |
+
ax = fig.add_subplot()
|
| 34 |
+
scatter = ax.scatter(list(df[x]),list(df[y]))
|
| 35 |
+
for i, label in enumerate(list(df['model'])):
|
| 36 |
+
ax.text(list(df[x])[i],list(df[y])[i],str(label))
|
| 37 |
+
ax.set_xlabel(x)
|
| 38 |
+
ax.set_ylabel(y)
|
| 39 |
+
else:
|
| 40 |
+
fig = px.scatter_3d(df, x=x, y=y, z=z, text=df['model'])
|
| 41 |
+
|
| 42 |
+
# Set axis labels and title
|
| 43 |
+
fig.update_layout(scene=dict(
|
| 44 |
+
xaxis_title=x,
|
| 45 |
+
yaxis_title=y,
|
| 46 |
+
zaxis_title=z,
|
| 47 |
+
),
|
| 48 |
+
title='3D Scatter Plot'
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
return fig
|
| 52 |
+
|
| 53 |
+
block = gr.Blocks()
|
| 54 |
+
with block:
|
| 55 |
+
# gr.outputs.HTML(f'<img src="{logo_path}" alt="logo" height="1000px">')
|
| 56 |
+
# img = gr.Image(logo_path,shape=[1,2]).style( rounded=False)
|
| 57 |
+
|
| 58 |
+
gr.Markdown(f"""
|
| 59 |
+
# 🦙💦SpitFight - Leaderboard for LLM
|
| 60 |
+
""")
|
| 61 |
+
with gr.Tabs():
|
| 62 |
+
with gr.TabItem("Leaderboard"):
|
| 63 |
+
with gr.Row():
|
| 64 |
+
data = gr.outputs.Dataframe(type="pandas")
|
| 65 |
+
with gr.Row():
|
| 66 |
+
formula_input = gr.inputs.Textbox(lines=1, label="User Designed Column", placeholder = 'e.g. verbosity/latency')
|
| 67 |
+
data_run = gr.Button("Add To Table")
|
| 68 |
+
data_run.click(get_blocks_party_spaces_with_formula, inputs=formula_input, outputs=data)
|
| 69 |
+
# running the function on page load in addition to when the button is clicked
|
| 70 |
+
with gr.Row():
|
| 71 |
+
with gr.Column():
|
| 72 |
+
scatter_input = [gr.inputs.Dropdown(choices=get_blocks_party_spaces().columns.tolist()[1:], label="X-axis"),
|
| 73 |
+
gr.inputs.Dropdown(choices=get_blocks_party_spaces().columns.tolist()[1:], label="Y-axis"),
|
| 74 |
+
gr.inputs.Dropdown(choices=[None]+get_blocks_party_spaces().columns.tolist()[1:], label="Z-axis (Optional)")]
|
| 75 |
+
fig_run = gr.Button("Generate Figure")
|
| 76 |
+
|
| 77 |
+
with gr.Column():
|
| 78 |
+
gen_figure = gr.Plot()# gr.outputs.Image(type="pil")
|
| 79 |
+
fig_run.click(create_scatter, inputs=scatter_input, outputs=gen_figure)
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
with gr.TabItem("About"):
|
| 83 |
+
gr.Markdown(f"""
|
| 84 |
+
## Metrics:
|
| 85 |
+
- **Human Score**: The average score given by human evaluators.
|
| 86 |
+
- **Throughput**: The number of tokens generated per second.
|
| 87 |
+
- **Verbosity**: The average number of generated tokens in the model's response.
|
| 88 |
+
- **Latency**: The average time it takes for the model to generate a response.
|
| 89 |
+
- **Memory**: The base memory usage of the model.
|
| 90 |
+
""")
|
| 91 |
+
|
| 92 |
+
block.load(get_blocks_party_spaces_with_formula, inputs=None, outputs=data)
|
| 93 |
+
|
| 94 |
+
block.launch()
|
spit-fight-website/requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
plotly
|
spit-fight-website/tables/test.csv
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model,score,throughput,verbosity,latency,energy,memory
|
| 2 |
+
vicuna-13B,1054,19.47,178.71,10.37,12,26232
|
| 3 |
+
vicuna-7B,1007,31.26,217.33,7.71,32,14087
|
| 4 |
+
llama-13B,854,18.49,390.9,22.74,24,26233
|
| 5 |
+
t5-3B,941,31.98,131.12,6.09,4,8031
|
| 6 |
+
rwkv-7B,928,23.09,239.98,9.62,12,15790
|