aus10powell commited on
Commit
8feb899
1 Parent(s): 34c013e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -198,15 +198,16 @@ async def generate_text(request: Request):
198
  ###################################################
199
  ## Clean up generate text
200
  # Get rid of final sentence
201
- sentences = nltk.sent_tokenize(generated_text)
202
- unique_sentences = set()
203
- non_duplicate_sentences = []
204
- for sentence in sentences:
205
- if sentence not in unique_sentences:
206
- non_duplicate_sentences.append(sentence)
207
- unique_sentences.add(sentence)
208
- final_text = " ".join(non_duplicate_sentences[:-1])
209
-
 
210
  return {"generated_text": final_text}
211
 
212
 
 
198
  ###################################################
199
  ## Clean up generate text
200
  # Get rid of final sentence
201
+ # sentences = nltk.sent_tokenize(generated_text)
202
+ # unique_sentences = set()
203
+ # non_duplicate_sentences = []
204
+ # for sentence in sentences:
205
+ # if sentence not in unique_sentences:
206
+ # non_duplicate_sentences.append(sentence)
207
+ # unique_sentences.add(sentence)
208
+ # final_text = " ".join(non_duplicate_sentences[:-1])
209
+
210
+ final_text= generated_text
211
  return {"generated_text": final_text}
212
 
213