From c617b18d12c2f9d82ce7c73aae46d353b83f625a Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 1 Jan 2024 17:48:57 +0100 Subject: Add support for all models Add AbstractProvider class Add ProviderType type Add get_last_provider function Add version module and VersionUtils Display used provider in gui Fix error response in api --- g4f/Provider/needs_auth/HuggingChat.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (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 41c938b4..e4fa237d 100644 --- a/g4f/Provider/needs_auth/HuggingChat.py +++ b/g4f/Provider/needs_auth/HuggingChat.py @@ -8,6 +8,9 @@ from ...typing import AsyncResult, Messages from ..base_provider import AsyncGeneratorProvider from ..helper import format_prompt, get_cookies +map = { + "openchat/openchat_3.5": "openchat/openchat-3.5-1210", +} class HuggingChat(AsyncGeneratorProvider): url = "https://huggingface.co/chat" @@ -25,7 +28,10 @@ class HuggingChat(AsyncGeneratorProvider): cookies: dict = None, **kwargs ) -> AsyncResult: - model = model if model else cls.model + if not model: + model = cls.model + elif model in map: + model = map[model] if not cookies: cookies = get_cookies(".huggingface.co") -- cgit v1.2.3