Bin ZHANG commited on
Commit
e8e594d
1 Parent(s): 2d0afc8
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,10 +1,10 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
- summarizer = pipeline("summarization",model="t5-base",tokenizer="t5-smaller",truncation=True,framework="tf")
4
 
5
  def translate(text):
6
  text = text.replace(""",'"').replace("'","'").replace("&","&")
7
- result = summarizer(text,min_length=180,truncation=True)
8
  return result[0]["summary_text"]
9
 
10
  iface = gr.Interface(fn=translate,
 
1
  from transformers import pipeline
2
  import gradio as gr
3
+ summarizer = pipeline("summarization")
4
 
5
  def translate(text):
6
  text = text.replace(""",'"').replace("'","'").replace("&","&")
7
+ result = summarizer(text,min_length=180,truncation=True,clean_up_tokenization_spaces=True)
8
  return result[0]["summary_text"]
9
 
10
  iface = gr.Interface(fn=translate,