Cheongwoon commited on
Commit
a653b62
ยท
verified ยท
1 Parent(s): e66e682

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # AI ์š”์•ฝ๊ธฐ ์ƒ์„ฑ
5
+ summarizer = pipeline("summarization", model="mrm8488/t5-base-finetuned-summarize-news")
6
+
7
+ def summarize_text(text):
8
+ result = summarizer(text, max_length=100, min_length=10, do_sample=False)
9
+ return result[0]['summary_text']
10
+
11
+ iface = gr.Interface(
12
+ fn=summarize_text,
13
+ inputs=gr.Textbox(lines=5, placeholder="์š”์•ฝํ•  ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”"),
14
+ outputs="text",
15
+ title="์ฒญ์šด๋‹˜ ์ „์šฉ AI ๋น„์„œ",
16
+ description="๋‰ด์Šค/์ผ์ •/๋ฉ”๋ชจ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์š”์•ฝํ•ด์„œ ์•Œ๋ ค๋“œ๋ฆฝ๋‹ˆ๋‹ค!"
17
+ )
18
+
19
+ iface.launch()