davanstrien HF staff commited on
Commit
842e3d0
1 Parent(s): 4a21863

chore: Update Hugging Face dataset dashboard with new framework choices

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -4,6 +4,20 @@ from toolz import groupby
4
  import plotly.express as px
5
  import pandas as pd
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  def fetch_data(framework):
9
  r = httpx.get(f"https://huggingface.co/api/datasets?filter={framework}")
@@ -16,7 +30,7 @@ def fetch_data(framework):
16
  def generate_dashboard(data, grouped, framework):
17
  total_datasets = sum(len(v) for v in grouped.values())
18
 
19
- dashboard = f"## Hugging Face Datasets for {framework} \n\n"
20
  dashboard += f"**Total number of datasets: {total_datasets}**\n\n"
21
  dashboard += f"**Total number of authors: {len(grouped)}**\n\n"
22
  dashboard += "### Datasets per Author\n\n"
@@ -89,8 +103,9 @@ def update_dashboard(framework):
89
 
90
 
91
  with gr.Blocks() as demo:
 
92
  framework = gr.Dropdown(
93
- choices=["distilabel", "sentence-transformers", "synthetic", "fiftyone"],
94
  allow_custom_value=True,
95
  )
96
  plot = gr.Plot()
 
4
  import plotly.express as px
5
  import pandas as pd
6
 
7
+ choices = sorted(
8
+ [
9
+ "art",
10
+ "biology",
11
+ "code",
12
+ "distilabel",
13
+ "fiftyone",
14
+ "legal",
15
+ "medical",
16
+ "sentence-transformers",
17
+ "synthetic",
18
+ ]
19
+ )
20
+
21
 
22
  def fetch_data(framework):
23
  r = httpx.get(f"https://huggingface.co/api/datasets?filter={framework}")
 
30
  def generate_dashboard(data, grouped, framework):
31
  total_datasets = sum(len(v) for v in grouped.values())
32
 
33
+ dashboard = f"## Hugging Face datasets for {framework} \n\n"
34
  dashboard += f"**Total number of datasets: {total_datasets}**\n\n"
35
  dashboard += f"**Total number of authors: {len(grouped)}**\n\n"
36
  dashboard += "### Datasets per Author\n\n"
 
103
 
104
 
105
  with gr.Blocks() as demo:
106
+ gr.Markdown("# View the growth of dataset frameworks/tags on the Hub")
107
  framework = gr.Dropdown(
108
+ choices=choices,
109
  allow_custom_value=True,
110
  )
111
  plot = gr.Plot()