abdulsamad commited on
Commit
d946acc
·
verified ·
1 Parent(s): 90500b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -3,16 +3,15 @@ import torch
3
  import gradio as gr
4
 
5
  summarizer = pipeline(task="summarization",
6
- model="./models/facebook/bart-large-cnn",
7
  torch_dtype=torch.bfloat16)
8
 
9
 
10
 
11
  # name of the function
12
  def summary(text):
13
- return summarizer(text,
14
- min_length=10,
15
- max_length=100)
16
 
17
 
18
  demo = gr.Interface(fn=summary, inputs="text", outputs="text")
 
3
  import gradio as gr
4
 
5
  summarizer = pipeline(task="summarization",
6
+ model="facebook/bart-large-cnn",
7
  torch_dtype=torch.bfloat16)
8
 
9
 
10
 
11
  # name of the function
12
  def summary(text):
13
+ summary = summarizer(text,min_length=10,max_length=100)
14
+ return summary
 
15
 
16
 
17
  demo = gr.Interface(fn=summary, inputs="text", outputs="text")