hvoss-techfak commited on
Commit
a3dae77
·
verified ·
1 Parent(s): 004f770

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -836,15 +836,17 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
836
  except Exception as e:
837
  self.exc = e
838
  capture_exception(e) # still goes to Sentry
 
 
839
  # make the error visible in the UI console
840
  with open(self.log_path, "a", encoding="utf-8") as lf:
841
  lf.write(
842
  "\nERROR: {}. This usually means that you or the space has no free GPU "
843
- "minutes left, or the process took too long due to too many filaments or changed parameters. Please clone the docker container, run it locally or wait for a bit.\n".format(str(e))
844
  )
845
  gr.Error(
846
  "ERROR: {}. This usually means that you ore the the space has no free GPU "
847
- "minutes left, or the process took too long due to too many filaments or changed parameters. Please clone the docker container, run it locally or wait for a bit.\n".format(str(e))
848
  )
849
  # a non-zero code tells the outer loop something went wrong
850
  self.returncode = -1
 
836
  except Exception as e:
837
  self.exc = e
838
  capture_exception(e) # still goes to Sentry
839
+ import traceback
840
+ exc_str = "".join(traceback.format_exception_only(e)).strip()
841
  # make the error visible in the UI console
842
  with open(self.log_path, "a", encoding="utf-8") as lf:
843
  lf.write(
844
  "\nERROR: {}. This usually means that you or the space has no free GPU "
845
+ "minutes left, or the process took too long due to too many filaments or changed parameters. Please clone the docker container, run it locally or wait for a bit.\n".format(exc_str)
846
  )
847
  gr.Error(
848
  "ERROR: {}. This usually means that you ore the the space has no free GPU "
849
+ "minutes left, or the process took too long due to too many filaments or changed parameters. Please clone the docker container, run it locally or wait for a bit.\n".format(exc_str)
850
  )
851
  # a non-zero code tells the outer loop something went wrong
852
  self.returncode = -1