summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/HuggingFace.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-09 19:40:42 +0200
committerGitHub <noreply@github.com>2024-04-09 19:40:42 +0200
commit4c23b4cad4744e20da7ccffb303503ea627df7c2 (patch)
treea032e6ebd494136ba35e049b06aa4af45558b540 /g4f/Provider/HuggingFace.py
parentMerge pull request #1809 from ochen1/patch-1 (diff)
parentAdd project files (diff)
downloadgpt4free-4c23b4cad4744e20da7ccffb303503ea627df7c2.tar
gpt4free-4c23b4cad4744e20da7ccffb303503ea627df7c2.tar.gz
gpt4free-4c23b4cad4744e20da7ccffb303503ea627df7c2.tar.bz2
gpt4free-4c23b4cad4744e20da7ccffb303503ea627df7c2.tar.lz
gpt4free-4c23b4cad4744e20da7ccffb303503ea627df7c2.tar.xz
gpt4free-4c23b4cad4744e20da7ccffb303503ea627df7c2.tar.zst
gpt4free-4c23b4cad4744e20da7ccffb303503ea627df7c2.zip
Diffstat (limited to 'g4f/Provider/HuggingFace.py')
-rw-r--r--g4f/Provider/HuggingFace.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/g4f/Provider/HuggingFace.py b/g4f/Provider/HuggingFace.py
index 647780fd..6a05c26e 100644
--- a/g4f/Provider/HuggingFace.py
+++ b/g4f/Provider/HuggingFace.py
@@ -13,6 +13,10 @@ class HuggingFace(AsyncGeneratorProvider, ProviderModelMixin):
url = "https://huggingface.co/chat"
working = True
supports_message_history = True
+ models = [
+ "mistralai/Mixtral-8x7B-Instruct-v0.1",
+ "mistralai/Mistral-7B-Instruct-v0.2"
+ ]
default_model = "mistralai/Mixtral-8x7B-Instruct-v0.1"
@classmethod
@@ -29,7 +33,7 @@ class HuggingFace(AsyncGeneratorProvider, ProviderModelMixin):
temperature: float = 0.7,
**kwargs
) -> AsyncResult:
- model = cls.get_model(model)
+ model = cls.get_model(model) if not model else model
headers = {}
if api_key is not None:
headers["Authorization"] = f"Bearer {api_key}"