Spaces:
Running
Running
Fix Provider ChatGPTAI with GPT-4 model
Browse files- client/html/index.html +1 -1
- g4f/Provider/Providers/ChatgptAi.py +2 -2
- g4f/models.py +1 -1
client/html/index.html
CHANGED
@@ -81,7 +81,7 @@
|
|
81 |
<option value="gpt-3.5-turbo-16k-0613" selected>
|
82 |
GPT-3.5-turbo-16k-0613
|
83 |
</option>
|
84 |
-
<option value="gpt-4"
|
85 |
</select>
|
86 |
</div>
|
87 |
<div class="field">
|
|
|
81 |
<option value="gpt-3.5-turbo-16k-0613" selected>
|
82 |
GPT-3.5-turbo-16k-0613
|
83 |
</option>
|
84 |
+
<option value="gpt-4">GPT-4</option>
|
85 |
</select>
|
86 |
</div>
|
87 |
<div class="field">
|
g4f/Provider/Providers/ChatgptAi.py
CHANGED
@@ -7,14 +7,14 @@ model = ['gpt-4']
|
|
7 |
supports_stream = True
|
8 |
needs_auth = False
|
9 |
|
|
|
10 |
def _create_completion(model: str, messages: list, stream: bool, **kwargs):
|
11 |
chat = ''
|
12 |
for message in messages:
|
13 |
chat += '%s: %s\n' % (message['role'], message['content'])
|
14 |
chat += 'assistant: '
|
15 |
|
16 |
-
response = requests.get('https://chatgpt.ai/
|
17 |
-
|
18 |
nonce, post_id, _, bot_id = re.findall(r'data-nonce="(.*)"\n data-post-id="(.*)"\n data-url="(.*)"\n data-bot-id="(.*)"\n data-width', response.text)[0]
|
19 |
|
20 |
headers = {
|
|
|
7 |
supports_stream = True
|
8 |
needs_auth = False
|
9 |
|
10 |
+
|
11 |
def _create_completion(model: str, messages: list, stream: bool, **kwargs):
|
12 |
chat = ''
|
13 |
for message in messages:
|
14 |
chat += '%s: %s\n' % (message['role'], message['content'])
|
15 |
chat += 'assistant: '
|
16 |
|
17 |
+
response = requests.get('https://chatgpt.ai/')
|
|
|
18 |
nonce, post_id, _, bot_id = re.findall(r'data-nonce="(.*)"\n data-post-id="(.*)"\n data-url="(.*)"\n data-bot-id="(.*)"\n data-width', response.text)[0]
|
19 |
|
20 |
headers = {
|
g4f/models.py
CHANGED
@@ -35,7 +35,7 @@ class Model:
|
|
35 |
class gpt_4:
|
36 |
name: str = 'gpt-4'
|
37 |
base_provider: str = 'openai'
|
38 |
-
best_provider: Provider.Provider = Provider.
|
39 |
|
40 |
class gpt_4_0613:
|
41 |
name: str = 'gpt-4-0613'
|
|
|
35 |
class gpt_4:
|
36 |
name: str = 'gpt-4'
|
37 |
base_provider: str = 'openai'
|
38 |
+
best_provider: Provider.Provider = Provider.ChatgptAi
|
39 |
|
40 |
class gpt_4_0613:
|
41 |
name: str = 'gpt-4-0613'
|