Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import pandas as pd | |
| import numpy as np | |
| # Sample data for the first 5 languages and all models (replace this with your actual data) | |
| data = { | |
| "Models": [ | |
| "CodeGen-16B-Multi", | |
| "StarCoder-15B", | |
| "StarCoderBase-15B", | |
| "StarCoderBase-7B", | |
| "StarCoderBase-3B", | |
| "Replit-2.7B", | |
| "SantaCoder-1.1B", | |
| "StarCoderBase-1.1B", | |
| ], | |
| "humaneval-python": [19.26, 33.57, 30.35, 28.37, 21.50, 20.00, 18.12, 15.17], | |
| "java": [22.20, 30.22, 28.53, 24.44, 19.25, 18.10, 15.00, 14.20], | |
| "javascript": [19.15, 30.79, 31.70, 27.35, 21.32, 15.68, 15.47, 13.38], | |
| "cpp": [21.00, 31.55, 30.56, 23.30, 19.43, 16.86, 6.20, 11.68], | |
| "php": [8.37, 26.08, 26.75, 22.12, 18.55, 13.25, 1.50, 9.94], | |
| "julia": [0.00, 23.02, 21.09, 21.77, 16.10, 10.06, 0.00, 11.31], | |
| "d": [7.68, 13.57, 10.01, 8.10, 4.97, 2.78, 0.00, 4.65], | |
| "lua": [8.50, 23.89, 26.61, 23.35, 18.04, 2.83, 0.10, 12.52], | |
| "r": [6.45, 15.50, 10.18, 14.51, 10.10, 6.29, 0.00, 5.73], | |
| "ruby": [0.00, 1.24, 17.25, 18.39, 3.93, 10.75, 0.00, 0.31], | |
| "racket": [0.66, 0.07, 11.77, 11.08, 7.87, 2.10, 0.00, 5.03], | |
| "rust": [4.21, 21.84, 24.46, 22.60, 16.32, 13.63, 2.00, 10.24], | |
| "swift": [1.25, 22.74, 16.74, 15.10, 9.98, 5.44, 0.70, 3.92], | |
| } | |
| df = pd.DataFrame(data).set_index("Models") | |
| df = df.reset_index().rename(columns={"index": "Language"}) | |
| temp_df = df.copy() | |
| temp_df = temp_df.apply(pd.to_numeric, errors="coerce") | |
| temp_df[temp_df <= 2] = np.nan | |
| # Calculate the average and round to two decimal places, then insert at the beginning | |
| df.insert(1, "Average", temp_df.mean(axis=1).round(2)) | |
| df.insert(2, "Throughput", [0 for i in range(len(df))]) | |
| headers = ["Language", "Average", "Throughput"] + df.columns.to_list() | |
| demo = gr.Blocks() | |
| with demo: | |
| with gr.Row(): | |
| gr.Markdown( | |
| """<div style="text-align: center;"><h1> ⭐ StarCoder Models <span style='color: #e6b800;'>Evaluation</span></h1></div>""" | |
| ) | |
| with gr.Column(): | |
| leaderboard_df = gr.components.Dataframe( | |
| value=df, headers=headers, datatype=["str" for _ in range(len(headers))] | |
| ) | |
| demo.launch() | |