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

XFEstudio/gpt4free

A few small fixes in GUI and Providers (#1861)

81cf5d7c
kqlio67 <166700875+kqlio67@users.noreply.github.com>
提交于

代码差异

4 个文件 +41 -29
Modified g4f/Provider/Llama.py +4 -4
@@ -16,12 +16,12 @@ class Llama(AsyncGeneratorProvider, ProviderModelMixin):
16 16 "meta/llama-2-7b-chat",
17 17 "meta/llama-2-13b-chat",
18 18 "meta/llama-2-70b-chat",
19 "meta/llama-3-8b-chat",
20 "meta/llama-3-70b-chat",
19 "meta/meta-llama-3-8b-instruct",
20 "meta/meta-llama-3-70b-instruct",
21 21 ]
22 22 model_aliases = {
23 "meta-llama/Meta-Llama-3-8b": "meta/llama-3-8b-chat",
24 "meta-llama/Meta-Llama-3-70b": "meta/llama-3-70b-chat",
23 "meta-llama/Meta-Llama-3-8b-instruct": "meta/meta-llama-3-8b-instruct",
24 "meta-llama/Meta-Llama-3-70b-instruct": "meta/meta-llama-3-70b-instruct",
25 25 "meta-llama/Llama-2-7b-chat-hf": "meta/llama-2-7b-chat",
26 26 "meta-llama/Llama-2-13b-chat-hf": "meta/llama-2-13b-chat",
27 27 "meta-llama/Llama-2-70b-chat-hf": "meta/llama-2-70b-chat",
Modified g4f/Provider/PerplexityLabs.py +2 -5
@@ -15,10 +15,7 @@ class PerplexityLabs(AsyncGeneratorProvider, ProviderModelMixin):
15 15 working = True
16 16 default_model = "mixtral-8x7b-instruct"
17 17 models = [
18 "sonar-small-online", "sonar-medium-online", "sonar-small-chat", "sonar-medium-chat", "mistral-7b-instruct",
19 "codellama-70b-instruct", "llava-v1.5-7b-wrapper", "llava-v1.6-34b", "mixtral-8x7b-instruct",
20 "gemma-2b-it", "gemma-7b-it"
21 "mistral-medium", "related", "dbrx-instruct"
18 "sonar-small-online", "sonar-medium-online", "sonar-small-chat", "sonar-medium-chat", "dbrx-instruct", "claude-3-haiku-20240307", "llama-3-8b-instruct", "llama-3-70b-instruct", "codellama-70b-instruct", "mistral-7b-instruct", "llava-v1.5-7b-wrapper", "llava-v1.6-34b", "mixtral-8x7b-instruct", "mixtral-8x22b-instruct", "mistral-medium", "gemma-2b-it", "gemma-7b-it", "related"
22 19 ]
23 20 model_aliases = {
24 21 "mistralai/Mistral-7B-Instruct-v0.1": "mistral-7b-instruct",
@@ -93,4 +90,4 @@ class PerplexityLabs(AsyncGeneratorProvider, ProviderModelMixin):
93 90 if data["final"]:
94 91 break
95 92 except:
96 raise RuntimeError(f"Message: {message}")
93 raise RuntimeError(f"Message: {message}")
Modified g4f/gui/client/index.html +1 -1
@@ -220,7 +220,7 @@
220 220 <option value="gpt-4">gpt-4</option>
221 221 <option value="gpt-3.5-turbo">gpt-3.5-turbo</option>
222 222 <option value="llama2-70b">llama2-70b</option>
223 <option value="llama3-70b">llama2-70b</option>
223 <option value="llama3-70b-instruct">llama3-70b-instruct</option>
224 224 <option value="gemini-pro">gemini-pro</option>
225 225 <option value="">----</option>
226 226 </select>
Modified g4f/models.py +34 -19
@@ -4,28 +4,33 @@ from dataclasses import dataclass
4 4
5 5 from .Provider import RetryProvider, ProviderType
6 6 from .Provider import (
7 Aichatos,
8 Bing,
9 Blackbox,
7 10 Chatgpt4Online,
8 PerplexityLabs,
9 GeminiProChat,
10 ChatgptNext,
11 HuggingChat,
12 HuggingFace,
13 OpenaiChat,
14 11 ChatgptAi,
12 ChatgptNext,
13 Cohere,
14 Cnote,
15 15 DeepInfra,
16 Feedough,
17 FreeGpt,
18 Gemini,
19 GeminiProChat,
16 20 GigaChat,
21 HuggingChat,
22 HuggingFace,
23 Koala,
17 24 Liaobots,
18 FreeGpt,
19 25 Llama,
26 OpenaiChat,
27 PerplexityLabs,
28 Pi,
20 29 Vercel,
21 Gemini,
22 Koala,
23 Cohere,
24 Bing,
25 30 You,
26 Pi,
27 31 )
28 32
33
29 34 @dataclass(unsafe_hash=True)
30 35 class Model:
31 36 """
@@ -79,6 +84,9 @@ gpt_35_turbo = Model(
79 84 ChatgptNext,
80 85 Koala,
81 86 OpenaiChat,
87 Aichatos,
88 Cnote,
89 Feedough,
82 90 ])
83 91 )
84 92
@@ -132,14 +140,14 @@ llama2_70b = Model(
132 140 best_provider = RetryProvider([Llama, DeepInfra, HuggingChat])
133 141 )
134 142
135 llama3_8b = Model(
136 name = "meta-llama/Meta-Llama-3-8b",
143 llama3_8b_instruct = Model(
144 name = "meta-llama/Meta-Llama-3-8b-instruct",
137 145 base_provider = "meta",
138 146 best_provider = RetryProvider([Llama])
139 147 )
140 148
141 llama3_70b = Model(
142 name = "meta-llama/Meta-Llama-3-70b",
149 llama3_70b_instruct = Model(
150 name = "meta-llama/Meta-Llama-3-70b-instruct",
143 151 base_provider = "meta",
144 152 best_provider = RetryProvider([Llama, HuggingChat])
145 153 )
@@ -291,6 +299,12 @@ command_r_plus = Model(
291 299 best_provider = RetryProvider([HuggingChat, Cohere])
292 300 )
293 301
302 blackbox = Model(
303 name = 'blackbox',
304 base_provider = 'blackbox',
305 best_provider = Blackbox
306 )
307
294 308 class ModelUtils:
295 309 """
296 310 Utility class for mapping string identifiers to Model instances.
@@ -314,12 +328,12 @@ class ModelUtils:
314 328 'gpt-4-32k-0613' : gpt_4_32k_0613,
315 329 'gpt-4-turbo' : gpt_4_turbo,
316 330
317 # Llama 2
331 # Llama
318 332 'llama2-7b' : llama2_7b,
319 333 'llama2-13b': llama2_13b,
320 334 'llama2-70b': llama2_70b,
321 'llama3-8b' : llama3_8b,
322 'llama3-70b': llama3_70b,
335 'llama3-8b-instruct' : llama3_8b_instruct,
336 'llama3-70b-instruct': llama3_70b_instruct,
323 337 'codellama-34b-instruct': codellama_34b_instruct,
324 338 'codellama-70b-instruct': codellama_70b_instruct,
325 339
@@ -345,6 +359,7 @@ class ModelUtils:
345 359 'claude-3-sonnet': claude_3_sonnet,
346 360
347 361 # other
362 'blackbox': blackbox,
348 363 'command-r+': command_r_plus,
349 364 'dbrx-instruct': dbrx_instruct,
350 365 'lzlv-70b': lzlv_70b,