Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,11 +41,15 @@ def summarize_text(text):
|
|
41 |
|
42 |
# Generate summary
|
43 |
summary_ids = model.generate(inputs['input_ids'],
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
49 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
50 |
|
51 |
return summary
|
|
|
41 |
|
42 |
# Generate summary
|
43 |
summary_ids = model.generate(inputs['input_ids'],
|
44 |
+
max_length=47,
|
45 |
+
min_length=8,
|
46 |
+
no_repeat_ngram_size=3,
|
47 |
+
encoder_no_repeat_ngram_size=3,
|
48 |
+
repetition_penalty=3.5,
|
49 |
+
num_beams=4,
|
50 |
+
do_sample=True,
|
51 |
+
early_stopping=False)
|
52 |
+
|
53 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
54 |
|
55 |
return summary
|