Spaces:
Paused
Paused
Update app.py
Browse files
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 |
-
|
|
|
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"{
|
|
|
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__":
|