Spaces:
Build error
Build error
Create app.py
Browse files
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()
|