mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-19 03:25:32 +00:00
Fix: GptGo json.decoder.JSONDecodeError
This commit is contained in:
parent
4829f3bfec
commit
19346ba9ba
@ -60,6 +60,8 @@ class GptGo(AsyncGeneratorProvider):
|
|||||||
if line.startswith("data: [DONE]"):
|
if line.startswith("data: [DONE]"):
|
||||||
break
|
break
|
||||||
line = json.loads(line[len(start):-1])
|
line = json.loads(line[len(start):-1])
|
||||||
|
if line["choices"][0]["finish_reason"] == "stop":
|
||||||
|
break
|
||||||
content = line["choices"][0]["delta"].get("content")
|
content = line["choices"][0]["delta"].get("content")
|
||||||
if content:
|
if content:
|
||||||
yield content
|
yield content
|
||||||
|
Loading…
Reference in New Issue
Block a user