Spaces:
Runtime error
Runtime error
remove migration script
Browse files- user_history.py +3 -3
user_history.py
CHANGED
@@ -352,7 +352,7 @@ def _get_nb_users() -> int:
|
|
352 |
user_history = _UserHistory()
|
353 |
if not user_history.initialized:
|
354 |
return 0
|
355 |
-
if user_history.folder_path is not None:
|
356 |
return len([path for path in user_history.folder_path.iterdir() if path.is_dir()])
|
357 |
return 0
|
358 |
|
@@ -361,7 +361,7 @@ def _get_nb_images() -> int:
|
|
361 |
user_history = _UserHistory()
|
362 |
if not user_history.initialized:
|
363 |
return 0
|
364 |
-
if user_history.folder_path is not None:
|
365 |
return len([path for path in user_history.folder_path.glob("*/images/*")])
|
366 |
return 0
|
367 |
|
@@ -420,4 +420,4 @@ def _fetch_admins() -> List[str]:
|
|
420 |
response = requests.get(f"https://huggingface.co/api/organizations/{namespace}/members")
|
421 |
if response.status_code == 200:
|
422 |
return sorted((member["user"] for member in response.json()), key=lambda x: x.lower())
|
423 |
-
return [namespace]
|
|
|
352 |
user_history = _UserHistory()
|
353 |
if not user_history.initialized:
|
354 |
return 0
|
355 |
+
if user_history.folder_path is not None and user_history.folder_path.exists():
|
356 |
return len([path for path in user_history.folder_path.iterdir() if path.is_dir()])
|
357 |
return 0
|
358 |
|
|
|
361 |
user_history = _UserHistory()
|
362 |
if not user_history.initialized:
|
363 |
return 0
|
364 |
+
if user_history.folder_path is not None and user_history.folder_path.exists():
|
365 |
return len([path for path in user_history.folder_path.glob("*/images/*")])
|
366 |
return 0
|
367 |
|
|
|
420 |
response = requests.get(f"https://huggingface.co/api/organizations/{namespace}/members")
|
421 |
if response.status_code == 200:
|
422 |
return sorted((member["user"] for member in response.json()), key=lambda x: x.lower())
|
423 |
+
return [namespace]
|