Update app.py
Browse files
app.py
CHANGED
|
@@ -56,11 +56,11 @@ def load_summarization_model(model_dir):
|
|
| 56 |
return None, None
|
| 57 |
|
| 58 |
# ๋ชจ๋ธ ๊ฒฝ๋ก ์ค์ (์ฌ์ฉ์ ํ๊ฒฝ์ ๋ง๊ฒ ๋ณ๊ฒฝ)
|
| 59 |
-
|
| 60 |
-
|
| 61 |
|
| 62 |
-
title_model, title_tokenizer = load_title_model(
|
| 63 |
-
summarizer_model, summarizer_tokenizer = load_summarization_model(
|
| 64 |
|
| 65 |
# ๋ด์ค ๊ธฐ์ฌ ์ ๋ชฉ ์์ฑ ํจ์
|
| 66 |
def generate_title(article_text, max_length=20, num_beams=10, early_stopping=True):
|
|
|
|
| 56 |
return None, None
|
| 57 |
|
| 58 |
# ๋ชจ๋ธ ๊ฒฝ๋ก ์ค์ (์ฌ์ฉ์ ํ๊ฒฝ์ ๋ง๊ฒ ๋ณ๊ฒฝ)
|
| 59 |
+
title_path = 'onebeans/keT5-news-title-gen' # ํ์ธํ๋๋ T5 ์ ๋ชฉ ์์ฑ ๋ชจ๋ธ ๊ฒฝ๋ก
|
| 60 |
+
abs_path = 'onebeans/keT5-news-summarizer' # ๋ด์ค ๊ธฐ์ฌ ์์ฝ ๋ชจ๋ธ ๊ฒฝ๋ก
|
| 61 |
|
| 62 |
+
title_model, title_tokenizer = load_title_model(title_path)
|
| 63 |
+
summarizer_model, summarizer_tokenizer = load_summarization_model(abs_path)
|
| 64 |
|
| 65 |
# ๋ด์ค ๊ธฐ์ฌ ์ ๋ชฉ ์์ฑ ํจ์
|
| 66 |
def generate_title(article_text, max_length=20, num_beams=10, early_stopping=True):
|