File size: 6,450 Bytes
1189736
a4a6903
1189736
 
a425fdf
1d64f2a
84bdae6
1de78b4
84bdae6
 
1de78b4
 
 
 
 
84bdae6
1de78b4
84bdae6
1de78b4
84bdae6
1de78b4
 
 
84bdae6
1de78b4
84bdae6
1de78b4
 
 
 
84bdae6
 
 
 
 
 
 
 
 
 
a4a6903
 
 
1de78b4
a4a6903
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8276ceb
 
a4a6903
 
6cfe5ea
 
36e99f7
84bdae6
 
8276ceb
84bdae6
 
 
 
6cfe5ea
7f2e3fd
 
1de78b4
 
 
 
 
7f2e3fd
 
1de78b4
7f2e3fd
 
 
 
 
8276ceb
7f2e3fd
 
 
 
6cfe5ea
7f2e3fd
 
1de78b4
 
 
 
 
7f2e3fd
 
1de78b4
7f2e3fd
8276ceb
 
7f2e3fd
8276ceb
6cfe5ea
7f2e3fd
 
 
6cfe5ea
7f2e3fd
 
1de78b4
 
 
 
 
7f2e3fd
 
1de78b4
7f2e3fd
 
 
 
 
8276ceb
7f2e3fd
 
 
 
54ebcde
 
 
 
1de78b4
 
 
f03fc12
1de78b4
54ebcde
 
5e2c141
f03fc12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1de78b4
 
 
f03fc12
1de78b4
f03fc12
 
 
 
 
5e2c141
1189736
f03fc12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1189736
 
 
1de78b4
 
 
 
 
 
 
1189736
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4e77d60
1189736
 
1de78b4
 
 
 
 
 
 
1189736
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1de78b4
 
 
 
 
1189736
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d40c782
 
 
 
 
 
 
 
a425fdf
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
---
title: 🤗 Hub Stats
---

_Note: The charts are updated daily via the <a class="font-bold text-blue" href="https://huggingface.co/datasets/cfahlgren1/hub-stats" target="_blank" rel="noopener noreferrer">hub-stats dataset</a>. It may take a little while for the data to load as the queries are running entirely in the browser._

```sql hub_growth
-- Hub Growth by Month (using DATE_TRUNC for proper date ordering)
WITH all_data AS (
  SELECT 
    CAST(DATE_TRUNC('month', createdAt) AS DATE) AS month, 
    'model'   AS repo 
  FROM read_parquet('https://huggingface.co/datasets/cfahlgren1/hub-stats/resolve/main/models.parquet?download=true')
  WHERE createdAt IS NOT NULL

  UNION ALL

  SELECT 
    CAST(DATE_TRUNC('month', createdAt) AS DATE) AS month, 
    'dataset' AS repo 
  FROM read_parquet('https://huggingface.co/datasets/cfahlgren1/hub-stats/resolve/main/datasets.parquet')
  WHERE createdAt IS NOT NULL

  UNION ALL

  SELECT 
    CAST(DATE_TRUNC('month', createdAt) AS DATE) AS month, 
    'space'   AS repo 
  FROM read_parquet('https://huggingface.co/datasets/cfahlgren1/hub-stats/resolve/main/spaces.parquet?download=true')
  WHERE createdAt IS NOT NULL
)
SELECT
  month,
  repo,
  COUNT(*) AS creations
FROM all_data
GROUP BY month, repo
ORDER BY month, repo
```

## Cumulative Hub Growth

```sql cumulative_growth_by_repo
-- Cumulative Hub Growth
WITH ordered_data AS (
  SELECT
    month,
    repo,
    creations,
    ROW_NUMBER() OVER (PARTITION BY repo ORDER BY month) AS row_num
  FROM ${hub_growth}
)
SELECT
  month,
  repo,
  SUM(creations) OVER (PARTITION BY repo ORDER BY month) AS cumulative_creations
FROM ordered_data
ORDER BY month, repo
```

<AreaChart 
    data={cumulative_growth_by_repo}
    x=month
    y=cumulative_creations
    series=repo
    yFmt='#,##0.00,,"M"'
    xFmt='MMM yyyy'
/>

## Models, Datasets, Spaces created per month.

<BarChart 
    data={hub_growth}
    x=month
    xFmt='MMM yyyy'
    y=creations
    series=repo
/>

## Models Created Each Month

```sql model_creations_by_month
-- Models Created Each Month
SELECT
  month,
  repo,
  creations
FROM ${hub_growth}
WHERE repo = 'model'
ORDER BY month;
```

<AreaChart 
    data={model_creations_by_month}
    x=month
    xFmt='MMM yyyy'
    labels=true
    y=creations
/>

## Datasets Created Each Month

```sql dataset_creations_by_month
-- Datasets Created Each Month
SELECT
  month,
  repo,
  creations
FROM ${hub_growth}
WHERE repo = 'dataset'
ORDER BY month;
```
<AreaChart 
    data={dataset_creations_by_month}
    x=month
    xFmt='MMM yyyy'
    y=creations
    labels=true
/>

## Spaces Created Each Month

```sql space_creations_by_month
-- Spaces Created Each Month
SELECT
  month,
  repo,
  creations
FROM ${hub_growth}
WHERE repo = 'space'
ORDER BY month;
```

<AreaChart 
    data={space_creations_by_month}
    x=month
    xFmt='MMM yyyy'
    y=creations
    labels=true
/>

# Model Downloads by Pipeline Tag (Last 30 days)

```sql model_pipeline_downloads
SELECT
    pipeline_tag AS name,
    SUM(downloads) AS value
FROM read_parquet('https://huggingface.co/datasets/cfahlgren1/hub-stats/resolve/main/models.parquet?download=true')
GROUP BY pipeline_tag
ORDER BY value DESC
```

<DataTable data={model_pipeline_downloads} search=true>
  <Column id="name" title="Pipeline Tag" />
  <Column id="value" title="Downloads Last 30 Days" fmt='#,##0.00,,"M"' />
</DataTable>


<ECharts config={
    {
        tooltip: {
            formatter: '{b}: {c} ({d}%)'
        },
        series: [
            {
                type: 'pie',
                radius: ['40%', '70%'],
                data: [...model_pipeline_downloads],
                label: {
                    show: true,
                    formatter: '{b}: {c}'
                }
            }
        ]
    }
}
/>

# Model Downloads by Library (Last 30 days)

```sql model_library_downloads
SELECT
    library_name AS name,
    SUM(downloads) AS value
FROM read_parquet('https://huggingface.co/datasets/cfahlgren1/hub-stats/resolve/main/models.parquet?download=true')
GROUP BY library_name
ORDER BY value DESC
```

<DataTable data={model_library_downloads} search=true>
  <Column id="name" title="Library" />
  <Column id="value" title="Downloads Last 30 Days" fmt='#,##0.00,,"M"' />
</DataTable>


<ECharts config={
    {
        tooltip: {
            formatter: '{b}: {c} ({d}%)'
        },
        series: [
            {
                type: 'pie',
                radius: ['40%', '70%'],
                data: [...model_library_downloads],
                label: {
                    show: true,
                    formatter: '{b}: {c}'
                }
            }
        ]
    }
}
/>

# Model Licenses

```sql model_license_ratio
SELECT
    SUBSTRING(name, 9) AS name,
    COUNT(*) as value
FROM read_parquet('https://huggingface.co/datasets/cfahlgren1/hub-stats/resolve/main/models.parquet?download=true'),
    UNNEST(tags) AS t(name)
WHERE name LIKE 'license:%'
GROUP BY name
```

<ECharts config={
    {
        tooltip: {
            formatter: '{b}: {c} ({d}%)'
        },
      series: [
        {
          type: 'pie',
          radius: ['40%', '70%'],
          data: [...model_license_ratio],
        }
      ]
      }
    }
/>

# Dataset Licenses

```sql dataset_license_ratio
SELECT
    SUBSTRING(name, 9) AS name,
    COUNT(*) as value
FROM read_parquet('https://huggingface.co/datasets/cfahlgren1/hub-stats/resolve/main/datasets.parquet?download=true'),
    UNNEST(tags) AS t(name)
WHERE name LIKE 'license:%'
GROUP BY name
```

<ECharts config={
    {
        tooltip: {
            formatter: '{b}: {c} ({d}%)'
        },
      series: [
        {
          type: 'pie',
          radius: ['40%', '70%'],
          data: [...dataset_license_ratio],
        }
      ]
      }
    }
/>

# Space SDKs

```sql space_sdk_ratio
SELECT
    sdk as name,
    COUNT(*) as value
FROM read_parquet('https://huggingface.co/datasets/cfahlgren1/hub-stats/resolve/main/spaces.parquet?download=true')
GROUP BY name
```


<ECharts config={
    {
        tooltip: {
            formatter: '{b}: {c} ({d}%)'
        },
      series: [
        {
          type: 'pie',
          radius: ['40%', '70%'],
          data: [...space_sdk_ratio],
        }
      ]
      }
    }
/>

# Hub Stats Dataset
<iframe
  src="https://huggingface.co/datasets/cfahlgren1/hub-stats/embed/viewer/datasets/train"
  frameborder="0"
  width="100%"
  height="560px"
></iframe>