fix error traceback

This commit is contained in:
dawoodkhan82 2021-10-26 15:22:03 -04:00
parent c0a146b717
commit 8e9fbbbdfa
2 changed files with 5 additions and 2 deletions

View File

@ -125,6 +125,9 @@ export class GradioInterface extends React.Component {
this.props
.fn(input_state, "predict", this.queueCallback)
.then((output) => {
if (output["error"] != null) {
console.error("Error:", output["error"]);
}
if (!this.pending_response) {
return;
}

View File

@ -182,9 +182,9 @@ def predict():
if app.interface.show_error:
try:
prediction, durations = app.interface.process(raw_input)
except BaseException:
except BaseException as error:
traceback.print_exc()
return jsonify({"error": traceback.format_exc()}), 500
return jsonify({"error": str(error)}), 500
else:
prediction, durations = app.interface.process(raw_input)
avg_durations = []