Fix: GptGo json.decoder.JSONDecodeError

pull/1053/head
hs_junxiang 12 months ago
parent 4829f3bfec
commit 19346ba9ba

@ -60,6 +60,8 @@ class GptGo(AsyncGeneratorProvider):
if line.startswith("data: [DONE]"):
break
line = json.loads(line[len(start):-1])
if line["choices"][0]["finish_reason"] == "stop":
break
content = line["choices"][0]["delta"].get("content")
if content:
yield content

Loading…
Cancel
Save