mirror of
https://github.com/modelscope/modelscope.git
synced 2026-02-25 04:30:48 +01:00
update error handling
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user