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