brian-xetdata commited on
Commit
4196028
1 Parent(s): ae727e3

Skipping api calls if the repo string is invalid

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -6,12 +6,14 @@ from netron import build_netron_iframe, is_netron_file
6
  current_repo = None
7
 
8
  def repo_change(repo: str, oauth_token: str) -> dict[str, any] | None:
9
- print("repo changed")
10
  global current_repo
11
  current_repo = repo
12
 
13
  choices = []
14
 
 
 
 
15
  try:
16
  # get the files from the model repo
17
  info = model_info(repo, token=oauth_token)
 
6
  current_repo = None
7
 
8
  def repo_change(repo: str, oauth_token: str) -> dict[str, any] | None:
 
9
  global current_repo
10
  current_repo = repo
11
 
12
  choices = []
13
 
14
+ if len(repo) == 0 or repo.find("/") == -1:
15
+ return gr.update(choices=choices, value=None, interactive=False)
16
+
17
  try:
18
  # get the files from the model repo
19
  info = model_info(repo, token=oauth_token)