devingulliver commited on
Commit
ea82c60
β€’
1 Parent(s): 5768c49

Add Based info, delete License column part 1

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -10,23 +10,25 @@ webhook_url = os.environ.get("WEBHOOK_URL")
10
  archlinks = {
11
  "Mamba": "https://arxiv.org/abs/2312.00752",
12
  "RWKV-4": "https://arxiv.org/abs/2305.13048",
 
13
  "RWKV-5": "https://x.com/BlinkDL_AI/status/1685230712247795713", # paper soon:tm:
14
- "StripedHyena": "https://www.together.ai/blog/stripedhyena-7b" # this is very confusing
15
  }
16
 
17
- def filter_table(cols, name, type, arch, license):
 
18
  tmp = data
19
  # filter
20
  tmp = tmp[tmp["Name"].str.contains(name)]
21
  tmp = tmp[tmp["Type"].isin(type)]
22
  tmp = tmp[tmp["Architecture"].isin(arch)]
23
- tmp = tmp[tmp["License"].isin(license)]
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["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>')
30
  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 "")
31
  # show/hide
32
  tmp = tmp.drop(cols, axis=1)
@@ -69,19 +71,23 @@ with gr.Blocks(css=".tab-buttons button{font-size:1.3em}") as demo:
69
 
70
  with gr.Column():
71
  archfilter = gr.CheckboxGroup(label="Filter by model architecture", choices=list(data["Architecture"].unique()), value=list(data["Architecture"].unique()))
72
- lcnsfilter = gr.CheckboxGroup(label="Filter by model license", choices=list(data["License"].unique()), value=list(data["License"].unique()))
73
 
74
  with gr.Column():
75
  colfilter = gr.CheckboxGroup(label="Hide columns", choices=list(data.columns)[2:])
76
 
77
- table = gr.Dataframe(filter_table([],"",[n for n in data["Type"].unique() if n not in ["βŒ› Pending"]],list(data["Architecture"].unique()),list(data["License"].unique())), datatype="markdown")
 
78
 
79
  # actions
80
 
81
- namefilter.submit(filter_table, [colfilter,namefilter,typefilter,archfilter,lcnsfilter], table)
 
82
 
83
- for filter in [colfilter,typefilter,archfilter,lcnsfilter]:
84
- filter.input(filter_table, [colfilter,namefilter,typefilter,archfilter,lcnsfilter], table)
 
 
85
 
86
  with gr.Tab("πŸ“ About"):
87
  gr.Markdown("""
 
10
  archlinks = {
11
  "Mamba": "https://arxiv.org/abs/2312.00752",
12
  "RWKV-4": "https://arxiv.org/abs/2305.13048",
13
+ "Based": "https://arxiv.org/abs/2402.18668",
14
  "RWKV-5": "https://x.com/BlinkDL_AI/status/1685230712247795713", # paper soon:tm:
15
+ "StripedHyena": "https://www.together.ai/blog/stripedhyena-7b", # this is very confusing
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
 
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:])
78
 
79
+ #table = gr.Dataframe(filter_table([],"",[n for n in data["Type"].unique() if n not in ["βŒ› Pending"]],list(data["Architecture"].unique()),list(data["License"].unique())), datatype="markdown")
80
+ table = gr.Dataframe(filter_table([],"",[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"):
93
  gr.Markdown("""