From 3576dee75a1623aa2385b6afe8b922ad5affca26 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Wed, 6 Dec 2023 09:35:36 +0100 Subject: Add selenium to dockerfile Load model and provider list in gui Remove needs_auth in HuggingChat Add default model and login url in gui --- g4f/Provider/needs_auth/HuggingChat.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'g4f/Provider/needs_auth/HuggingChat.py') diff --git a/g4f/Provider/needs_auth/HuggingChat.py b/g4f/Provider/needs_auth/HuggingChat.py index 59e2da73..530069c0 100644 --- a/g4f/Provider/needs_auth/HuggingChat.py +++ b/g4f/Provider/needs_auth/HuggingChat.py @@ -11,7 +11,6 @@ from ..helper import format_prompt, get_cookies class HuggingChat(AsyncGeneratorProvider): url = "https://huggingface.co/chat" - needs_auth = True working = True model = "meta-llama/Llama-2-70b-chat-hf" @@ -22,12 +21,11 @@ class HuggingChat(AsyncGeneratorProvider): messages: Messages, stream: bool = True, proxy: str = None, + web_search: bool = False, cookies: dict = None, **kwargs ) -> AsyncResult: model = model if model else cls.model - if proxy and "://" not in proxy: - proxy = f"http://{proxy}" if not cookies: cookies = get_cookies(".huggingface.co") @@ -46,7 +44,7 @@ class HuggingChat(AsyncGeneratorProvider): "inputs": format_prompt(messages), "is_retry": False, "response_id": str(uuid.uuid4()), - "web_search": False + "web_search": web_search } async with session.post(f"{cls.url}/conversation/{conversation_id}", json=send, proxy=proxy) as response: async for line in response.content: -- cgit v1.2.3