kenken999 commited on
Commit
c01b822
β€’
1 Parent(s): 1390d11
Files changed (1) hide show
  1. mysite/interpreter/interpreter.py +2 -2
mysite/interpreter/interpreter.py CHANGED
@@ -75,7 +75,7 @@ async def completion(message: str, history, c=None, d=None, prompt="あγͺたは
75
  messages.insert(0, system_prompt)
76
  async with async_timeout.timeout(GENERATION_TIMEOUT_SEC):
77
  try:
78
- stream = client.chat.completions.create(
79
  model="llama3-8b-8192",
80
  messages=messages,
81
  temperature=1,
@@ -85,7 +85,7 @@ async def completion(message: str, history, c=None, d=None, prompt="あγͺたは
85
  stop=None,
86
  )
87
  all_result = ""
88
- async for chunk in stream:
89
  current_content = chunk.choices[0].delta.content or ""
90
  all_result += current_content
91
  yield current_content
 
75
  messages.insert(0, system_prompt)
76
  async with async_timeout.timeout(GENERATION_TIMEOUT_SEC):
77
  try:
78
+ stream = await client.chat.completions.create(
79
  model="llama3-8b-8192",
80
  messages=messages,
81
  temperature=1,
 
85
  stop=None,
86
  )
87
  all_result = ""
88
+ for chunk in stream:
89
  current_content = chunk.choices[0].delta.content or ""
90
  all_result += current_content
91
  yield current_content