Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
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__":
|