mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-09-12 08:29:30 -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]"):
|
||||
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…
Reference in New Issue
Block a user