Spaces:
Runtime error
Runtime error
gabrielwithhappy
commited on
Commit
•
7c0ba16
1
Parent(s):
a2a8970
update config
Browse files
app.py
CHANGED
@@ -18,6 +18,10 @@ def get_summary(input_text):
|
|
18 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
19 |
summary_text_ids = summary_model.generate(
|
20 |
input_ids=input_ids,
|
|
|
|
|
|
|
|
|
21 |
)
|
22 |
return tokenizer.decode(summary_text_ids[0], skip_special_tokens=True)
|
23 |
|
|
|
18 |
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
19 |
summary_text_ids = summary_model.generate(
|
20 |
input_ids=input_ids,
|
21 |
+
length_penalty=2.0,
|
22 |
+
max_length=1000,
|
23 |
+
min_length=56,
|
24 |
+
num_beams=2,
|
25 |
)
|
26 |
return tokenizer.decode(summary_text_ids[0], skip_special_tokens=True)
|
27 |
|