File size: 692 Bytes
6b85865
22725f7
 
ffdb8d3
6b85865
ffdb8d3
 
 
6b85865
ffdb8d3
 
 
 
 
22725f7
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr
import pandas as pd
import numpy as np
import json

# Load the data from the JSON file
with open('llama-30B_mmlu_5-shot.json', 'r') as f:
    results = json.load(f)

# Create a DataFrame from the results dictionary
data = pd.DataFrame(results['results']).T

# Sort the DataFrame by 'acc' column
data = data.sort_values('acc', ascending=False)

def show_leaderboard():
    # Convert dataframe to html so that it can be displayed properly in Gradio
    return data.to_html()

iface = gr.Interface(fn=show_leaderboard, inputs=[], outputs="html")

# Run the interface. 
# Note: you don't need to use .launch() in Hugging Face Spaces, this is for local testing.
iface.launch()