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

XFEstudio/gpt4free

Bug fixes and improvements to HuggingChat and HuggingFace providers

abea4ddb
kqlio67 <kqlio67@users.noreply.github.com>
提交于

代码差异

2 个文件 +6 -18
Modified g4f/Provider/HuggingChat.py +1 -0
@@ -12,6 +12,7 @@ class HuggingChat(AbstractProvider, ProviderModelMixin):
12 12 working = True
13 13 supports_stream = True
14 14 default_model = "meta-llama/Meta-Llama-3.1-70B-Instruct"
15
15 16 models = [
16 17 default_model,
17 18 'CohereForAI/c4ai-command-r-plus-08-2024',
Modified g4f/Provider/HuggingFace.py +5 -18
@@ -9,29 +9,16 @@ from .helper import get_connector
9 9 from ..errors import RateLimitError, ModelNotFoundError
10 10 from ..requests.raise_for_status import raise_for_status
11 11
12 from .HuggingChat import HuggingChat
13
12 14 class HuggingFace(AsyncGeneratorProvider, ProviderModelMixin):
13 15 url = "https://huggingface.co/chat"
14 16 working = True
15 17 needs_auth = True
16 18 supports_message_history = True
17 default_model = "meta-llama/Meta-Llama-3.1-70B-Instruct"
18 models = [
19 default_model,
20 'CohereForAI/c4ai-command-r-plus-08-2024',
21 'mistralai/Mixtral-8x7B-Instruct-v0.1',
22 'NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO',
23 'mistralai/Mistral-7B-Instruct-v0.3',
24 'microsoft/Phi-3-mini-4k-instruct',
25 ]
26
27 model_aliases = {
28 "llama-3.1-70b": "meta-llama/Meta-Llama-3.1-70B-Instruct",
29 "command-r-plus": "CohereForAI/c4ai-command-r-plus-08-2024",
30 "mixtral-8x7b": "mistralai/Mixtral-8x7B-Instruct-v0.1",
31 "mixtral-8x7b": "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
32 "mistral-7b": "mistralai/Mistral-7B-Instruct-v0.3",
33 "phi-3-mini-4k": "microsoft/Phi-3-mini-4k-instruct",
34 }
19 default_model = HuggingChat.default_model
20 models = HuggingChat.models
21 model_aliases = HuggingChat.model_aliases
35 22
36 23 @classmethod
37 24 def get_model(cls, model: str) -> str: