Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -590,15 +590,37 @@ def show_temperature_graph(data):
|
|
| 590 |
)
|
| 591 |
|
| 592 |
|
| 593 |
-
|
| 594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 595 |
response = client.chat.completions.create(
|
| 596 |
model="hf:Nexusflow/Athene-V2-Chat",
|
| 597 |
messages=[
|
| 598 |
{"role": "system", "content": "๋น์ ์ ๋ ์จ ์๋ณด๊ด์
๋๋ค. ์ฃผ์ด์ง ์๊ฐ๋๋ณ ๋ ์จ ๋ฐ์ดํฐ๋ฅผ ๋ฐํ์ผ๋ก ์ ํํ ๋ ์จ ์๋ณด๋ฅผ ์์ฑํด์ฃผ์ธ์."},
|
| 599 |
-
{"role": "user", "content": f"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600 |
]
|
| 601 |
)
|
|
|
|
| 602 |
st.session_state.weather_forecast = response.choices[0].message.content
|
| 603 |
|
| 604 |
# ์ ์ฅ๋ ๋ ์จ ์๋ณด ํ์
|
|
|
|
| 590 |
)
|
| 591 |
|
| 592 |
|
| 593 |
+
# ํ์ฌ ์๊ฐ๊ณผ ์๋ณด ์๊ฐ ์ ๋ณด ์ถ๊ฐ
|
| 594 |
+
current_time = datetime.utcnow() + timedelta(hours=9)
|
| 595 |
+
current_date_str = current_time.strftime('%Y๋
%m์ %d์ผ')
|
| 596 |
+
tomorrow_date_str = (current_time + timedelta(days=1)).strftime('%Y๋
%m์ %d์ผ')
|
| 597 |
+
|
| 598 |
+
forecast_data_str = "\n".join([
|
| 599 |
+
f"[{f['FCST_DT'][:4]}๋
{f['FCST_DT'][4:6]}์ {f['FCST_DT'][6:8]}์ผ {f['FCST_DT'][8:10]}์] {temp}๋, {description}"
|
| 600 |
+
for f, time, temp, description in zip(valid_forecast_data, times, temps, weather_descriptions)
|
| 601 |
+
])
|
| 602 |
+
|
| 603 |
response = client.chat.completions.create(
|
| 604 |
model="hf:Nexusflow/Athene-V2-Chat",
|
| 605 |
messages=[
|
| 606 |
{"role": "system", "content": "๋น์ ์ ๋ ์จ ์๋ณด๊ด์
๋๋ค. ์ฃผ์ด์ง ์๊ฐ๋๋ณ ๋ ์จ ๋ฐ์ดํฐ๋ฅผ ๋ฐํ์ผ๋ก ์ ํํ ๋ ์จ ์๋ณด๋ฅผ ์์ฑํด์ฃผ์ธ์."},
|
| 607 |
+
{"role": "user", "content": f"""ํ์ฌ ์๊ฐ์ {current_time.strftime('%H์ %M๋ถ')}์
๋๋ค.
|
| 608 |
+
|
| 609 |
+
๋ค์ ์๊ฐ๋๋ณ ๋ ์จ ๋ฐ์ดํฐ๋ฅผ ๋ณด๊ณ ์ค์ ๋ ์จ ์ํฉ์ ๋ง๋ ์ ํํ ๋ ์จ ์๋ณด๋ฅผ 200์์ ์์ฐ์ค๋ฌ์ด ๋ฌธ์ฅ์ผ๋ก ๋ง๋ค์ด์ฃผ์ธ์. ๋น๋ ๋ ์๋ณด๊ฐ ์๋ ๊ฒฝ์ฐ์๋ง ์ฐ์ฐ์ ์ค๋นํ๋๋ก ์๋ดํด์ฃผ์ธ์. ์ท์ฐจ๋ฆผ์ ๋ค์์ ์ฐธ๊ณ ํ์ธ์.
|
| 610 |
+
27ยฐC์ด์: ๋ฐํํฐ, ๋ฐ๋ฐ์ง, ๋ฏผ์๋งค
|
| 611 |
+
23ยฐC~26ยฐC: ์์ ์
์ธ , ๋ฐํํฐ, ๋ฐ๋ฐ์ง, ๋ฉด๋ฐ์ง
|
| 612 |
+
20ยฐC~22ยฐC: ์์ ๊ฐ๋๊ฑด, ๊ธดํํฐ, ๊ธด๋ฐ์ง
|
| 613 |
+
17ยฐC~19ยฐC: ์์ ๋ํธ, ๊ฐ๋๊ฑด, ๋งจํฌ๋งจ, ์์ ์์ผ, ๊ธด๋ฐ์ง
|
| 614 |
+
12ยฐC~16ยฐC: ์์ผ, ๊ฐ๋๊ฑด, ์ผ์, ๋งจํฌ๋งจ, ๋ํธ, ์คํํน, ๊ธด๋ฐ์ง
|
| 615 |
+
9ยฐC~11ยฐC: ํธ๋ ์น์ฝํธ, ์ผ์, ๊ฐ์ฃฝ ์์ผ, ์คํํน, ๊ธด๋ฐ์ง
|
| 616 |
+
5ยฐC~8ยฐC: ์ฝํธ, ํํธํ
, ๋ํธ, ๊ธด๋ฐ์ง
|
| 617 |
+
4ยฐC์ดํ: ํจ๋ฉ, ๋๊บผ์ด ์ฝํธ, ๋ชฉ๋๋ฆฌ, ๊ธฐ๋ชจ์ ํ
|
| 618 |
+
|
| 619 |
+
์๊ฐ๋๋ณ ๋ ์จ ๋ฐ์ดํฐ:
|
| 620 |
+
{forecast_data_str}"""}
|
| 621 |
]
|
| 622 |
)
|
| 623 |
+
|
| 624 |
st.session_state.weather_forecast = response.choices[0].message.content
|
| 625 |
|
| 626 |
# ์ ์ฅ๋ ๋ ์จ ์๋ณด ํ์
|