From efd75a11b871d61ac31b0e274acdfb33daba361d Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Sun, 27 Aug 2023 17:37:44 +0200 Subject: ~ | code styling --- g4f/Provider/Hugchat.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'g4f/Provider/Hugchat.py') diff --git a/g4f/Provider/Hugchat.py b/g4f/Provider/Hugchat.py index cedf8402..80062af1 100644 --- a/g4f/Provider/Hugchat.py +++ b/g4f/Provider/Hugchat.py @@ -5,13 +5,13 @@ except ImportError: has_module = False from .base_provider import BaseProvider, get_cookies -from g4f.typing import CreateResult +from g4f.typing import CreateResult class Hugchat(BaseProvider): - url = "https://huggingface.co/chat/" + url = "https://huggingface.co/chat/" needs_auth = True - working = has_module - llms = ['OpenAssistant/oasst-sft-6-llama-30b-xor', 'meta-llama/Llama-2-70b-chat-hf'] + working = has_module + llms = ['OpenAssistant/oasst-sft-6-llama-30b-xor', 'meta-llama/Llama-2-70b-chat-hf'] @classmethod def create_completion( @@ -20,12 +20,10 @@ class Hugchat(BaseProvider): messages: list[dict[str, str]], stream: bool = False, proxy: str = None, - cookies: str = get_cookies(".huggingface.co"), - **kwargs - ) -> CreateResult: + cookies: str = get_cookies(".huggingface.co"), **kwargs) -> CreateResult: + bot = ChatBot( - cookies=cookies - ) + cookies=cookies) if proxy and "://" not in proxy: proxy = f"http://{proxy}" -- cgit v1.2.3