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

XFEstudio/gpt4free

add more models

mixtral 8x22b

ed8afc20
abc <98614666+xtekky@users.noreply.github.com>
提交于

代码差异

6 个文件 +49 -13
Modified .gitignore +4 -1
@@ -59,4 +59,7 @@ node_modules
59 59 models
60 60 projects/windows/g4f
61 61 doc.txt
62 dist.py
62 dist.py
63 x.txt
64 bench.py
65 to-reverse.txt
Modified README.md +9 -0
@@ -281,6 +281,15 @@ set G4F_PROXY=http://host:port
281 281 | [beta.theb.ai](https://beta.theb.ai) | `g4f.Provider.Theb` | ✔️ | ✔️ | ✔️ | ![Unknown](https://img.shields.io/badge/Unknown-grey) | ❌ |
282 282 | [you.com](https://you.com) | `g4f.Provider.You` | ✔️ | ✔️ | ✔️ | ![Unknown](https://img.shields.io/badge/Unknown-grey) | ❌ |
283 283
284 ## New OpenSource Models
285 While we wait for gpt-5, here is a list of new models that are at least better than gpt-3.5-turbo. Some rival gpt-4. Expect this list to grow.
286
287 | Website | Provider | parameters |
288 | ------ | ------- | ------ |
289 | [mixtral-8x22b](https://huggingface.co/mistral-community/Mixtral-8x22B-v0.1) | `g4f.Provider.DeepInfra` | 176B / 44b active |
290 | [dbrx-instruct](https://www.databricks.com/blog/introducing-dbrx-new-state-art-open-llm) | `g4f.Provider.DeepInfra` | 132B / 36B active|
291
292
284 293 ### GPT-3.5
285 294
286 295 | Website | Provider | GPT-3.5 | GPT-4 | Stream | Status | Auth |
Modified g4f/Provider/DeepInfra.py +9 -1
@@ -11,7 +11,7 @@ class DeepInfra(Openai):
11 11 needs_auth = False
12 12 supports_stream = True
13 13 supports_message_history = True
14 default_model = 'meta-llama/Llama-2-70b-chat-hf'
14 default_model = 'HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1'
15 15
16 16 @classmethod
17 17 def get_models(cls):
@@ -32,6 +32,14 @@ class DeepInfra(Openai):
32 32 max_tokens: int = 1028,
33 33 **kwargs
34 34 ) -> AsyncResult:
35
36 if not '/' in model:
37 models = {
38 'mixtral-8x22b': 'HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1',
39 'dbrx-instruct': 'databricks/dbrx-instruct',
40 }
41 model = models.get(model, model)
42
35 43 headers = {
36 44 'Accept-Encoding': 'gzip, deflate, br',
37 45 'Accept-Language': 'en-US',
Modified g4f/Provider/needs_auth/Openai.py +1 -0
@@ -51,6 +51,7 @@ class Openai(AsyncGeneratorProvider, ProviderModelMixin):
51 51 stream=stream,
52 52 **extra_data
53 53 )
54
54 55 async with session.post(f"{api_base.rstrip('/')}/chat/completions", json=data) as response:
55 56 await raise_for_status(response)
56 57 if not stream:
Modified g4f/client/service.py +2 -1
@@ -55,9 +55,10 @@ def get_model_and_provider(model : Union[Model, str],
55 55 provider = convert_to_provider(provider)
56 56
57 57 if isinstance(model, str):
58
58 59 if model in ModelUtils.convert:
59 60 model = ModelUtils.convert[model]
60
61
61 62 if not provider:
62 63 if isinstance(model, str):
63 64 raise ModelNotFoundError(f'Model not found: {model}')
Modified g4f/models.py +24 -10
@@ -162,11 +162,11 @@ mistral_7b_v02 = Model(
162 162 best_provider = DeepInfra
163 163 )
164 164
165 # mixtral_8x22b = Model(
166 # name = "mistralai/Mixtral-8x22B-v0.1",
167 # base_provider = "huggingface",
168 # best_provider = DeepInfra
169 # )
165 mixtral_8x22b = Model(
166 name = "HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1",
167 base_provider = "huggingface",
168 best_provider = DeepInfra
169 )
170 170
171 171 # Misc models
172 172 dolphin_mixtral_8x7b = Model(
@@ -266,6 +266,12 @@ pi = Model(
266 266 best_provider = Pi
267 267 )
268 268
269 dbrx_instruct = Model(
270 name = 'databricks/dbrx-instruct',
271 base_provider = 'mistral',
272 best_provider = DeepInfra
273 )
274
269 275 class ModelUtils:
270 276 """
271 277 Utility class for mapping string identifiers to Model instances.
@@ -300,20 +306,28 @@ class ModelUtils:
300 306 'gigachat' : gigachat,
301 307 'gigachat_plus': gigachat_plus,
302 308 'gigachat_pro' : gigachat_pro,
303
309
310 # Mistral Opensource
304 311 'mixtral-8x7b': mixtral_8x7b,
305 312 'mistral-7b': mistral_7b,
306 313 'mistral-7b-v02': mistral_7b_v02,
307 # 'mixtral-8x22b': mixtral_8x22b,
314 'mixtral-8x22b': mixtral_8x22b,
308 315 'dolphin-mixtral-8x7b': dolphin_mixtral_8x7b,
309 'lzlv-70b': lzlv_70b,
310 'airoboros-70b': airoboros_70b,
311 'openchat_3.5': openchat_35,
316
317 # google gemini
312 318 'gemini': gemini,
313 319 'gemini-pro': gemini_pro,
320
321 # anthropic
314 322 'claude-v2': claude_v2,
315 323 'claude-3-opus': claude_3_opus,
316 324 'claude-3-sonnet': claude_3_sonnet,
325
326 # other
327 'dbrx-instruct': dbrx_instruct,
328 'lzlv-70b': lzlv_70b,
329 'airoboros-70b': airoboros_70b,
330 'openchat_3.5': openchat_35,
317 331 'pi': pi
318 332 }
319 333