osanseviero commited on
Commit
c93e805
·
verified ·
1 Parent(s): 7fe41f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,7 +5,7 @@ from huggingface_hub import list_models, list_datasets, list_spaces
5
  from typing import Union
6
 
7
  # Helper function to get the total storage for models, datasets, or spaces
8
- def get_total_storage(namespace, resource_type, oauth_token: gr.OAuthToken):
9
  if resource_type == "model":
10
  resources = list_models(author=namespace, token=oauth_token.token)
11
  url_base = "https://huggingface.co/api/models"
@@ -27,7 +27,7 @@ def get_total_storage(namespace, resource_type, oauth_token: gr.OAuthToken):
27
 
28
  return total_storage, len(resources)
29
 
30
- def get_report(namespace, oauth_token: Union[OAuthToken, None]):
31
  # Fetch storage and counts for models, datasets, and spaces
32
  model_storage, n_models = get_total_storage(namespace, "model", oauth_token)
33
  dataset_storage, n_datasets = get_total_storage(namespace, "dataset", oauth_token)
 
5
  from typing import Union
6
 
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"
 
27
 
28
  return total_storage, len(resources)
29
 
30
+ def get_report(namespace, oauth_token: Union[gr.OAuthToken, None]):
31
  # Fetch storage and counts for models, datasets, and spaces
32
  model_storage, n_models = get_total_storage(namespace, "model", oauth_token)
33
  dataset_storage, n_datasets = get_total_storage(namespace, "dataset", oauth_token)