Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,6 @@
|
|
| 1 |
-
|
| 2 |
-
from transformers import pipeline
|
| 3 |
-
|
| 4 |
-
# Specify the model name
|
| 5 |
model_name = "sshleifer/distilbart-cnn-12-6"
|
| 6 |
-
|
| 7 |
-
# Initialize the summarization pipeline, explicitly loading the model from PyTorch weights
|
| 8 |
-
summarizer = pipeline("summarization", model=model_name, from_pt=True)
|
| 9 |
|
| 10 |
def generate_summary(text):
|
| 11 |
summary_text = summarizer(text, max_length=130, min_length=30, do_sample=False)
|
|
|
|
| 1 |
+
# Initialize the summarization pipeline
|
|
|
|
|
|
|
|
|
|
| 2 |
model_name = "sshleifer/distilbart-cnn-12-6"
|
| 3 |
+
summarizer = pipeline("summarization", model=model_name)
|
|
|
|
|
|
|
| 4 |
|
| 5 |
def generate_summary(text):
|
| 6 |
summary_text = summarizer(text, max_length=130, min_length=30, do_sample=False)
|