From e8bd24a25bb8737c4f6ef8ba656e74a58e74336a Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Fri, 22 Nov 2024 01:50:48 +0100 Subject: Add speech synthesize from Gemini (#2404) * Improve slim docker image example, clean up OpenaiChat provider * Enhance event loop management for asynchronous generators * Fix attribute " shutdown_default_executor" not found in old python versions * asyncio file created with all async helpers * Add speech synthesize from Gemini. You can use it without a account --- g4f/gui/server/api.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'g4f/gui/server/api.py') diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py index 0c32bea5..ecf7bc54 100644 --- a/g4f/gui/server/api.py +++ b/g4f/gui/server/api.py @@ -140,13 +140,12 @@ class Api: } def _create_response_stream(self, kwargs: dict, conversation_id: str, provider: str, download_images: bool = True) -> Iterator: - if debug.logging: - debug.logs = [] - print_callback = debug.log_handler - def log_handler(text: str): - debug.logs.append(text) - print_callback(text) - debug.log_handler = log_handler + debug.logs = [] + print_callback = debug.log_handler + def log_handler(text: str): + debug.logs.append(text) + print_callback(text) + debug.log_handler = log_handler try: result = ChatCompletion.create(**kwargs) first = True -- cgit v1.2.3