Update app.py
Browse files
app.py
CHANGED
@@ -44,8 +44,11 @@ def summarize_text(text):
|
|
44 |
do_sample=False,
|
45 |
early_stopping=True)
|
46 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
|
|
47 |
if '.' in summary:
|
48 |
-
|
|
|
|
|
49 |
|
50 |
return summary
|
51 |
|
|
|
44 |
do_sample=False,
|
45 |
early_stopping=True)
|
46 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
47 |
+
```python
|
48 |
if '.' in summary:
|
49 |
+
index = summary.rindex('.')
|
50 |
+
if index != -1:
|
51 |
+
summary = summary[:index+1]
|
52 |
|
53 |
return summary
|
54 |
|