Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,9 +4,14 @@ from collections import Counter
|
|
| 4 |
import matplotlib.pyplot as plt
|
| 5 |
import re
|
| 6 |
import matplotlib.font_manager as fm
|
|
|
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
fontprop = fm.FontProperties(fname=font_path)
|
| 11 |
plt.rc('font', family=fontprop.get_name())
|
| 12 |
|
|
|
|
| 4 |
import matplotlib.pyplot as plt
|
| 5 |
import re
|
| 6 |
import matplotlib.font_manager as fm
|
| 7 |
+
import urllib.request
|
| 8 |
|
| 9 |
+
# Hugging Face Space에서 폰트 다운로드
|
| 10 |
+
font_url = "https://huggingface.co/spaces/SG34/Keyword_Analyzer/resolve/main/NotoSansKR-Medium.ttf"
|
| 11 |
+
font_path = "/tmp/NotoSansKR-Medium.ttf"
|
| 12 |
+
urllib.request.urlretrieve(font_url, font_path)
|
| 13 |
+
|
| 14 |
+
# 다운로드한 폰트를 matplotlib에 설정
|
| 15 |
fontprop = fm.FontProperties(fname=font_path)
|
| 16 |
plt.rc('font', family=fontprop.get_name())
|
| 17 |
|