Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -99,13 +99,13 @@ for category in categories.keys():
|
|
99 |
# Add space URLs
|
100 |
df['url'] = 'https://huggingface.co/spaces/' + df['id']
|
101 |
|
102 |
-
# Let's show the top
|
103 |
-
print("Top
|
104 |
for category in categories.keys():
|
105 |
-
print(f"\n=== {category} ===")
|
106 |
-
|
107 |
# Format output with padding for better readability
|
108 |
-
print(top_5.to_string(index=False))
|
109 |
|
110 |
# ------------------------------------------------------
|
111 |
|
@@ -118,7 +118,7 @@ def search_spaces(search_text, category):
|
|
118 |
if search_text:
|
119 |
spaces_df = spaces_df[spaces_df['title'].str.lower().str.contains(search_text.lower())]
|
120 |
|
121 |
-
spaces = spaces_df.nlargest(
|
122 |
|
123 |
# Get category stats
|
124 |
total_spaces = len(spaces_df)
|
|
|
99 |
# Add space URLs
|
100 |
df['url'] = 'https://huggingface.co/spaces/' + df['id']
|
101 |
|
102 |
+
# Let's show the top 10 spaces from each category with their links
|
103 |
+
# print("Top 10 spaces in each category with links:")
|
104 |
for category in categories.keys():
|
105 |
+
# print(f"\n=== {category} ===")
|
106 |
+
top_10 = df[df['category'] == category].nlargest(10, 'likes')[['title', 'likes', 'url']]
|
107 |
# Format output with padding for better readability
|
108 |
+
# print(top_5.to_string(index=False))
|
109 |
|
110 |
# ------------------------------------------------------
|
111 |
|
|
|
118 |
if search_text:
|
119 |
spaces_df = spaces_df[spaces_df['title'].str.lower().str.contains(search_text.lower())]
|
120 |
|
121 |
+
spaces = spaces_df.nlargest(50, 'likes')[['title', 'likes', 'url', 'category']]
|
122 |
|
123 |
# Get category stats
|
124 |
total_spaces = len(spaces_df)
|