Update app.py
Browse files
app.py
CHANGED
|
@@ -273,20 +273,22 @@ CoT ํ๋กฌํํธ (๋ฉํฐ ์์ด์ ํธ AI ์์คํ
์๋ฎฌ๋ ์ด์
)
|
|
| 273 |
"""
|
| 274 |
|
| 275 |
|
| 276 |
-
def generate_curriculum(learning_objective, learner_characteristics):
|
| 277 |
full_text = ""
|
| 278 |
-
output_area.markdown("## CoT ๊ธฐ๋ฐ ๊ฐ๋ณํ ํ์ต ์ค๊ณ ์๋ฎฌ๋ ์ด์
๊ฒฐ๊ณผ")
|
| 279 |
|
| 280 |
-
|
| 281 |
-
cot_steps =
|
| 282 |
-
cot_steps = cot_steps[1:] # ์ฒซ ๋ฒ์งธ ๋น ๋ฌธ์์ด ์์ ์ ๊ฑฐ
|
| 283 |
|
| 284 |
for step_prompt_part in cot_steps:
|
| 285 |
-
step_number = step_prompt_part[0]
|
| 286 |
-
step_content = "[๋จ๊ณ " + step_prompt_part
|
| 287 |
|
| 288 |
-
# ๋จ๊ณ๋ณ ํ๋กฌํํธ ์ ์ก ๋ฐ ์๋ต ์ฒ๋ฆฌ
|
| 289 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
prompt = [step_content]
|
| 291 |
prompt = "\n".join(prompt)
|
| 292 |
|
|
@@ -294,11 +296,11 @@ def generate_curriculum(learning_objective, learner_characteristics): # learning
|
|
| 294 |
step_output = ""
|
| 295 |
for chunk in response:
|
| 296 |
step_output += chunk.text
|
| 297 |
-
full_text += chunk.text
|
| 298 |
html_text = markdown.markdown(full_text, extensions=['tables', 'fenced_code'])
|
| 299 |
output_area.markdown(html_text, unsafe_allow_html=True)
|
| 300 |
-
time.sleep(0.02)
|
| 301 |
-
full_text += "\n\n"
|
| 302 |
|
| 303 |
except Exception as e:
|
| 304 |
st.error(f"๊ณํ์ ์์ฑ ์ค๋ฅ (๋จ๊ณ {step_number}): {e}")
|
|
|
|
| 273 |
"""
|
| 274 |
|
| 275 |
|
| 276 |
+
def generate_curriculum(learning_objective, learner_characteristics):
|
| 277 |
full_text = ""
|
| 278 |
+
output_area.markdown("## CoT ๊ธฐ๋ฐ ๊ฐ๋ณํ ํ์ต ์ค๊ณ ์๋ฎฌ๋ ์ด์
๊ฒฐ๊ณผ")
|
| 279 |
|
| 280 |
+
cot_steps = SYSTEM_PROMPT.format(learning_objective=learning_objective, learner_characteristics=learner_characteristics).split("[๋จ๊ณ ")
|
| 281 |
+
cot_steps = cot_steps[1:]
|
|
|
|
| 282 |
|
| 283 |
for step_prompt_part in cot_steps:
|
| 284 |
+
step_number = step_prompt_part[0]
|
| 285 |
+
step_content = "[๋จ๊ณ " + step_prompt_part
|
| 286 |
|
|
|
|
| 287 |
try:
|
| 288 |
+
# **[์์ ] ํ๋กฌํํธ ๋ด์ฉ ์ถ๋ ฅ (๋๋ฒ๊น
์ฉ)**
|
| 289 |
+
print(f"\n--- ๋จ๊ณ {step_number} ํ๋กฌํํธ ---")
|
| 290 |
+
print(step_content)
|
| 291 |
+
|
| 292 |
prompt = [step_content]
|
| 293 |
prompt = "\n".join(prompt)
|
| 294 |
|
|
|
|
| 296 |
step_output = ""
|
| 297 |
for chunk in response:
|
| 298 |
step_output += chunk.text
|
| 299 |
+
full_text += chunk.text
|
| 300 |
html_text = markdown.markdown(full_text, extensions=['tables', 'fenced_code'])
|
| 301 |
output_area.markdown(html_text, unsafe_allow_html=True)
|
| 302 |
+
time.sleep(0.02)
|
| 303 |
+
full_text += "\n\n"
|
| 304 |
|
| 305 |
except Exception as e:
|
| 306 |
st.error(f"๊ณํ์ ์์ฑ ์ค๋ฅ (๋จ๊ณ {step_number}): {e}")
|