beam
Browse files
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 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|