Spaces:
Runtime error
Runtime error
Commit ·
dcdb693
1
Parent(s): 3b8218a
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ if st.button("Generate Summary"):
|
|
| 17 |
if input_text.strip() != "":
|
| 18 |
# Generate summary using the model
|
| 19 |
inputs = tokenizer(input_text, return_tensors="pt", max_length=1024, truncation=True)
|
| 20 |
-
summary_ids = model.generate(inputs["input_ids"], max_length=
|
| 21 |
generated_summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 22 |
|
| 23 |
# Display generated summary
|
|
|
|
| 17 |
if input_text.strip() != "":
|
| 18 |
# Generate summary using the model
|
| 19 |
inputs = tokenizer(input_text, return_tensors="pt", max_length=1024, truncation=True)
|
| 20 |
+
summary_ids = model.generate(inputs["input_ids"], max_length=350, min_length=40, length_penalty=2.0, num_beams=4, early_stopping=True)
|
| 21 |
generated_summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 22 |
|
| 23 |
# Display generated summary
|