malper commited on
Commit
b25958e
1 Parent(s): 8932fdb
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -19,6 +19,14 @@ text = st.text_area('Enter text and press ctrl/command+enter:')
19
  if text:
20
 
21
  words = [normalize(x) for x in text.split()]
22
- outputs = pipe(words, max_length=200)
23
- output_text = ' '.join([x['generated_text'] for x in outputs])
24
- st.write(output_text)
 
 
 
 
 
 
 
 
 
19
  if text:
20
 
21
  words = [normalize(x) for x in text.split()]
22
+ outputs = pipe(words, max_length=200, num_beams=5, num_return_sequences=5)
23
+
24
+ texts = [
25
+ ' '.join(x['generated_text'] for x in option)
26
+ for option in zip(*outputs)
27
+ ]
28
+
29
+ st.write(texts[0])
30
+ st.write('Other options:')
31
+ for option in texts[1:]:
32
+ st.write(option)