Create models.py
Browse files- g4f/models.py +64 -0
g4f/models.py
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from g4f import Provider
|
2 |
+
|
3 |
+
class Model:
|
4 |
+
class model:
|
5 |
+
name: str
|
6 |
+
base_provider: str
|
7 |
+
best_provider: str
|
8 |
+
|
9 |
+
class gpt_35_turbo:
|
10 |
+
name: str = 'gpt-3.5-turbo'
|
11 |
+
base_provider: str = 'openai'
|
12 |
+
best_provider: Provider.Provider = Provider.ChatFree
|
13 |
+
|
14 |
+
class gpt_35_turbo_16k:
|
15 |
+
name: str = 'gpt-3.5-turbo-16k'
|
16 |
+
base_provider: str = 'openai'
|
17 |
+
best_provider: Provider.Provider = Provider.ChatFree
|
18 |
+
|
19 |
+
class gpt_4_dev:
|
20 |
+
name: str = 'gpt-4-for-dev'
|
21 |
+
base_provider: str = 'openai'
|
22 |
+
best_provider: Provider.Provider = Provider.Phind
|
23 |
+
|
24 |
+
class gpt_4:
|
25 |
+
name: str = 'gpt-4'
|
26 |
+
base_provider: str = 'openai'
|
27 |
+
best_provider: Provider.Provider = Provider.Ava
|
28 |
+
|
29 |
+
class gpt_4_assistant:
|
30 |
+
name: str = 'gpt-4'
|
31 |
+
base_provider: str = 'openai'
|
32 |
+
best_provider: Provider.Provider = Provider.ChatgptAi
|
33 |
+
|
34 |
+
""" 'falcon-40b': Model.falcon_40b,
|
35 |
+
'falcon-7b': Model.falcon_7b,
|
36 |
+
'llama-13b': Model.llama_13b,"""
|
37 |
+
|
38 |
+
class falcon_40b:
|
39 |
+
name: str = 'falcon-40b'
|
40 |
+
base_provider: str = 'huggingface'
|
41 |
+
best_provider: Provider.Provider = Provider.H2o
|
42 |
+
|
43 |
+
class falcon_7b:
|
44 |
+
name: str = 'falcon-7b'
|
45 |
+
base_provider: str = 'huggingface'
|
46 |
+
best_provider: Provider.Provider = Provider.H2o
|
47 |
+
|
48 |
+
class llama_13b:
|
49 |
+
name: str = 'llama-13b'
|
50 |
+
base_provider: str = 'huggingface'
|
51 |
+
best_provider: Provider.Provider = Provider.H2o
|
52 |
+
|
53 |
+
class ModelUtils:
|
54 |
+
convert: dict = {
|
55 |
+
'gpt-3.5-turbo': Model.gpt_35_turbo,
|
56 |
+
'gpt-3.5-turbo-16k': Model.gpt_35_turbo_16k,
|
57 |
+
'gpt-4': Model.gpt_4,
|
58 |
+
'gpt-4-for-dev': Model.gpt_4_dev,
|
59 |
+
'gpt-4-for-assitant': Model.gpt_4_assistant,
|
60 |
+
|
61 |
+
'falcon-40b': Model.falcon_40b,
|
62 |
+
'falcon-7b': Model.falcon_7b,
|
63 |
+
'llama-13b': Model.llama_13b,
|
64 |
+
}
|