Spaces:
Sleeping
Sleeping
RichardErkhov
commited on
Commit
•
5996317
1
Parent(s):
cab1108
Update app.py
Browse files
app.py
CHANGED
@@ -44,13 +44,15 @@ def fetch_models():
|
|
44 |
|
45 |
# Prepare authors DataFrame
|
46 |
def prepare_authors_df(models_df):
|
47 |
-
# Extract the actual author name from the link (if needed)
|
48 |
authors_df = models_df.copy()
|
49 |
authors_df["Clean Author Name"] = authors_df["Author Name"].str.extract(r'href="https://huggingface\.co/(.*?)"')
|
|
|
50 |
grouped = authors_df.groupby("Clean Author Name").agg(
|
51 |
Models_Count=("Model ID", "count"),
|
52 |
-
Total_Downloads=("Downloads (30d)", "sum")
|
|
|
53 |
).reset_index()
|
|
|
54 |
grouped.rename(columns={"Clean Author Name": "Author Name"}, inplace=True)
|
55 |
return grouped.sort_values(by="Models_Count", ascending=False)
|
56 |
|
@@ -102,7 +104,7 @@ with gr.Blocks() as demo:
|
|
102 |
interactive=False,
|
103 |
label="Authors",
|
104 |
wrap=True,
|
105 |
-
datatype=["str", "number", "number"]
|
106 |
)
|
107 |
|
108 |
demo.launch()
|
|
|
44 |
|
45 |
# Prepare authors DataFrame
|
46 |
def prepare_authors_df(models_df):
|
|
|
47 |
authors_df = models_df.copy()
|
48 |
authors_df["Clean Author Name"] = authors_df["Author Name"].str.extract(r'href="https://huggingface\.co/(.*?)"')
|
49 |
+
|
50 |
grouped = authors_df.groupby("Clean Author Name").agg(
|
51 |
Models_Count=("Model ID", "count"),
|
52 |
+
Total_Downloads=("Downloads (30d)", "sum"),
|
53 |
+
Total_Likes=("Likes", "sum")
|
54 |
).reset_index()
|
55 |
+
|
56 |
grouped.rename(columns={"Clean Author Name": "Author Name"}, inplace=True)
|
57 |
return grouped.sort_values(by="Models_Count", ascending=False)
|
58 |
|
|
|
104 |
interactive=False,
|
105 |
label="Authors",
|
106 |
wrap=True,
|
107 |
+
datatype=["str", "number", "number", "number"]
|
108 |
)
|
109 |
|
110 |
demo.launch()
|