Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ input_text=st.text_area("Input the text to summarize","")
|
|
| 28 |
if st.button("Summarize"):
|
| 29 |
st.text("It may take a minute or two.")
|
| 30 |
nwords=len(input_text.split(" "))
|
| 31 |
-
text_input_ids=tokenizer('summarize: '+input_text, max_length=
|
| 32 |
output_ids = model.generate(text_input_ids)
|
| 33 |
generated_summary = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 34 |
|
|
|
|
| 28 |
if st.button("Summarize"):
|
| 29 |
st.text("It may take a minute or two.")
|
| 30 |
nwords=len(input_text.split(" "))
|
| 31 |
+
text_input_ids=tokenizer('summarize: '+input_text, max_length=600, padding="max_length", truncation=True).input_ids
|
| 32 |
output_ids = model.generate(text_input_ids)
|
| 33 |
generated_summary = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 34 |
|