Spaces:
Running on Zero
Running on Zero
Detect gated status on older Hub clients
Browse files- backend_router.py +5 -5
backend_router.py
CHANGED
|
@@ -286,14 +286,14 @@ class BackendRouter:
|
|
| 286 |
info = self.api.model_info(
|
| 287 |
repo_id=model_id,
|
| 288 |
repo_type="model",
|
| 289 |
-
files_metadata=True,
|
| 290 |
)
|
| 291 |
-
|
| 292 |
-
|
|
|
|
| 293 |
file_sizes = {
|
| 294 |
sibling.rfilename: int(sibling.size)
|
| 295 |
-
for sibling in
|
| 296 |
-
if sibling
|
| 297 |
}
|
| 298 |
except (AttributeError, TypeError):
|
| 299 |
# Keep compatibility with lightweight/fake API clients and older
|
|
|
|
| 286 |
info = self.api.model_info(
|
| 287 |
repo_id=model_id,
|
| 288 |
repo_type="model",
|
|
|
|
| 289 |
)
|
| 290 |
+
siblings = getattr(info, "siblings", []) or []
|
| 291 |
+
files = [sibling.rfilename for sibling in siblings]
|
| 292 |
+
gated = getattr(info, "gated", False) or False
|
| 293 |
file_sizes = {
|
| 294 |
sibling.rfilename: int(sibling.size)
|
| 295 |
+
for sibling in siblings
|
| 296 |
+
if getattr(sibling, "size", None) is not None
|
| 297 |
}
|
| 298 |
except (AttributeError, TypeError):
|
| 299 |
# Keep compatibility with lightweight/fake API clients and older
|