From 00a3b91f959f6b36ad26f0ffda0a2ba1f4397b40 Mon Sep 17 00:00:00 2001 From: fenglui Date: Fri, 21 Jul 2023 03:51:33 +0800 Subject: [PATCH] fix msg.data.split(DELIMITER) exception when msg.data is int --- request_llm/edge_gpt_free.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/request_llm/edge_gpt_free.py b/request_llm/edge_gpt_free.py index 1e96df08b..22ff05272 100644 --- a/request_llm/edge_gpt_free.py +++ b/request_llm/edge_gpt_free.py @@ -519,7 +519,11 @@ async def ask_stream( resp_txt_no_link = "" while not final: msg = await self.wss.receive() - objects = msg.data.split(DELIMITER) + try: + objects = msg.data.split(DELIMITER) + except : + continue + for obj in objects: if obj is None or not obj: continue