File size: 2,509 Bytes
7ce559e
 
 
 
 
 
424c611
 
 
7ce559e
 
3ed9628
4ed7662
f33d759
70e89d0
f33d759
5be9e6f
 
f33d759
 
424c611
f0e533a
99df430
70e89d0
 
 
 
7535cc2
70e89d0
 
 
 
 
 
 
424c611
7ce559e
 
 
 
 
 
 
7535cc2
7ce559e
4ed7662
7ce559e
1ad3233
 
 
 
 
7ce559e
 
1ad3233
 
 
 
4ed7662
7ce559e
 
99023fa
7ce559e
 
 
 
 
1e46b8c
7ce559e
4ed7662
7ce559e
424c611
39c67b8
 
eb1c279
4ed7662
7ce559e
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
69
70
71
72
73
74
75
76
77
# AUTOGENERATED! DO NOT EDIT! File to edit: app.ipynb.

# %% auto 0
__all__ = ['columns_to_click', 'title', 'description', 'dtypes', 'get_data']

# %% app.ipynb 0
import gradio as gr
import pandas as pd


# %% app.ipynb 1
columns_to_click = ["Paper / Repo", "Playground"]

def get_data():
    # Load the CSV file into a DataFrame
    df = pd.read_csv(
        #test      "https://docs.google.com/spreadsheets/d/e/2PACX-1vTmhqd7F40mODp2OeQLAn0t_IUd2tjGx0XIWt98HsKORKlejOGsrk6RP9rjjLF7k4krAkrce1FzlluT/pub?output=csv",
       "https://docs.google.com/spreadsheets/d/e/2PACX-1vSC40sszorOjHfozmNqJT9lFiJhG94u3fbr3Ss_7fzcU3xqqJQuW1Ie_SNcWEB-uIsBi9NBUK7-ddet/pub?output=csv",
        skiprows=1,
    )

    print("df.columns: ", df.columns)

    # Drop rows where the 'Model' column is NaN
    df.dropna(subset=['Model'], inplace=True)

    # Drop rows where the 'Parameters \n(B)' column is 'TBA'
    df = df[df["Announced\n▼"] != "TBA"]

    # Apply make_clickable_cell to the specified columns
    for col in columns_to_click:
        df[col] = df[col].apply(make_clickable_cell)

    return df


    # %% app.ipynb 2
    # Drop footers
    df = df.copy()[~df["Model"].isna()]


    # %% app.ipynb 3
    # Drop TBA models
    df = df.copy()[df["Announced\n▼"] != "TBA"]


    # %% app.ipynb 6
def make_clickable_cell(cell):
    if pd.isnull(cell):
        return ""
    else:
        return f'<a  target="_blank" href="{cell}">{cell}</a>'


# Load the data to get the columns for setting up datatype
dataframe = get_data()
dtypes = ["str" if c not in columns_to_click else "html" for c in dataframe.columns]


# %% app.ipynb 2
title = """<h1 align="center">The Large Language Models Landscape</h1>"""
description = """Large Language Models (LLMs) today come in a variety architectures and capabilities. This interactive landscape provides a visual overview of the most important LLMs, including their training data, size, release date, and whether they are openly accessible or not. It also includes notes on each model to provide additional context. This landscape is derived from data compiled by Dr. Alan D. Thompson at [LifeArchitect.ai/models-table](https://lifearchitect.ai/models-table/).
"""


# %% app.ipynb 3
dtypes = ["str" if c not in columns_to_click else "markdown" for c in get_data().columns]
print("dtypes: ", dtypes)


# %% app.ipynb 4
with gr.Blocks() as demo:
    gr.Markdown(title)
    gr.Markdown(description)
    gr.DataFrame(get_data, datatype=dtypes, every=60)

demo.queue().launch()