Spaces:
Runtime error
Runtime error
Update summarizer.py
Browse files- summarizer.py +1 -1
summarizer.py
CHANGED
@@ -17,7 +17,7 @@ class BARTSummarizer:
|
|
17 |
|
18 |
def summarize(self, text: str):
|
19 |
encoded_input = self.tokenizer.encode(text, max_length=self.max_length, return_tensors='tf', truncation=True)
|
20 |
-
summary_ids = self.model.generate(encoded_input, max_length=300, num_beams=4, early_stopping=True)
|
21 |
summary = self.tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
22 |
return summary
|
23 |
|
|
|
17 |
|
18 |
def summarize(self, text: str):
|
19 |
encoded_input = self.tokenizer.encode(text, max_length=self.max_length, return_tensors='tf', truncation=True)
|
20 |
+
summary_ids = self.model.generate(encoded_input, max_length=300, num_beams=4, early_stopping=True, min_length=70)
|
21 |
summary = self.tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
22 |
return summary
|
23 |
|