Spaces:
Runtime error
Runtime error
osanseviero
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -7,13 +7,13 @@ from typing import Union
|
|
7 |
# Helper function to get the total storage for models, datasets, or spaces
|
8 |
def get_total_storage(namespace, resource_type, oauth_token: Union[gr.OAuthToken, None]):
|
9 |
if resource_type == "model":
|
10 |
-
resources = list_models(author=namespace, token=oauth_token.token)
|
11 |
url_base = "https://huggingface.co/api/models"
|
12 |
elif resource_type == "dataset":
|
13 |
-
resources = list_datasets(author=namespace, token=oauth_token.token)
|
14 |
url_base = "https://huggingface.co/api/datasets"
|
15 |
elif resource_type == "space":
|
16 |
-
resources = list_spaces(author=namespace, token=oauth_token.token)
|
17 |
url_base = "https://huggingface.co/api/spaces"
|
18 |
|
19 |
total_storage = 0
|
|
|
7 |
# Helper function to get the total storage for models, datasets, or spaces
|
8 |
def get_total_storage(namespace, resource_type, oauth_token: Union[gr.OAuthToken, None]):
|
9 |
if resource_type == "model":
|
10 |
+
resources = list(list_models(author=namespace, token=oauth_token.token))
|
11 |
url_base = "https://huggingface.co/api/models"
|
12 |
elif resource_type == "dataset":
|
13 |
+
resources = list(list_datasets(author=namespace, token=oauth_token.token))
|
14 |
url_base = "https://huggingface.co/api/datasets"
|
15 |
elif resource_type == "space":
|
16 |
+
resources = list(list_spaces(author=namespace, token=oauth_token.token))
|
17 |
url_base = "https://huggingface.co/api/spaces"
|
18 |
|
19 |
total_storage = 0
|