idolezal commited on
Commit
d989cb4
β€’
1 Parent(s): 3efe661

Recovery from exception

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -59,7 +59,7 @@ def process_submission(*inputs):
59
  metadata = SUBMISSION_INPUTS - {"submission_file"}
60
  metadata = {key: inputs[key] for key in metadata}
61
 
62
- gr.Info('Submission valid, running local tournament...')
63
 
64
  leaderboard_server.prepare_model_for_submission(inputs["submission_file"], metadata)
65
  except ValueError as err:
@@ -72,6 +72,16 @@ def process_submission(*inputs):
72
  gr.update(visible=False),
73
  gr.update(visible=False),
74
  )
 
 
 
 
 
 
 
 
 
 
75
  return (
76
  gr.update(visible=False),
77
  gr.update(visible=True),
 
59
  metadata = SUBMISSION_INPUTS - {"submission_file"}
60
  metadata = {key: inputs[key] for key in metadata}
61
 
62
+ gr.Info('Submission valid, running tournament...')
63
 
64
  leaderboard_server.prepare_model_for_submission(inputs["submission_file"], metadata)
65
  except ValueError as err:
 
72
  gr.update(visible=False),
73
  gr.update(visible=False),
74
  )
75
+ except TypeError as err:
76
+ gr.Warning(str(err))
77
+ return (
78
+ gr.update(value='Pre-submit model', visible=True, interactive=True),
79
+ gr.update(visible=False),
80
+ gr.update(visible=False),
81
+ gr.update(visible=False),
82
+ gr.update(visible=False),
83
+ gr.update(visible=False),
84
+ )
85
  return (
86
  gr.update(visible=False),
87
  gr.update(visible=True),