seawolf2357 commited on
Commit
f1e3e80
·
verified ·
1 Parent(s): 319eef9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -79,14 +79,16 @@ async def generate_response(message):
79
  for part in response:
80
  logging.debug(f'Part received from stream: {part}')
81
  if part.choices and part.choices[0].delta and part.choices[0].delta.content:
82
- corrected_content = part.choices[0].delta.content.rstrip("\n") # JSON 파싱 오류 수정
 
83
  full_response.append(corrected_content)
84
 
85
  full_response_text = ''.join(full_response)
86
  logging.debug(f'Full model response: {full_response_text}')
87
 
88
  conversation_history.append({"role": "assistant", "content": full_response_text})
89
- return f"{user_mention}, {full_response_text}"
 
90
 
91
 
92
  if __name__ == "__main__":
 
79
  for part in response:
80
  logging.debug(f'Part received from stream: {part}')
81
  if part.choices and part.choices[0].delta and part.choices[0].delta.content:
82
+ # JSON 파싱 오류 수정
83
+ corrected_content = part.choices[0].delta.content.rstrip("\n")
84
  full_response.append(corrected_content)
85
 
86
  full_response_text = ''.join(full_response)
87
  logging.debug(f'Full model response: {full_response_text}')
88
 
89
  conversation_history.append({"role": "assistant", "content": full_response_text})
90
+ return f"{user_menton}, {full_response_text}"
91
+
92
 
93
 
94
  if __name__ == "__main__":