djstrong commited on
Commit
ba83ce7
1 Parent(s): 9ac653b

show gated

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. src/submission/check_validity.py +5 -0
app.py CHANGED
@@ -212,7 +212,7 @@ with demo:
212
  )
213
  with gr.Row():
214
  deleted_models_visibility = gr.Checkbox(
215
- value=True, label="Show gated/private/deleted models", interactive=True
216
  )
217
  with gr.Column(min_width=320):
218
  with gr.Row():
 
212
  )
213
  with gr.Row():
214
  deleted_models_visibility = gr.Checkbox(
215
+ value=True, label="Show private/deleted models", interactive=True
216
  )
217
  with gr.Column(min_width=320):
218
  with gr.Row():
src/submission/check_validity.py CHANGED
@@ -54,6 +54,11 @@ def is_model_on_hub(model_name: str, revision: str, token: str = None, trust_rem
54
  None
55
  )
56
 
 
 
 
 
 
57
  except Exception as e:
58
  return False, "was not found on hub!", None
59
 
 
54
  None
55
  )
56
 
57
+ except OSError as e:
58
+ if "You are trying to access a gated repo." in str(e):
59
+ return True, None, None
60
+ return False, f"raised an OSError: {e}", None
61
+
62
  except Exception as e:
63
  return False, "was not found on hub!", None
64