momo commited on
Commit
e1e5406
1 Parent(s): a403c19
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -9,17 +9,13 @@ model_name = "momo/rsp-sum"
9
  model = MBartForConditionalGeneration.from_pretrained(model_name)
10
  tokenizer = MBartTokenizer.from_pretrained(model_name, src_lang="ko_KR", tgt_lang="ko_KR")
11
 
12
- # prefix = "translate English to German: "
13
-
14
  summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
15
 
16
- def summarization(News, Summary):
17
  result = summarizer(News, min_length=50, max_length=150)
18
  return result["summary_text"]
19
 
20
  if __name__ == '__main__':
21
-
22
- #Create a gradio app with a button that calls predict()
23
  app = gr.Interface(
24
  fn=summarization,
25
  inputs=gr.inputs.Textbox(lines=10, label="News"),
 
9
  model = MBartForConditionalGeneration.from_pretrained(model_name)
10
  tokenizer = MBartTokenizer.from_pretrained(model_name, src_lang="ko_KR", tgt_lang="ko_KR")
11
 
 
 
12
  summarizer = pipeline("summarization", model=model, tokenizer=tokenizer)
13
 
14
+ def summarization(News):
15
  result = summarizer(News, min_length=50, max_length=150)
16
  return result["summary_text"]
17
 
18
  if __name__ == '__main__':
 
 
19
  app = gr.Interface(
20
  fn=summarization,
21
  inputs=gr.inputs.Textbox(lines=10, label="News"),