File size: 1,824 Bytes
f623499
d868240
f623499
5f54938
 
d868240
 
f623499
5f54938
 
 
 
 
 
 
f623499
5f54938
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
01383fd
 
5f54938
01383fd
5f54938
01383fd
5f54938
 
 
 
 
7044139
 
 
5f54938
 
 
 
02aca53
5f54938
 
 
 
 
7044139
5f54938
 
 
687e594
 
 
 
f623499
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import gradio as gr
import json
import pandas as pd
from urllib.request import urlopen
from urllib.error import URLError
import re
from datetime import datetime

CITATION_BUTTON_TEXT = r"""@misc{2023opencompass,
    title={OpenCompass: A Universal Evaluation Platform for Foundation Models},
    author={OpenCompass Contributors},
    howpublished = {\url{https://github.com/open-compass/opencompass}},
    year={2023}
}"""
CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"

DATA_URL_BASE = "http://opencompass.oss-cn-shanghai.aliyuncs.com/dev-assets/hf-research/"

def findfile():
    model_meta_info = 'model-meta-info'
    results_sum = 'hf-academic'

    url = f"{DATA_URL_BASE}{model_meta_info}.json"
    response = urlopen(url)
    model_info = json.loads(response.read().decode('utf-8'))

    url = f"{DATA_URL_BASE}{results_sum}.json"
    response = urlopen(url)
    results = json.loads(response.read().decode('utf-8'))

    return model_info, results


MAIN_LEADERBOARD_DESCRIPTION = """## Compass Academic Leaderboard
--WIP--

"""

Initial_title = 'Compass Academic Leaderboard'


def create_interface():
    model_info, results = findfile()

    with gr.Blocks() as demo:
        title_comp = gr.Markdown(Initial_title)
        gr.Markdown(MAIN_LEADERBOARD_DESCRIPTION)
        with gr.Tabs(elem_classes='tab-buttons') as tabs:
            with gr.TabItem('Results', elem_id='main', id=0):
                # math_main_tab(results)
                pass
            with gr.TabItem('Predictions', elem_id='notmain', id=1):
                # dataset_tab(results, structs[i], dataset)
                pass

    return demo


# model_info, results = findfile()
# breakpoint()

if __name__ == '__main__':
    demo = create_interface()
    demo.queue()
    demo.launch(server_name='0.0.0.0')