File size: 1,351 Bytes
697be1a
24a15c0
 
697be1a
24a15c0
697be1a
 
 
 
24a15c0
 
697be1a
 
 
24a15c0
697be1a
 
24a15c0
f008087
24a15c0
 
697be1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24a15c0
 
697be1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import io

import pandas as pd
import requests
import streamlit as st

REPO_URL = "https://github.com/LudwigStumpp/llm-leaderboard"


def grab_file_from_repo(repo_url: str, filename: str) -> str:
    """Grabs a file from a GitHub repository.

    Args:
        repo_url (str): URL of the GitHub repository.
        filename (str): Name of the file to grab.

    Returns:
        str: Content of the file.
    """
    url = repo_url.replace("github.com", "raw.githubusercontent.com") + f"/main/{filename}"
    return requests.get(url).text


def setup_basic():
    title = "LLM-Leaderboard"

    st.set_page_config(
        page_title=title,
        page_icon="πŸ†",
    )
    st.title(title)

    st.markdown(
        """
        A joint community effort to create one central leaderboard for LLMs.
        Visit [llm-leaderboard](https://github.com/LudwigStumpp/llm-leaderboard) to contribute.
        """
    )


def setup_table():
    csv_table = grab_file_from_repo(REPO_URL, "leaderboard.csv")
    df = pd.read_csv(io.StringIO(csv_table), index_col=0)
    st.dataframe(df)


def setup_footer():
    st.markdown(
        """
        ---
        Made with ❀️ by the awesome open-source community from all over 🌍.
        """
    )


def main():
    setup_basic()
    setup_table()
    setup_footer()


if __name__ == "__main__":
    main()