Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,15 +33,14 @@ with col2:
|
|
| 33 |
with col1:
|
| 34 |
prompt= st.text_area('Your prompt here',
|
| 35 |
'''AI will help humanity?''')
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# answer = ['ciao come stai stutto bene']
|
| 38 |
# lst = ''.join(answer)
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
t = st.empty()
|
| 45 |
-
for i in range(len(lst)):
|
| 46 |
-
t.markdown(" %s..." % lst[0:i])
|
| 47 |
-
time.sleep(0.04)
|
|
|
|
| 33 |
with col1:
|
| 34 |
prompt= st.text_area('Your prompt here',
|
| 35 |
'''AI will help humanity?''')
|
| 36 |
+
|
| 37 |
+
answer = generator(prompt, max_length=60, no_repeat_ngram_size=2, early_stopping=True, num_beams=5)
|
| 38 |
+
lst = answer[0]['generated_text']
|
| 39 |
|
| 40 |
# answer = ['ciao come stai stutto bene']
|
| 41 |
# lst = ''.join(answer)
|
| 42 |
+
|
| 43 |
+
t = st.empty()
|
| 44 |
+
for i in range(len(lst)):
|
| 45 |
+
t.markdown(" %s..." % lst[0:i])
|
| 46 |
+
time.sleep(0.04)
|
|
|
|
|
|
|
|
|
|
|
|