MK-316 commited on
Commit
374e2fd
·
verified ·
1 Parent(s): d4cd144

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -1,11 +1,6 @@
1
- import gradio as gr
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)