Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ model = EncoderDecoderModel.from_pretrained(model_ckpt, config=config)
|
|
15 |
text = st.text('Enter an article to summarize:')
|
16 |
|
17 |
if text:
|
18 |
-
input_ids = tokenizer.encode(
|
19 |
summary_ids = model.generate(input_ids,
|
20 |
min_length=40,
|
21 |
max_length=200,
|
|
|
15 |
text = st.text('Enter an article to summarize:')
|
16 |
|
17 |
if text:
|
18 |
+
input_ids = tokenizer.encode(text, return_tensors='pt', padding=True, truncation=True, max_length=512)
|
19 |
summary_ids = model.generate(input_ids,
|
20 |
min_length=40,
|
21 |
max_length=200,
|