John6666 commited on
Commit
9468155
·
verified ·
1 Parent(s): e67fa25

Upload modutils.py

Browse files
Files changed (1) hide show
  1. modutils.py +4 -2
modutils.py CHANGED
@@ -510,14 +510,16 @@ def get_t2i_model_info(repo_id: str):
510
 
511
  def get_tupled_model_list(model_list):
512
  if not model_list: return []
 
513
  tupled_list = []
514
  for repo_id in model_list:
515
  api = HfApi()
516
  try:
517
  if not api.repo_exists(repo_id): continue
518
- model = api.model_info(repo_id=repo_id)
519
  except Exception as e:
520
- print(e)
 
521
  continue
522
  if model.private or model.gated: continue
523
  tags = model.tags
 
510
 
511
  def get_tupled_model_list(model_list):
512
  if not model_list: return []
513
+ #return [(x, x) for x in model_list] # for skipping this function
514
  tupled_list = []
515
  for repo_id in model_list:
516
  api = HfApi()
517
  try:
518
  if not api.repo_exists(repo_id): continue
519
+ model = api.model_info(repo_id=repo_id, timeout=0.5)
520
  except Exception as e:
521
+ print(f"{repo_id}: {e}")
522
+ tupled_list.append((repo_id, repo_id))
523
  continue
524
  if model.private or model.gated: continue
525
  tags = model.tags