Update app.py
Browse files
app.py
CHANGED
@@ -32,15 +32,15 @@ def summarize_text(text):
|
|
32 |
|
33 |
# Tokenize abstract
|
34 |
inputs = tokenizer(abstract,
|
35 |
-
#max_length=
|
36 |
return_tensors="pt",
|
37 |
truncation=True)
|
38 |
|
39 |
# Generate summary
|
40 |
summary_ids = model.generate(inputs['input_ids'],
|
41 |
#num_beams=3,
|
42 |
-
max_length=
|
43 |
-
min_length=
|
44 |
do_sample=False,
|
45 |
early_stopping=True)
|
46 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
|
|
32 |
|
33 |
# Tokenize abstract
|
34 |
inputs = tokenizer(abstract,
|
35 |
+
#max_length=512,
|
36 |
return_tensors="pt",
|
37 |
truncation=True)
|
38 |
|
39 |
# Generate summary
|
40 |
summary_ids = model.generate(inputs['input_ids'],
|
41 |
#num_beams=3,
|
42 |
+
max_length=24,
|
43 |
+
min_length=21,
|
44 |
do_sample=False,
|
45 |
early_stopping=True)
|
46 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|