Update app.py
Browse files
app.py
CHANGED
@@ -96,11 +96,8 @@ def create_stats_html():
|
|
96 |
|
97 |
# Create derivative type distribution chart
|
98 |
if len(derivative_df) > 0:
|
99 |
-
#
|
100 |
-
type_dist = derivative_df.groupby('model_type').
|
101 |
-
'model_id': 'count',
|
102 |
-
'downloads_30d': 'sum'
|
103 |
-
}).reset_index()
|
104 |
|
105 |
# Format model types to be more readable
|
106 |
type_dist['model_type'] = type_dist['model_type'].str.capitalize()
|
@@ -110,7 +107,7 @@ def create_stats_html():
|
|
110 |
type_dist,
|
111 |
x='model_type',
|
112 |
y='downloads_30d',
|
113 |
-
title='Downloads by Model Type',
|
114 |
labels={'downloads_30d': 'Downloads', 'model_type': 'Model Type'},
|
115 |
text=type_dist['downloads_30d'].apply(format_number)
|
116 |
)
|
|
|
96 |
|
97 |
# Create derivative type distribution chart
|
98 |
if len(derivative_df) > 0:
|
99 |
+
# Group by model_type and sum downloads
|
100 |
+
type_dist = derivative_df.groupby('model_type')['downloads_30d'].sum().reset_index()
|
|
|
|
|
|
|
101 |
|
102 |
# Format model types to be more readable
|
103 |
type_dist['model_type'] = type_dist['model_type'].str.capitalize()
|
|
|
107 |
type_dist,
|
108 |
x='model_type',
|
109 |
y='downloads_30d',
|
110 |
+
title='Total Downloads by Model Type',
|
111 |
labels={'downloads_30d': 'Downloads', 'model_type': 'Model Type'},
|
112 |
text=type_dist['downloads_30d'].apply(format_number)
|
113 |
)
|