test
Browse files
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(
|
17 |
|
18 |
-
for result in summarizer(
|
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=
|
28 |
-
outputs=
|
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 |
)
|