Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -196,11 +196,11 @@ try:
|
|
| 196 |
spacy.cli.download("en_core_web_sm")
|
| 197 |
nlp = spacy.load("en_core_web_sm")
|
| 198 |
print("✅ Loading NLP models...")
|
| 199 |
-
|
| 200 |
summarizer = pipeline(
|
| 201 |
"summarization",
|
| 202 |
-
model="
|
| 203 |
-
tokenizer=
|
| 204 |
device=0 if torch.cuda.is_available() else -1
|
| 205 |
)
|
| 206 |
# Optionally convert summarizer model to FP16 for faster inference on GPU
|
|
|
|
| 196 |
spacy.cli.download("en_core_web_sm")
|
| 197 |
nlp = spacy.load("en_core_web_sm")
|
| 198 |
print("✅ Loading NLP models...")
|
| 199 |
+
# Use Facebook's bart-large-cnn for summarization
|
| 200 |
summarizer = pipeline(
|
| 201 |
"summarization",
|
| 202 |
+
model="facebook/bart-large-cnn",
|
| 203 |
+
tokenizer="facebook/bart-large-cnn",
|
| 204 |
device=0 if torch.cuda.is_available() else -1
|
| 205 |
)
|
| 206 |
# Optionally convert summarizer model to FP16 for faster inference on GPU
|