Sengxian commited on
Commit
e1ccc3f
1 Parent(s): 7d77191

Add error msg display for API

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -45,7 +45,7 @@ def predict(text, seed, out_seq_length, min_gen_length, sampling_strategy,
45
  return 'Timeout! Please wait a few minutes and retry'
46
 
47
  if response['status'] == 1:
48
- return 'Please give smaller text than max_tokens or give larger max_tokens.'
49
 
50
  answer = response['result']['output']['raw']
51
  if isinstance(answer, list):
 
45
  return 'Timeout! Please wait a few minutes and retry'
46
 
47
  if response['status'] == 1:
48
+ return response['result']['errmsg']
49
 
50
  answer = response['result']['output']['raw']
51
  if isinstance(answer, list):