Spaces:
Running
Running
burtenshaw
commited on
Commit
·
17c031b
1
Parent(s):
2f505a3
change app logic to include repos from before 2024
Browse files
app.py
CHANGED
|
@@ -178,14 +178,14 @@ def get_user_stats(username):
|
|
| 178 |
# Get models stats
|
| 179 |
models_response = requests.get(
|
| 180 |
"https://huggingface.co/api/models",
|
| 181 |
-
params={"author": username, "full": "
|
| 182 |
headers=headers,
|
| 183 |
)
|
| 184 |
# Filter for 2024 models only
|
| 185 |
models = [
|
| 186 |
model
|
| 187 |
for model in models_response.json()
|
| 188 |
-
if is_from_2024(model.get("createdAt"))
|
| 189 |
]
|
| 190 |
|
| 191 |
# Get datasets stats
|
|
@@ -198,7 +198,7 @@ def get_user_stats(username):
|
|
| 198 |
datasets = [
|
| 199 |
dataset
|
| 200 |
for dataset in datasets_response.json()
|
| 201 |
-
if is_from_2024(dataset.get("createdAt"))
|
| 202 |
]
|
| 203 |
|
| 204 |
# Get spaces stats
|
|
@@ -211,7 +211,7 @@ def get_user_stats(username):
|
|
| 211 |
spaces = [
|
| 212 |
space
|
| 213 |
for space in spaces_response.json()
|
| 214 |
-
if is_from_2024(space.get("createdAt"))
|
| 215 |
]
|
| 216 |
|
| 217 |
# Calculate totals for 2024 items only
|
|
|
|
| 178 |
# Get models stats
|
| 179 |
models_response = requests.get(
|
| 180 |
"https://huggingface.co/api/models",
|
| 181 |
+
params={"author": username, "full": "False", "limit": 100, "sort": "downloads"},
|
| 182 |
headers=headers,
|
| 183 |
)
|
| 184 |
# Filter for 2024 models only
|
| 185 |
models = [
|
| 186 |
model
|
| 187 |
for model in models_response.json()
|
| 188 |
+
# if is_from_2024(model.get("createdAt"))
|
| 189 |
]
|
| 190 |
|
| 191 |
# Get datasets stats
|
|
|
|
| 198 |
datasets = [
|
| 199 |
dataset
|
| 200 |
for dataset in datasets_response.json()
|
| 201 |
+
# if is_from_2024(dataset.get("createdAt"))
|
| 202 |
]
|
| 203 |
|
| 204 |
# Get spaces stats
|
|
|
|
| 211 |
spaces = [
|
| 212 |
space
|
| 213 |
for space in spaces_response.json()
|
| 214 |
+
# if is_from_2024(space.get("createdAt"))
|
| 215 |
]
|
| 216 |
|
| 217 |
# Calculate totals for 2024 items only
|