XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix HuggingChat

68b4b4d6
hlohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +0 -9
Modified g4f/Provider/needs_auth/hf/HuggingChat.py +0 -9
@@ -23,7 +23,6 @@ from ....requests.raise_for_status import raise_for_status
23 23 from ....providers.response import JsonConversation, ImageResponse, Sources, TitleGeneration, Reasoning, RequestLogin, FinishReason
24 24 from ....cookies import get_cookies
25 25 from ....tools.media import merge_media
26 from .models import default_model, default_vision_model, fallback_models, image_models, model_aliases, image_model_aliases
27 26 from .... import debug
28 27
29 28 class Conversation(JsonConversation):
@@ -40,11 +39,6 @@ class HuggingChat(AsyncAuthedProvider, ProviderModelMixin):
40 39 use_nodriver = True
41 40 supports_stream = True
42 41 needs_auth = True
43 default_model = default_model
44 default_vision_model = default_vision_model
45 model_aliases = {**model_aliases, **image_model_aliases}
46 image_models = image_models
47 text_models = fallback_models
48 42
49 43 @classmethod
50 44 def get_models(cls, **kwargs) -> list[str]:
@@ -56,7 +50,6 @@ class HuggingChat(AsyncAuthedProvider, ProviderModelMixin):
56 50 cls.vision_models = [model["id"] for model in models if model["multimodal"]]
57 51 except Exception as e:
58 52 debug.error(f"{cls.__name__}: Error reading models: {type(e).__name__}: {e}")
59 cls.models = [*fallback_models]
60 53 return cls.models
61 54
62 55 @classmethod
@@ -94,8 +87,6 @@ class HuggingChat(AsyncAuthedProvider, ProviderModelMixin):
94 87 ) -> AsyncResult:
95 88 if not has_curl_cffi:
96 89 raise MissingRequirementsError('Install "curl_cffi" package | pip install -U curl_cffi')
97 if not model and media is not None:
98 model = cls.default_vision_model
99 90 model = cls.get_model(model)
100 91
101 92 session = Session(**auth_result.get_dict())