jonghhhh commited on
Commit
c90c7b6
ยท
verified ยท
1 Parent(s): e8f134f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
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
- **์ƒํƒœ**: ChromaDB์— ์ค€๋น„๋œ ๋ฌธ์„œ ์ˆ˜ = {rag_system.collection.count()}
 
 
 
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)