From 5b76f2cde01e063dfdf6ed645cae5341ffb78026 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 16 Dec 2024 19:07:41 +0100 Subject: Fix docker build and fix api_base issue in OpenaiAPI providers --- g4f/Provider/local/Ollama.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'g4f/Provider/local') diff --git a/g4f/Provider/local/Ollama.py b/g4f/Provider/local/Ollama.py index de68a218..3103baf4 100644 --- a/g4f/Provider/local/Ollama.py +++ b/g4f/Provider/local/Ollama.py @@ -31,10 +31,10 @@ class Ollama(OpenaiAPI): api_base: str = None, **kwargs ) -> AsyncResult: - if not api_base: + if api_base is None: host = os.getenv("OLLAMA_HOST", "localhost") port = os.getenv("OLLAMA_PORT", "11434") api_base: str = f"http://{host}:{port}/v1" return super().create_async_generator( model, messages, api_base=api_base, **kwargs - ) + ) \ No newline at end of file -- cgit v1.2.3