CoolFace
Apppublic

HuggingFaceH4/Elo

sourceHugging Faceapache-2.0updated 4y agoView on Hugging Face
5likes
app.py43 linesDownload Raw Back to root
1import os2from pathlib import Path3 4import pandas as pd5import streamlit as st6import utils as ut7 8st.set_page_config(layout="wide")9 10 11st.markdown("# Elo Rating of Models")12st.markdown(13    """This app shows the Elo rating of models on the H4 Hub based on their performance on the H4 eval dataset. """)14st.markdown(15    """**Notes**16* This is currently using synthetic data17* You can tweak the number of tasks, models, and human rating per task to generate different datasets18"""19)20# user input21 22num_tasks = st.number_input("Number of tasks", min_value=1, max_value=5000, value=100)23num_models = st.number_input("Number of models", min_value=1, max_value=100, value=4)24num_human_ratings = st.number_input(25    "Number of human ratings per task", min_value=1, max_value=10, value=326)27 28button = st.button("Show me the leaderboard!")29 30if button is True:31    # generate synthetic data32    df = ut.create_synthetic_data( n_tasks=num_tasks, n_models=num_models, n_ratings=num_human_ratings)33    # calculate elo rating34    elo_df = ut.calculate_elo_rating(df)35    # show leaderboard36    ut.display_leaderboard(elo_df)37 38 39 40 41 42 43