~ | Merge pull request #1053 from Lin-jun-xiang/fix_GptGo

Fix: GptGo json.decoder.JSONDecodeError
pull/1064/head
Tekky 12 months ago committed by GitHub
commit 2ea62781fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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