Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,14 +35,14 @@ def summarize_text(text):
|
|
35 |
|
36 |
# Tokenize abstract
|
37 |
inputs = tokenizer(abstract,
|
38 |
-
max_length=
|
39 |
return_tensors="pt",
|
40 |
truncation=True)
|
41 |
|
42 |
# Generate summary
|
43 |
summary_ids = model.generate(inputs['input_ids'],
|
44 |
-
max_length=
|
45 |
-
min_length=
|
46 |
no_repeat_ngram_size=3,
|
47 |
encoder_no_repeat_ngram_size=3,
|
48 |
repetition_penalty=3.5,
|
|
|
35 |
|
36 |
# Tokenize abstract
|
37 |
inputs = tokenizer(abstract,
|
38 |
+
max_length=1024,
|
39 |
return_tensors="pt",
|
40 |
truncation=True)
|
41 |
|
42 |
# Generate summary
|
43 |
summary_ids = model.generate(inputs['input_ids'],
|
44 |
+
max_length=50,
|
45 |
+
min_length=30,
|
46 |
no_repeat_ngram_size=3,
|
47 |
encoder_no_repeat_ngram_size=3,
|
48 |
repetition_penalty=3.5,
|