Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -834,18 +834,19 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 834 |
try:
|
| 835 |
self.returncode = run_autoforge_process(self.cmd, self.log_path)
|
| 836 |
except Exception as e:
|
|
|
|
|
|
|
| 837 |
self.exc = e
|
| 838 |
capture_exception(e) # still goes to Sentry
|
| 839 |
-
|
| 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
|
| 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
|
|
@@ -882,7 +883,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 882 |
worker.join() # make sure it’s done
|
| 883 |
except RuntimeError as e:
|
| 884 |
# Show toast to user
|
| 885 |
-
log_output +=
|
| 886 |
gr.Error(str(e)) # <-- this is the toast
|
| 887 |
capture_exception(e)
|
| 888 |
return create_empty_error_outputs(str(e))
|
|
|
|
| 834 |
try:
|
| 835 |
self.returncode = run_autoforge_process(self.cmd, self.log_path)
|
| 836 |
except Exception as e:
|
| 837 |
+
import traceback
|
| 838 |
+
exc_str = repr(e)
|
| 839 |
self.exc = e
|
| 840 |
capture_exception(e) # still goes to Sentry
|
| 841 |
+
|
|
|
|
| 842 |
# make the error visible in the UI console
|
| 843 |
with open(self.log_path, "a", encoding="utf-8") as lf:
|
| 844 |
lf.write(
|
| 845 |
+
"\nERROR: {}. This usually means that you, your IP adress or the space has no free GPU "
|
| 846 |
"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)
|
| 847 |
)
|
| 848 |
gr.Error(
|
| 849 |
+
"ERROR: {}. This usually means that you, your IP adress or the the space has no free GPU "
|
| 850 |
"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)
|
| 851 |
)
|
| 852 |
# a non-zero code tells the outer loop something went wrong
|
|
|
|
| 883 |
worker.join() # make sure it’s done
|
| 884 |
except RuntimeError as e:
|
| 885 |
# Show toast to user
|
| 886 |
+
log_output += repr(e)
|
| 887 |
gr.Error(str(e)) # <-- this is the toast
|
| 888 |
capture_exception(e)
|
| 889 |
return create_empty_error_outputs(str(e))
|