Update app.py
Browse files
app.py
CHANGED
@@ -15,20 +15,17 @@ archlinks = {
|
|
15 |
"StripedHyena": "https://www.together.ai/blog/stripedhyena-7b", # no paper?
|
16 |
}
|
17 |
|
18 |
-
#def filter_table(cols, name, type, arch, license):
|
19 |
def filter_table(cols, name, type, arch):
|
20 |
tmp = data
|
21 |
# filter
|
22 |
tmp = tmp[tmp["Name"].str.contains(name)]
|
23 |
tmp = tmp[tmp["Type"].isin(type)]
|
24 |
tmp = tmp[tmp["Architecture"].isin(arch)]
|
25 |
-
#tmp = tmp[tmp["License"].isin(license)]
|
26 |
# prettify
|
27 |
tmp["Type"] = tmp["Type"].apply(lambda x: x[0])
|
28 |
tmp = tmp.rename({"Type": "T"}, axis=1)
|
29 |
tmp["Name"] = tmp["Name"].apply(lambda x: f'<a target="_blank" href="https://huggingface.co/{x}" style="color:var(--link-text-color);text-decoration:underline;text-decoration-style:dotted">{x}</a>')
|
30 |
tmp["Architecture"] = tmp["Architecture"].apply(lambda x: f'<a target="_blank" href="{archlinks[x]}" style="color:var(--link-text-color);text-decoration:underline;text-decoration-style:dotted">{x}</a>')
|
31 |
-
#tmp["License"] = tmp["License"].apply(lambda x: f'<a target="_blank" href="https://choosealicense.com/licenses/{x}" style="color:var(--link-text-color);text-decoration:underline;text-decoration-style:dotted">{x}</a>')
|
32 |
tmp["Base Model"] = tmp["Base Model"].apply(lambda x: f'<a target="_blank" href="https://huggingface.co/{x}" style="color:var(--link-text-color);text-decoration:underline;text-decoration-style:dotted">{x}</a>' if x != "base" else "")
|
33 |
# show/hide
|
34 |
tmp = tmp.drop(cols, axis=1)
|
@@ -71,22 +68,17 @@ with gr.Blocks(css=".tab-buttons button{font-size:1.3em}") as demo:
|
|
71 |
|
72 |
with gr.Column():
|
73 |
archfilter = gr.CheckboxGroup(label="Filter by model architecture", choices=list(data["Architecture"].unique()), value=list(data["Architecture"].unique()))
|
74 |
-
#lcnsfilter = gr.CheckboxGroup(label="Filter by model license", choices=list(data["License"].unique()), value=list(data["License"].unique()))
|
75 |
|
76 |
with gr.Column():
|
77 |
colfilter = gr.CheckboxGroup(label="Hide columns", choices=list(data.columns)[2:], value=["MT-Bench (coming soon!)","Architecture","Base Model"])
|
78 |
|
79 |
-
|
80 |
-
table = gr.Dataframe(filter_table(value=["MT-Bench (coming soon!)","Architecture","Base Model"],"",[n for n in data["Type"].unique() if n not in ["β Pending"]],list(data["Architecture"].unique())), datatype="markdown")
|
81 |
|
82 |
# actions
|
83 |
|
84 |
-
#namefilter.submit(filter_table, [colfilter,namefilter,typefilter,archfilter,lcnsfilter], table)
|
85 |
namefilter.submit(filter_table, [colfilter,namefilter,typefilter,archfilter], table)
|
86 |
|
87 |
-
#for filter in [colfilter,typefilter,archfilter,lcnsfilter]:
|
88 |
for filter in [colfilter,typefilter,archfilter]:
|
89 |
-
#filter.input(filter_table, [colfilter,namefilter,typefilter,archfilter,lcnsfilter], table)
|
90 |
filter.input(filter_table, [colfilter,namefilter,typefilter,archfilter], table)
|
91 |
|
92 |
with gr.Tab("π About"):
|
|
|
15 |
"StripedHyena": "https://www.together.ai/blog/stripedhyena-7b", # no paper?
|
16 |
}
|
17 |
|
|
|
18 |
def filter_table(cols, name, type, arch):
|
19 |
tmp = data
|
20 |
# filter
|
21 |
tmp = tmp[tmp["Name"].str.contains(name)]
|
22 |
tmp = tmp[tmp["Type"].isin(type)]
|
23 |
tmp = tmp[tmp["Architecture"].isin(arch)]
|
|
|
24 |
# prettify
|
25 |
tmp["Type"] = tmp["Type"].apply(lambda x: x[0])
|
26 |
tmp = tmp.rename({"Type": "T"}, axis=1)
|
27 |
tmp["Name"] = tmp["Name"].apply(lambda x: f'<a target="_blank" href="https://huggingface.co/{x}" style="color:var(--link-text-color);text-decoration:underline;text-decoration-style:dotted">{x}</a>')
|
28 |
tmp["Architecture"] = tmp["Architecture"].apply(lambda x: f'<a target="_blank" href="{archlinks[x]}" style="color:var(--link-text-color);text-decoration:underline;text-decoration-style:dotted">{x}</a>')
|
|
|
29 |
tmp["Base Model"] = tmp["Base Model"].apply(lambda x: f'<a target="_blank" href="https://huggingface.co/{x}" style="color:var(--link-text-color);text-decoration:underline;text-decoration-style:dotted">{x}</a>' if x != "base" else "")
|
30 |
# show/hide
|
31 |
tmp = tmp.drop(cols, axis=1)
|
|
|
68 |
|
69 |
with gr.Column():
|
70 |
archfilter = gr.CheckboxGroup(label="Filter by model architecture", choices=list(data["Architecture"].unique()), value=list(data["Architecture"].unique()))
|
|
|
71 |
|
72 |
with gr.Column():
|
73 |
colfilter = gr.CheckboxGroup(label="Hide columns", choices=list(data.columns)[2:], value=["MT-Bench (coming soon!)","Architecture","Base Model"])
|
74 |
|
75 |
+
table = gr.Dataframe(filter_table(["MT-Bench (coming soon!)","Architecture","Base Model"],"",[n for n in data["Type"].unique() if n not in ["β Pending"]],list(data["Architecture"].unique())), datatype="markdown")
|
|
|
76 |
|
77 |
# actions
|
78 |
|
|
|
79 |
namefilter.submit(filter_table, [colfilter,namefilter,typefilter,archfilter], table)
|
80 |
|
|
|
81 |
for filter in [colfilter,typefilter,archfilter]:
|
|
|
82 |
filter.input(filter_table, [colfilter,namefilter,typefilter,archfilter], table)
|
83 |
|
84 |
with gr.Tab("π About"):
|