app.py
CHANGED
@@ -40,7 +40,7 @@ def poem_generate(word):
|
|
40 |
}}
|
41 |
response = requests.post(API_URL, headers=headers, json=json_)
|
42 |
output = response.json()
|
43 |
-
print(f"
|
44 |
output_tmp = output[0]['generated_text']
|
45 |
print(f"GPTJ response without splits is: {output_tmp}")
|
46 |
#poem = output[0]['generated_text'].split("\n\n")[0] # +"."
|
@@ -53,6 +53,7 @@ def poem_generate(word):
|
|
53 |
poem = output_tmp[:idx]
|
54 |
else:
|
55 |
poem = output_tmp.split("\n\n")[0] # +"."
|
|
|
56 |
print(f"Poem being returned is: {poem}")
|
57 |
return poem
|
58 |
|
|
|
40 |
}}
|
41 |
response = requests.post(API_URL, headers=headers, json=json_)
|
42 |
output = response.json()
|
43 |
+
print(f"If there was an error? Reason is : {output}")
|
44 |
output_tmp = output[0]['generated_text']
|
45 |
print(f"GPTJ response without splits is: {output_tmp}")
|
46 |
#poem = output[0]['generated_text'].split("\n\n")[0] # +"."
|
|
|
53 |
poem = output_tmp[:idx]
|
54 |
else:
|
55 |
poem = output_tmp.split("\n\n")[0] # +"."
|
56 |
+
poem = poem.replace('?','')
|
57 |
print(f"Poem being returned is: {poem}")
|
58 |
return poem
|
59 |
|