Spaces:
Running
Running
burtenshaw
commited on
Commit
·
fe23681
1
Parent(s):
4bf3084
use v1 images
Browse files
app.py
CHANGED
|
@@ -41,25 +41,25 @@ def create_image(stats, username):
|
|
| 41 |
|
| 42 |
# Choose base image URL based on highest activity (keep using activity for image selection)
|
| 43 |
if model_activity == 0 and dataset_activity == 0 and space_activity == 0:
|
| 44 |
-
url = "https://hub-recap.imglab-cdn.net/images/empty.png"
|
| 45 |
-
avatar = "
|
| 46 |
elif model_activity >= max(dataset_activity, space_activity):
|
| 47 |
-
url = "https://hub-recap.imglab-cdn.net/images/model.png"
|
| 48 |
avatar = f"Model Pro" + (
|
| 49 |
f" (top {model_percentile}%)" if model_percentile > 0 else ""
|
| 50 |
)
|
| 51 |
elif dataset_activity >= max(model_activity, space_activity):
|
| 52 |
-
url = "https://hub-recap.imglab-cdn.net/images/dataset.png"
|
| 53 |
avatar = f"Dataset Guru" + (
|
| 54 |
f" (top {dataset_percentile}%)" if dataset_percentile > 0 else ""
|
| 55 |
)
|
| 56 |
elif space_activity >= max(model_activity, dataset_activity):
|
| 57 |
-
url = "https://hub-recap.imglab-cdn.net/images/space.png"
|
| 58 |
avatar = f"Space Artiste" + (
|
| 59 |
f" (top {space_percentile}%)" if space_percentile > 0 else ""
|
| 60 |
)
|
| 61 |
else:
|
| 62 |
-
url = "https://hub-recap.imglab-cdn.net/images/empty.png"
|
| 63 |
avatar = "newbie! We couldn't find your stats on the Hub, maybe in 2025?"
|
| 64 |
|
| 65 |
# Build text content with proper formatting
|
|
@@ -144,9 +144,7 @@ def create_image(stats, username):
|
|
| 144 |
other_percentiles.append(f"Top {space_percentile}% in spaces")
|
| 145 |
|
| 146 |
if other_percentiles:
|
| 147 |
-
text_parts.append(
|
| 148 |
-
f'<span size="9pt">{". ".join(other_percentiles)}!</span>'
|
| 149 |
-
)
|
| 150 |
|
| 151 |
# Join all parts with newlines
|
| 152 |
text = "\n".join(text_parts)
|
|
@@ -299,6 +297,7 @@ with gr.Blocks(title="Hugging Face Community Stats") as demo:
|
|
| 299 |
["bartowski"],
|
| 300 |
["huggingface"],
|
| 301 |
["cfahlgren1"],
|
|
|
|
| 302 |
],
|
| 303 |
inputs=username_input,
|
| 304 |
label="Try these examples",
|
|
|
|
| 41 |
|
| 42 |
# Choose base image URL based on highest activity (keep using activity for image selection)
|
| 43 |
if model_activity == 0 and dataset_activity == 0 and space_activity == 0:
|
| 44 |
+
url = "https://hub-recap.imglab-cdn.net/images/empty-v1.png"
|
| 45 |
+
avatar = "newbie! We couldn't find your stats on the Hub, maybe in 2025?"
|
| 46 |
elif model_activity >= max(dataset_activity, space_activity):
|
| 47 |
+
url = "https://hub-recap.imglab-cdn.net/images/model-v1.png"
|
| 48 |
avatar = f"Model Pro" + (
|
| 49 |
f" (top {model_percentile}%)" if model_percentile > 0 else ""
|
| 50 |
)
|
| 51 |
elif dataset_activity >= max(model_activity, space_activity):
|
| 52 |
+
url = "https://hub-recap.imglab-cdn.net/images/dataset-v1.png"
|
| 53 |
avatar = f"Dataset Guru" + (
|
| 54 |
f" (top {dataset_percentile}%)" if dataset_percentile > 0 else ""
|
| 55 |
)
|
| 56 |
elif space_activity >= max(model_activity, dataset_activity):
|
| 57 |
+
url = "https://hub-recap.imglab-cdn.net/images/space-v1.png"
|
| 58 |
avatar = f"Space Artiste" + (
|
| 59 |
f" (top {space_percentile}%)" if space_percentile > 0 else ""
|
| 60 |
)
|
| 61 |
else:
|
| 62 |
+
url = "https://hub-recap.imglab-cdn.net/images/empty-v1.png"
|
| 63 |
avatar = "newbie! We couldn't find your stats on the Hub, maybe in 2025?"
|
| 64 |
|
| 65 |
# Build text content with proper formatting
|
|
|
|
| 144 |
other_percentiles.append(f"Top {space_percentile}% in spaces")
|
| 145 |
|
| 146 |
if other_percentiles:
|
| 147 |
+
text_parts.append(f'<span size="9pt">{". ".join(other_percentiles)}!</span>')
|
|
|
|
|
|
|
| 148 |
|
| 149 |
# Join all parts with newlines
|
| 150 |
text = "\n".join(text_parts)
|
|
|
|
| 297 |
["bartowski"],
|
| 298 |
["huggingface"],
|
| 299 |
["cfahlgren1"],
|
| 300 |
+
["argilla"],
|
| 301 |
],
|
| 302 |
inputs=username_input,
|
| 303 |
label="Try these examples",
|