update error handling

This commit is contained in:
wenmeng.zwm
2023-11-08 15:48:09 +08:00
parent 217ab5f790
commit 4937d9af68

View File

@@ -93,7 +93,9 @@ def generate_response(input, model_name):
try:
return model(input)
except RuntimeError as e:
gr.Error(str(e))
# if exception happens, print error in log and return empty str
print(e)
return ''
def on_submit(input, state):