Spaces:
Sleeping
Sleeping
RichardErkhov
commited on
Commit
•
cab1108
1
Parent(s):
bc4be63
Update app.py
Browse files
app.py
CHANGED
@@ -57,25 +57,33 @@ def prepare_authors_df(models_df):
|
|
57 |
all_models_df = fetch_models().sort_values(by="Downloads (30d)", ascending=False)
|
58 |
authors_df = prepare_authors_df(all_models_df)
|
59 |
|
|
|
|
|
|
|
|
|
|
|
60 |
def update_model_table(start_idx):
|
61 |
-
# Instead of messing with model_table.value, just return more rows from all_models_df
|
62 |
new_end = start_idx + CHUNK_SIZE
|
63 |
-
# Slice the global DataFrame that already has HTML formatting
|
64 |
combined_df = all_models_df.iloc[:new_end].copy()
|
65 |
return combined_df, new_end
|
66 |
|
67 |
with gr.Blocks() as demo:
|
68 |
-
gr.Markdown("""
|
69 |
# 🚀GGUF Tracker🚀
|
70 |
-
Welcome to 🚀**GGUF Tracker**🚀, a live-updating leaderboard for all things GGUF on 🚀Hugging Face.
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
-
|
|
|
|
|
73 |
""")
|
74 |
-
|
75 |
-
gr.Markdown("# GGUF Models and Authors Leaderboard")
|
76 |
with gr.Tabs():
|
77 |
with gr.TabItem("Models"):
|
78 |
-
# Initially load the first CHUNK_SIZE rows
|
79 |
model_table = gr.DataFrame(
|
80 |
value=all_models_df.iloc[:CHUNK_SIZE],
|
81 |
interactive=True,
|
|
|
57 |
all_models_df = fetch_models().sort_values(by="Downloads (30d)", ascending=False)
|
58 |
authors_df = prepare_authors_df(all_models_df)
|
59 |
|
60 |
+
# Calculate totals
|
61 |
+
total_models_count = len(all_models_df)
|
62 |
+
total_downloads = all_models_df["Downloads (30d)"].sum()
|
63 |
+
total_likes = all_models_df["Likes"].sum()
|
64 |
+
|
65 |
def update_model_table(start_idx):
|
|
|
66 |
new_end = start_idx + CHUNK_SIZE
|
|
|
67 |
combined_df = all_models_df.iloc[:new_end].copy()
|
68 |
return combined_df, new_end
|
69 |
|
70 |
with gr.Blocks() as demo:
|
71 |
+
gr.Markdown(f"""
|
72 |
# 🚀GGUF Tracker🚀
|
73 |
+
Welcome to 🚀**GGUF Tracker**🚀, a live-updating leaderboard for all things GGUF on 🚀Hugging Face.
|
74 |
+
Stats refresh every hour, giving you the latest numbers.
|
75 |
+
|
76 |
+
By the way, I’m 🚀Richard Erkhov, and you can check out more of what I’m working on at my [🌟**github**](https://github.com/RichardErkhov),
|
77 |
+
[🌟**huggingface**](https://huggingface.co/RichardErkhov) or [🌟**erkhov.com**](https://erkhov.com). Go take a look—I think you’ll like what you find.
|
78 |
+
""")
|
79 |
|
80 |
+
gr.Markdown(f"""
|
81 |
+
# GGUF Models and Authors Leaderboard
|
82 |
+
**Total Models:** {total_models_count} | **Total Downloads (30d):** {total_downloads} | **Total Likes:** {total_likes}
|
83 |
""")
|
84 |
+
|
|
|
85 |
with gr.Tabs():
|
86 |
with gr.TabItem("Models"):
|
|
|
87 |
model_table = gr.DataFrame(
|
88 |
value=all_models_df.iloc[:CHUNK_SIZE],
|
89 |
interactive=True,
|