mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-09-17 10:29:29 -04:00
~ | Merge pull request #1053 from Lin-jun-xiang/fix_GptGo
Fix: GptGo json.decoder.JSONDecodeError
This commit is contained in:
commit
2ea62781fe
@ -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