Update app.py
Browse files
app.py
CHANGED
@@ -240,8 +240,8 @@ with st.sidebar:
|
|
240 |
with st.spinner("Loading top trending accounts..."):
|
241 |
trending_accounts, top_owners = get_trending_accounts(limit=100)
|
242 |
|
243 |
-
# Show trending accounts list
|
244 |
-
st.subheader("🔥 Top Trending Accounts")
|
245 |
|
246 |
# Add stats expander
|
247 |
with st.expander("View Top 30 Contributor Stats"):
|
@@ -261,24 +261,13 @@ with st.sidebar:
|
|
261 |
plt.tight_layout()
|
262 |
st.pyplot(fig)
|
263 |
|
264 |
-
#
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
st.caption(f"Showing {len(filtered_accounts)} of {len(trending_accounts)} accounts")
|
272 |
-
|
273 |
-
# Create a scrollable container for the accounts list
|
274 |
-
account_container = st.container()
|
275 |
-
with account_container:
|
276 |
-
selected_trending = st.selectbox(
|
277 |
-
"Select trending account",
|
278 |
-
options=filtered_accounts,
|
279 |
-
index=0 if filtered_accounts else None,
|
280 |
-
key="trending_selectbox"
|
281 |
-
)
|
282 |
|
283 |
# Custom account input option
|
284 |
st.markdown("<div style='text-align: center; margin: 10px 0;'>OR</div>", unsafe_allow_html=True)
|
@@ -308,7 +297,7 @@ st.title("🤗 Hugging Face Contributions")
|
|
308 |
if username:
|
309 |
with st.spinner(f"Fetching commit data for {username}..."):
|
310 |
# Display contributor rank if in top 100
|
311 |
-
if username in trending_accounts:
|
312 |
rank = trending_accounts.index(username) + 1
|
313 |
st.success(f"🏆 {username} is ranked #{rank} in the top trending contributors!")
|
314 |
|
|
|
240 |
with st.spinner("Loading top trending accounts..."):
|
241 |
trending_accounts, top_owners = get_trending_accounts(limit=100)
|
242 |
|
243 |
+
# Show trending accounts list
|
244 |
+
st.subheader("🔥 Top 30 Trending Accounts")
|
245 |
|
246 |
# Add stats expander
|
247 |
with st.expander("View Top 30 Contributor Stats"):
|
|
|
261 |
plt.tight_layout()
|
262 |
st.pyplot(fig)
|
263 |
|
264 |
+
# Display trending accounts without additional filtering
|
265 |
+
selected_trending = st.selectbox(
|
266 |
+
"Select trending account",
|
267 |
+
options=trending_accounts[:30], # Limit to top 30
|
268 |
+
index=0 if trending_accounts else None,
|
269 |
+
key="trending_selectbox"
|
270 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
# Custom account input option
|
273 |
st.markdown("<div style='text-align: center; margin: 10px 0;'>OR</div>", unsafe_allow_html=True)
|
|
|
297 |
if username:
|
298 |
with st.spinner(f"Fetching commit data for {username}..."):
|
299 |
# Display contributor rank if in top 100
|
300 |
+
if username in trending_accounts[:30]:
|
301 |
rank = trending_accounts.index(username) + 1
|
302 |
st.success(f"🏆 {username} is ranked #{rank} in the top trending contributors!")
|
303 |
|