hanyullai commited on
Commit
77389b9
1 Parent(s): 8e90038

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,10 +37,10 @@ def predict(text, seed, out_seq_length, min_gen_length, sampling_strategy,
37
  response = requests.request("POST", url, headers=headers, data=payload)
38
 
39
  answer = response.json()['result']['output']['raw']
40
- if type(answer) == list:
41
  answer = answer[0]
42
 
43
- answer = answer.replace('</s>', '')
44
  return answer
45
 
46
 
 
37
  response = requests.request("POST", url, headers=headers, data=payload)
38
 
39
  answer = response.json()['result']['output']['raw']
40
+ if isinstance(answer, list):
41
  answer = answer[0]
42
 
43
+ answer = answer.replace('[</s>]', '')
44
  return answer
45
 
46