Spaces:
Sleeping
Sleeping
data leaderboard 2
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import pandas as pd
|
|
4 |
import time
|
5 |
import threading
|
6 |
from huggingface_hub import HfApi
|
|
|
7 |
|
8 |
api = HfApi()
|
9 |
|
@@ -38,13 +39,15 @@ df = pd.read_csv("author_data_hf_merged.csv")
|
|
38 |
df_author_copy = df.copy()
|
39 |
|
40 |
df["author"] = df["author"].apply(lambda x: clickable(x))
|
41 |
-
df = df.sort_values(by='models', ascending=False)
|
42 |
df['Serial Number'] = [i for i in range(1, len(df)+1)]
|
43 |
df['Total Usage'] = df[['models', 'datasets', 'spaces']].sum(axis=1)
|
44 |
df = df[['Serial Number', "author", "Total Usage", "models", "datasets", "spaces"]]
|
|
|
45 |
|
46 |
-
|
|
|
47 |
|
|
|
48 |
|
49 |
desc = f"""
|
50 |
🎯 The Leaderboard aims to track authors data usage in 🤗 Huggingface.
|
|
|
4 |
import time
|
5 |
import threading
|
6 |
from huggingface_hub import HfApi
|
7 |
+
from humanize import naturalsize
|
8 |
|
9 |
api = HfApi()
|
10 |
|
|
|
39 |
df_author_copy = df.copy()
|
40 |
|
41 |
df["author"] = df["author"].apply(lambda x: clickable(x))
|
|
|
42 |
df['Serial Number'] = [i for i in range(1, len(df)+1)]
|
43 |
df['Total Usage'] = df[['models', 'datasets', 'spaces']].sum(axis=1)
|
44 |
df = df[['Serial Number', "author", "Total Usage", "models", "datasets", "spaces"]]
|
45 |
+
df = df.sort_values(by='Total Usage', ascending=False)
|
46 |
|
47 |
+
naturalsize_columns = ['Total Usage', 'models', 'datasets', 'spaces']
|
48 |
+
df[cols_to_naturalsize] = df[naturalsize_columns].applymap(humanize.naturalsize)
|
49 |
|
50 |
+
df = apply_headers(df, ["🔢 Serial Number", "👤 Author", "⚡️ Total Usage", "🏛️ Models", "📊 Datasets", "🚀 Spaces"])
|
51 |
|
52 |
desc = f"""
|
53 |
🎯 The Leaderboard aims to track authors data usage in 🤗 Huggingface.
|