minko186 commited on
Commit
0fc1c20
·
verified ·
1 Parent(s): db28377

Update ai_generate.py

Browse files
Files changed (1) hide show
  1. ai_generate.py +3 -2
ai_generate.py CHANGED
@@ -29,8 +29,9 @@ def generate(text, model, api):
29
  )
30
 
31
  response = ""
32
- for chunk in completion:
33
- response += chunk.choices[0].delta.content or ""
 
34
  return response
35
  elif model == "OpenAI GPT 3.5":
36
  client = OpenAI(
 
29
  )
30
 
31
  response = ""
32
+ for i, chunk in enumerate(completion):
33
+ if i != 0:
34
+ response += chunk.choices[0].delta.content or ""
35
  return response
36
  elif model == "OpenAI GPT 3.5":
37
  client = OpenAI(