Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,10 @@ agent = Agent(model="gemini-2.0-flash", # "gemini-2.0-flash-lite"
|
|
86 |
# ์ฐธ๊ณ ๋ฌธ์ ํ์ฉ:
|
87 |
- ๋ฌธ์ ๋ด์ฉ์ด ์์ผ๋ฉด ๊ตฌ์ฒด์ ์ผ๋ก ์ธ์ฉ
|
88 |
- ์ฌ๋ฌ ๋ฌธ์์ ์ ๋ณด๋ฅผ ์ข
ํฉํ์ฌ ๋ต๋ณ ์์ฑ
|
89 |
-
- ์ ํํ์ง ์์ ์ ๋ณด๋ ์ถ์ธกํ์ง ๋ง๊ณ ์์งํ๊ฒ ๋ชจ๋ฅธ๋ค๊ณ ๋ต๋ณ
|
|
|
|
|
|
|
90 |
)
|
91 |
|
92 |
runner = Runner(agent=agent, app_name="khu_media_chatbot", session_service=session_svc)
|
@@ -115,11 +118,6 @@ with gr.Blocks(title="๊ฒฝํฌ๋ ๋ฏธ๋์ดํ๊ณผ AI ์๋ด์ฌ", theme="soft") as
|
|
115 |
history = history or []
|
116 |
# ์
๋ ฅ ์ ์ฒ๋ฆฌ: ์ค์ฉ ๋ฐฉ์ง
|
117 |
user_input = user_input.replace("์ ๊ณต", "๋ถ์ผ").replace("๊ต์", "๊ต์์ง")
|
118 |
-
# ๊ต์์ง ๊ด๋ จ ์ง๋ฌธ ์ฒ๋ฆฌ
|
119 |
-
#if "๊ต์์ง" in user_input or "๊ต์" in user_input:
|
120 |
-
# prof_msg = f"ํ์ฌ ๋ฏธ๋์ดํ๊ณผ ๊ต์์ง์: {', '.join(PROFESSORS)} ์
๋๋ค."
|
121 |
-
# history.append({"role": "assistant", "content": prof_msg})
|
122 |
-
# return history,
|
123 |
# RAG ์ปจํ
์คํธ
|
124 |
docs = rag_system.search_similar_docs(user_input)
|
125 |
# Combine existing history (dicts) with new user message
|
@@ -137,9 +135,12 @@ with gr.Blocks(title="๊ฒฝํฌ๋ ๋ฏธ๋์ดํ๊ณผ AI ์๋ด์ฌ", theme="soft") as
|
|
137 |
|
138 |
gr.Markdown(f"""
|
139 |
---
|
140 |
-
|
|
|
|
|
|
|
141 |
"""
|
142 |
-
)
|
143 |
|
144 |
if __name__ == "__main__":
|
145 |
app.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT",7860)), share=False, show_api=False)
|
|
|
86 |
# ์ฐธ๊ณ ๋ฌธ์ ํ์ฉ:
|
87 |
- ๋ฌธ์ ๋ด์ฉ์ด ์์ผ๋ฉด ๊ตฌ์ฒด์ ์ผ๋ก ์ธ์ฉ
|
88 |
- ์ฌ๋ฌ ๋ฌธ์์ ์ ๋ณด๋ฅผ ์ข
ํฉํ์ฌ ๋ต๋ณ ์์ฑ
|
89 |
+
- ์ ํํ์ง ์์ ์ ๋ณด๋ ์ถ์ธกํ์ง ๋ง๊ณ ์์งํ๊ฒ ๋ชจ๋ฅธ๋ค๊ณ ๋ต๋ณ
|
90 |
+
|
91 |
+
# ํ์ฌ ๊ฒฝํฌ๋ํ๊ต ๋ฏธ๋์ดํ๊ณผ ๊ต์์ง์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
|
92 |
+
์ด์ธํฌ, ๊นํ์ฉ, ๋ฐ์ข
๋ฏผ, ํ์ง์, ์ด์ ๊ต, ์ด๊ธฐํ, ์ด์ ์, ์กฐ์์, ์ด์ข
ํ, ์ด๋ํฉ, ์ด์์, ์ดํ, ์ต์์ง, ์ต๋ฏผ์, ๊น๊ดํธ"""
|
93 |
)
|
94 |
|
95 |
runner = Runner(agent=agent, app_name="khu_media_chatbot", session_service=session_svc)
|
|
|
118 |
history = history or []
|
119 |
# ์
๋ ฅ ์ ์ฒ๋ฆฌ: ์ค์ฉ ๋ฐฉ์ง
|
120 |
user_input = user_input.replace("์ ๊ณต", "๋ถ์ผ").replace("๊ต์", "๊ต์์ง")
|
|
|
|
|
|
|
|
|
|
|
121 |
# RAG ์ปจํ
์คํธ
|
122 |
docs = rag_system.search_similar_docs(user_input)
|
123 |
# Combine existing history (dicts) with new user message
|
|
|
135 |
|
136 |
gr.Markdown(f"""
|
137 |
---
|
138 |
+
### โ๏ธ ์์คํ
์ ๋ณด
|
139 |
+
**ChromaDB ๋ฌธ์ ์**: {rag_system.collection.count()}๊ฐ
|
140 |
+
**์๋ฒ ๋ฉ ๋ชจ๋ธ**: snunlp/KR-SBERT-V40K-klueNLI-augSTS (ํ๊ตญ์ด ํนํ)
|
141 |
+
**์ธ์ด ๋ชจ๋ธ**: Google Gemini 2.0 Flash (๋ฌด๋ฃ)
|
142 |
"""
|
143 |
+
)
|
144 |
|
145 |
if __name__ == "__main__":
|
146 |
app.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT",7860)), share=False, show_api=False)
|