From 8fcf618bbe164e6c6f3e0df5e6c9809f35a50e6c Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sun, 5 May 2024 23:38:31 +0200 Subject: Add Ollama provider, Add vision support to Openai --- g4f/Provider/Bing.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'g4f/Provider/Bing.py') diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py index a9eb78e6..7e64a617 100644 --- a/g4f/Provider/Bing.py +++ b/g4f/Provider/Bing.py @@ -457,10 +457,13 @@ async def stream_generate( returned_text = '' message_id = None while do_read: - msg = await wss.receive_str() + try: + msg = await wss.receive_str() + except TypeError: + continue objects = msg.split(Defaults.delimiter) for obj in objects: - if obj is None or not obj: + if not obj: continue try: response = json.loads(obj) -- cgit v1.2.3