Fsezai33 commited on
Commit
9e4e90a
·
verified ·
1 Parent(s): 894f561

Detect gated status on older Hub clients

Browse files
Files changed (1) hide show
  1. 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
- files = [sibling.rfilename for sibling in (info.siblings or [])]
292
- gated = info.gated or False
 
293
  file_sizes = {
294
  sibling.rfilename: int(sibling.size)
295
- for sibling in (info.siblings or [])
296
- if sibling.size is not None
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