Spaces:
Sleeping
Sleeping
soojeongcrystal
commited on
Commit
β’
9d9c526
1
Parent(s):
7a733b2
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ model = SentenceTransformer('jhgan/ko-sbert-sts')
|
|
14 |
|
15 |
# λλλ°λ₯Έκ³ λ ν°νΈ μ€μ
|
16 |
font_path = "./NanumBarunGothic.ttf"
|
17 |
-
fm.
|
18 |
-
plt.
|
19 |
|
20 |
# μ μ λ³μ
|
21 |
global_recommendations = None
|
@@ -195,7 +195,7 @@ def hybrid_rag(employee_file, program_file, youtube_file, title_col, description
|
|
195 |
# κ²°κ³Ό ν
μ΄λΈ λ°μ΄ν°νλ μ μμ±
|
196 |
result_df = pd.DataFrame(recommendation_rows, columns=["Employee ID", "Employee Name", "Recommended Programs", "Recommended YouTube Content"])
|
197 |
|
198 |
-
return result_df, chart_buffer, gr.File(value=global_csv_string, visible=True
|
199 |
|
200 |
# μ±ν
μλ΅ ν¨μ
|
201 |
def chat_response(message, history):
|
@@ -209,6 +209,11 @@ def chat_response(message, history):
|
|
209 |
|
210 |
return "μ£μ‘ν©λλ€. ν΄λΉ μ§μμ μ 보λ₯Ό μ°Ύμ μ μμ΅λλ€. λ€λ₯Έ μ§μ μ΄λ¦μ μ
λ ₯ν΄μ£ΌμΈμ."
|
211 |
|
|
|
|
|
|
|
|
|
|
|
212 |
# Gradio λΈλ‘
|
213 |
with gr.Blocks(css=".gradio-button {background-color: #007bff; color: white;} .gradio-textbox {border-color: #6c757d;}") as demo:
|
214 |
gr.Markdown("<h1 style='text-align: center; color: #2c3e50;'>πΌ HybridRAG μμ€ν
(μ νλΈ μ½ν
μΈ ν¬ν¨)</h1>")
|
@@ -250,7 +255,7 @@ with gr.Blocks(css=".gradio-button {background-color: #007bff; color: white;} .g
|
|
250 |
)
|
251 |
|
252 |
# CSV λ€μ΄λ‘λ λ²νΌ
|
253 |
-
download_button.click(
|
254 |
|
255 |
# μ±ν
κΈ°λ₯
|
256 |
msg.submit(chat_response, [msg, chatbot], [chatbot])
|
|
|
14 |
|
15 |
# λλλ°λ₯Έκ³ λ ν°νΈ μ€μ
|
16 |
font_path = "./NanumBarunGothic.ttf"
|
17 |
+
font_prop = fm.FontProperties(fname=font_path)
|
18 |
+
plt.rcParams['font.family'] = font_prop.get_name()
|
19 |
|
20 |
# μ μ λ³μ
|
21 |
global_recommendations = None
|
|
|
195 |
# κ²°κ³Ό ν
μ΄λΈ λ°μ΄ν°νλ μ μμ±
|
196 |
result_df = pd.DataFrame(recommendation_rows, columns=["Employee ID", "Employee Name", "Recommended Programs", "Recommended YouTube Content"])
|
197 |
|
198 |
+
return result_df, chart_buffer, gr.File(value=global_csv_string, visible=True), gr.Button.update(visible=True)
|
199 |
|
200 |
# μ±ν
μλ΅ ν¨μ
|
201 |
def chat_response(message, history):
|
|
|
209 |
|
210 |
return "μ£μ‘ν©λλ€. ν΄λΉ μ§μμ μ 보λ₯Ό μ°Ύμ μ μμ΅λλ€. λ€λ₯Έ μ§μ μ΄λ¦μ μ
λ ₯ν΄μ£ΌμΈμ."
|
211 |
|
212 |
+
# CSV λ€μ΄λ‘λ ν¨μ
|
213 |
+
def download_csv():
|
214 |
+
global global_csv_string
|
215 |
+
return gr.File(value=global_csv_string, visible=True)
|
216 |
+
|
217 |
# Gradio λΈλ‘
|
218 |
with gr.Blocks(css=".gradio-button {background-color: #007bff; color: white;} .gradio-textbox {border-color: #6c757d;}") as demo:
|
219 |
gr.Markdown("<h1 style='text-align: center; color: #2c3e50;'>πΌ HybridRAG μμ€ν
(μ νλΈ μ½ν
μΈ ν¬ν¨)</h1>")
|
|
|
255 |
)
|
256 |
|
257 |
# CSV λ€μ΄λ‘λ λ²νΌ
|
258 |
+
download_button.click(download_csv, inputs=[], outputs=[csv_download])
|
259 |
|
260 |
# μ±ν
κΈ°λ₯
|
261 |
msg.submit(chat_response, [msg, chatbot], [chatbot])
|