momo commited on
Commit
d60334d
1 Parent(s): d3f947f
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -13,9 +13,9 @@ tokenizer = MBartTokenizer.from_pretrained(model_name, src_lang="ko_KR", tgt_lan
13
 
14
  def summarization(News, Summary):
15
  summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
16
- summarizer("An apple a day, keeps the doctor away", min_length=50, max_length=150)
17
 
18
- for result in summarizer(Summary):
19
  print(result)
20
  return result
21
 
@@ -24,8 +24,8 @@ if __name__ == '__main__':
24
  #Create a gradio app with a button that calls predict()
25
  app = gr.Interface(
26
  fn=summarization,
27
- inputs='text',
28
- outputs='text',
29
  title="한국어 뉴스 요약 생성기",
30
  description="Korean News Summary Generator"
31
  )
 
13
 
14
  def summarization(News, Summary):
15
  summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
16
+ summarizer(News, min_length=50, max_length=150)
17
 
18
+ for result in summarizer(News):
19
  print(result)
20
  return result
21
 
 
24
  #Create a gradio app with a button that calls predict()
25
  app = gr.Interface(
26
  fn=summarization,
27
+ inputs=gr.inputs.Textbox(lines=10, label="News"),
28
+ outputs=gr.outputs.Textbox(lines=10, label="Summary"),
29
  title="한국어 뉴스 요약 생성기",
30
  description="Korean News Summary Generator"
31
  )