hanyullai commited on
Commit
8e90038
1 Parent(s): 31db190

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -35,8 +35,13 @@ def predict(text, seed, out_seq_length, min_gen_length, sampling_strategy,
35
  }
36
 
37
  response = requests.request("POST", url, headers=headers, data=payload)
38
-
39
- return response.json()
 
 
 
 
 
40
 
41
 
42
  if __name__ == "__main__":
 
35
  }
36
 
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
 
47
  if __name__ == "__main__":