From 58071796051003282ac2a387a65504320aea4564 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Fri, 23 Feb 2024 11:36:57 +0100 Subject: Fix isssue with stop in client --- g4f/client.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/g4f/client.py b/g4f/client.py index bf2179aa..3e11fac1 100644 --- a/g4f/client.py +++ b/g4f/client.py @@ -127,10 +127,6 @@ class Completions(): api_key: str = None, **kwargs ) -> Union[ChatCompletion, Generator[ChatCompletionChunk]]: - if max_tokens is not None: - kwargs["max_tokens"] = max_tokens - if stop: - kwargs["stop"] = stop model, provider = get_model_and_provider( model, self.provider if provider is None else provider, @@ -141,6 +137,7 @@ class Completions(): response = provider.create_completion( model, messages, stream, proxy=self.client.get_proxy(), + max_tokens=max_tokens, stop=stop, api_key=self.client.api_key if api_key is None else api_key, **kwargs -- cgit v1.2.3