Update app.py
Browse files
app.py
CHANGED
|
@@ -48,9 +48,17 @@ def generate_school_plan(subject_name, integrated_subjects, grade, semester, hou
|
|
| 48 |
]
|
| 49 |
)
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
iface = gr.Interface(
|
| 56 |
fn=generate_school_plan,
|
|
|
|
| 48 |
]
|
| 49 |
)
|
| 50 |
|
| 51 |
+
full_text = ""
|
| 52 |
+
yield full_text # 초기 빈 텍스트 출력
|
| 53 |
+
|
| 54 |
+
try:
|
| 55 |
+
response = model.generate_content(prompt_parts, stream=True)
|
| 56 |
+
for chunk in response:
|
| 57 |
+
full_text += chunk.text
|
| 58 |
+
yield full_text
|
| 59 |
+
time.sleep(0.05) # 약간의 지연 추가
|
| 60 |
+
except Exception as e:
|
| 61 |
+
yield f"에러 발생: {str(e)}"
|
| 62 |
|
| 63 |
iface = gr.Interface(
|
| 64 |
fn=generate_school_plan,
|