tejash300 commited on
Commit
14e121b
·
verified ·
1 Parent(s): 57ab60a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- from transformers import PegasusTokenizer
200
  summarizer = pipeline(
201
  "summarization",
202
- model="nsi319/legal-pegasus",
203
- tokenizer=PegasusTokenizer.from_pretrained("nsi319/legal-pegasus", use_fast=False),
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