Antonio Cheong commited on
Commit
03fc3e5
·
1 Parent(s): b02a94a

ensure connection closed to prevent broken pipe

Browse files
Files changed (1) hide show
  1. src/EdgeGPT.py +1 -0
src/EdgeGPT.py CHANGED
@@ -241,6 +241,7 @@ class Chatbot:
241
  async for final, response in self.chat_hub.ask_stream(prompt=prompt):
242
  if final:
243
  return response
 
244
 
245
  async def ask_stream(self, prompt: str) -> Generator[str, None, None]:
246
  """
 
241
  async for final, response in self.chat_hub.ask_stream(prompt=prompt):
242
  if final:
243
  return response
244
+ self.chat_hub.wss.close()
245
 
246
  async def ask_stream(self, prompt: str) -> Generator[str, None, None]:
247
  """