zetavg commited on
Commit
d019027
1 Parent(s): f361376

better error message

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -120,5 +120,10 @@ def read_yaml_config():
120
 
121
  if __name__ == "__main__":
122
  fire.Fire(main)
123
- elif __name__ == "app": # app is run by `gradio`
124
- main() # does not support command line args, must use config.yaml
 
 
 
 
 
 
120
 
121
  if __name__ == "__main__":
122
  fire.Fire(main)
123
+ elif __name__ == "app": # running in gradio reload mode (`gradio`)
124
+ try:
125
+ main()
126
+ except AssertionError as e:
127
+ message = str(e)
128
+ message += "\nNote that command line args are not supported while running in gradio reload mode, config.yaml must be used."
129
+ raise AssertionError(message) from e