ysharma HF staff commited on
Commit
92ce956
1 Parent(s): adf3a99
Files changed (1) hide show
  1. app.py +2 -1
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"Was there 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,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