diff options
author | Luneye <73485421+Luneye@users.noreply.github.com> | 2023-08-28 16:55:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-28 16:55:36 +0200 |
commit | 01294db6995511de37e9078e03ce32e54dbdad52 (patch) | |
tree | d6c4c14f4e6a3a81660ddb75272bc5da81cacecc /g4f/Provider/Hugchat.py | |
parent | Update Bing.py (diff) | |
parent | ~ | code styling (diff) | |
download | gpt4free-01294db6995511de37e9078e03ce32e54dbdad52.tar gpt4free-01294db6995511de37e9078e03ce32e54dbdad52.tar.gz gpt4free-01294db6995511de37e9078e03ce32e54dbdad52.tar.bz2 gpt4free-01294db6995511de37e9078e03ce32e54dbdad52.tar.lz gpt4free-01294db6995511de37e9078e03ce32e54dbdad52.tar.xz gpt4free-01294db6995511de37e9078e03ce32e54dbdad52.tar.zst gpt4free-01294db6995511de37e9078e03ce32e54dbdad52.zip |
Diffstat (limited to 'g4f/Provider/Hugchat.py')
-rw-r--r-- | g4f/Provider/Hugchat.py | 16 |
1 files changed, 7 insertions, 9 deletions
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}" |