ll7098ll commited on
Commit
165679f
·
verified ·
1 Parent(s): 25fc9ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import google.generativeai as genai
3
  import gradio as gr
4
  import time
 
5
 
6
  genai.configure(api_key=os.environ["GEMINI_API_KEY"])
7
 
@@ -57,7 +58,7 @@ async def generate_curriculum(prompt):
57
  for chunk in response:
58
  full_text += chunk.text
59
  yield full_text
60
- await gr.sleep(0.05) # 비동기적으로 지연 추가
61
  except Exception as e:
62
  yield f"에러 발생: {str(e)}"
63
 
 
2
  import google.generativeai as genai
3
  import gradio as gr
4
  import time
5
+ import asyncio # asyncio 라이브러리 임포트
6
 
7
  genai.configure(api_key=os.environ["GEMINI_API_KEY"])
8
 
 
58
  for chunk in response:
59
  full_text += chunk.text
60
  yield full_text
61
+ await asyncio.sleep(0.05) # asyncio.sleep() 사용
62
  except Exception as e:
63
  yield f"에러 발생: {str(e)}"
64