Update app.py
Browse files
app.py
CHANGED
@@ -24,9 +24,9 @@ st.markdown(
|
|
24 |
unsafe_allow_html=True
|
25 |
)
|
26 |
|
27 |
-
# matplotlib ํ๊ธ ํฐํธ ์ค์
|
28 |
import matplotlib
|
29 |
-
matplotlib.rcParams['font.family'] = '
|
30 |
matplotlib.rcParams['axes.unicode_minus'] = False # ๋ง์ด๋์ค ๊ธฐํธ ๊นจ์ง ๋ฐฉ์ง
|
31 |
|
32 |
# ๋ค์ด๋ฒ ๋ด์ค API๋ฅผ ํตํด ์ค์ ๋ด์ค ๊ธฐ์ฌ ๊ฐ์ ธ์ค๊ธฐ
|
@@ -65,7 +65,7 @@ def generate_article_gpt4(prompt):
|
|
65 |
# GPT-4 ๋ชจ๋ธ์ ์ด์ฉํด ๋ฐ๋ ๊ด์ ๊ธฐ์ฌ๋ฅผ ์์ฑ
|
66 |
response = openai.ChatCompletion.create(
|
67 |
model="gpt-4", # GPT-4 ๋ชจ๋ธ์ ์ฌ์ฉ
|
68 |
-
messages=[
|
69 |
{"role": "system", "content": "You are a helpful assistant that generates articles."},
|
70 |
{"role": "user", "content": prompt} # ์ฌ์ฉ์๊ฐ ์ ๊ณตํ ํ๋กฌํํธ
|
71 |
],
|
@@ -167,8 +167,4 @@ if st.button("๐ ๋ถ์ ์์"):
|
|
167 |
st.write(f"#### {result['์ ๋ชฉ']}")
|
168 |
st.write(f"- **์๋ณธ ๊ธฐ์ฌ**: {result['์๋ณธ ๊ธฐ์ฌ']}")
|
169 |
st.write(f"- **์ฑํฅ**: {result['์ฑํฅ']} (์ ์: {result['์ฑํฅ ์ ์']:.2f})")
|
170 |
-
st.write(f"- **๋์กฐ ๊ด์ ๊ธฐ์ฌ**: {result['๋์กฐ
|
171 |
-
st.write(f"- **๋ด์ค ๋งํฌ**: [๋งํฌ]({result['๋ด์ค ๋งํฌ']})") # ๋งํฌ ์ถ๋ ฅ
|
172 |
-
st.write("---")
|
173 |
-
else:
|
174 |
-
st.error("๋ถ์๋ ๋ด์ค ๋ฐ์ดํฐ๊ฐ ์์ต๋๋ค.")
|
|
|
24 |
unsafe_allow_html=True
|
25 |
)
|
26 |
|
27 |
+
# matplotlib ํ๊ธ ํฐํธ ์ค์ (๋ค๋ฅธ ํฐํธ๋ฅผ ์๋)
|
28 |
import matplotlib
|
29 |
+
matplotlib.rcParams['font.family'] = 'Malgun Gothic' # ํ๊ธ ํฐํธ๋ฅผ ์ค์ ํฉ๋๋ค.
|
30 |
matplotlib.rcParams['axes.unicode_minus'] = False # ๋ง์ด๋์ค ๊ธฐํธ ๊นจ์ง ๋ฐฉ์ง
|
31 |
|
32 |
# ๋ค์ด๋ฒ ๋ด์ค API๋ฅผ ํตํด ์ค์ ๋ด์ค ๊ธฐ์ฌ ๊ฐ์ ธ์ค๊ธฐ
|
|
|
65 |
# GPT-4 ๋ชจ๋ธ์ ์ด์ฉํด ๋ฐ๋ ๊ด์ ๊ธฐ์ฌ๋ฅผ ์์ฑ
|
66 |
response = openai.ChatCompletion.create(
|
67 |
model="gpt-4", # GPT-4 ๋ชจ๋ธ์ ์ฌ์ฉ
|
68 |
+
messages=[
|
69 |
{"role": "system", "content": "You are a helpful assistant that generates articles."},
|
70 |
{"role": "user", "content": prompt} # ์ฌ์ฉ์๊ฐ ์ ๊ณตํ ํ๋กฌํํธ
|
71 |
],
|
|
|
167 |
st.write(f"#### {result['์ ๋ชฉ']}")
|
168 |
st.write(f"- **์๋ณธ ๊ธฐ์ฌ**: {result['์๋ณธ ๊ธฐ์ฌ']}")
|
169 |
st.write(f"- **์ฑํฅ**: {result['์ฑํฅ']} (์ ์: {result['์ฑํฅ ์ ์']:.2f})")
|
170 |
+
st.write(f"- **๋์กฐ ๊ด์ ๊ธฐ์ฌ**: {result['๋์กฐ
|
|
|
|
|
|
|
|