From eff81c30150ec39849432ed3fdbf7dbf15abec51 Mon Sep 17 00:00:00 2001 From: hlohaus <983577+hlohaus@users.noreply.github.com> Date: Sun, 2 Feb 2025 23:10:33 +0100 Subject: Fix pass session paramters in HuggingFaceAPI --- g4f/Provider/hf/HuggingFaceAPI.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/g4f/Provider/hf/HuggingFaceAPI.py b/g4f/Provider/hf/HuggingFaceAPI.py index 2136caf0..9aa01dc2 100644 --- a/g4f/Provider/hf/HuggingFaceAPI.py +++ b/g4f/Provider/hf/HuggingFaceAPI.py @@ -40,9 +40,6 @@ class HuggingFaceAPI(OpenaiTemplate): api_base: str = None, max_tokens: int = 2048, max_inputs_lenght: int = 10000, - impersonate: str = None, - proxy: str = None, - timeout: int = 300, images: ImagesType = None, **kwargs ): @@ -53,9 +50,7 @@ class HuggingFaceAPI(OpenaiTemplate): api_base = f"https://api-inference.huggingface.co/models/{model_name}/v1" if images is not None: async with StreamSession( - proxy=proxy, - timeout=timeout, - impersonate=impersonate, + timeout=30, ) as session: async with session.get(f"https://huggingface.co/api/models/{model}") as response: if response.status == 404: -- cgit v1.2.3