From eae317a1665f94ada0c34875a0aec09df89b138b Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Thu, 21 Nov 2024 05:00:08 +0100 Subject: Support synthesize in Openai generator (#2394) * Improve download of generated images, serve images in the api * Add support for conversation handling in the api * Add orginal prompt to image response * Add download images option in gui, fix loading model list in Airforce * Support speech synthesize in Openai generator --- g4f/providers/base_provider.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'g4f/providers/base_provider.py') diff --git a/g4f/providers/base_provider.py b/g4f/providers/base_provider.py index b6df48e8..c6d0d950 100644 --- a/g4f/providers/base_provider.py +++ b/g4f/providers/base_provider.py @@ -11,7 +11,7 @@ from typing import Callable, Union from ..typing import CreateResult, AsyncResult, Messages from .types import BaseProvider -from .response import FinishReason, BaseConversation +from .response import FinishReason, BaseConversation, SynthesizeData from ..errors import NestAsyncioError, ModelNotSupportedError from .. import debug @@ -259,7 +259,7 @@ class AsyncGeneratorProvider(AsyncProvider): """ return "".join([ str(chunk) async for chunk in cls.create_async_generator(model, messages, stream=False, **kwargs) - if not isinstance(chunk, (Exception, FinishReason, BaseConversation)) + if not isinstance(chunk, (Exception, FinishReason, BaseConversation, SynthesizeData)) ]) @staticmethod -- cgit v1.2.3