g4f commited on
Commit
0d0cc45
·
1 Parent(s): a21bb06

Synced repo using 'sync_with_huggingface' Github Action

Browse files
g4f/Provider/Providers/Gravityengine.py CHANGED
@@ -1,6 +1,5 @@
1
  import requests
2
  import os
3
- import json
4
  from ...typing import sha256, Dict, get_type_hints
5
 
6
  url = 'https://gpt4.xunika.uk/'
@@ -12,8 +11,8 @@ working = True
12
  def _create_completion(model: str, messages: list, stream: bool, **kwargs):
13
  headers = {
14
  'Content-Type': 'application/json',
15
- 'Authorization':'Bearer wwwchatgptorguk',
16
- 'Cookie':'FCNEC=%5B%5B%22AKsRol8oAtMdGFPKct6Xlvf9FMwt0ghzonq-NWJaGWZgyBfewG7IzKBSKZRpUeq_dOeMsER8VrYaIKOQgwwXT7zOzBtXf_OU7rD44yIjAl03Q4HRRtdsryzUPl2DuQZ8Wq6IMzD9RbCKxYuSCMqEJcDB51IiIZrqeg%3D%3D%22%5D%2Cnull%2C%5B%5D%5D',
17
  'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
18
  'Origin':'https://gpt4.xunika.uk',
19
  'Referer':'https://gpt4.xunika.uk/'
@@ -22,9 +21,11 @@ def _create_completion(model: str, messages: list, stream: bool, **kwargs):
22
  'model': model,
23
  'temperature': kwargs.get("temperature", 0.7),
24
  'presence_penalty': kwargs.get('presence_penalty', 0),
 
 
25
  'messages': messages,
26
  }
27
- response = requests.post(url + '/api/openai/v1/chat/completions',
28
  json=data, headers=headers,stream=True)
29
 
30
  yield response.json()['choices'][0]['message']['content']
 
1
  import requests
2
  import os
 
3
  from ...typing import sha256, Dict, get_type_hints
4
 
5
  url = 'https://gpt4.xunika.uk/'
 
11
  def _create_completion(model: str, messages: list, stream: bool, **kwargs):
12
  headers = {
13
  'Content-Type': 'application/json',
14
+ 'Authorization':'Bearer nk-wwwchatgptorguk',
15
+ 'Cookie':'FCNEC=%5B%5B%22AKsRol8oAtMdGFPKct6Xlvf9FMwt0ghzonq-NWJaGWZgyBfewG7IzKBSKZRpUeq_dOeMsER8VrYaIKOQgwwXT7zOzBtXf_OU7rD44yIjAl03Q4HRRtdsryzUPl2DuQZ8Wq6IMzD9RbCKxYuSCMqEJcDB51IiIZrqeg%3D%3D%22%5D%2Cnull%2C%5B%5D%5D; cf_clearance=Of77ONOU17lrhK7iE7EoOLEmvF0f0oansv82kv5WZ8w-1692877407-0-1-e5dbe702.bf00254.b2dab8e2-0.2.1692877407',
16
  'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
17
  'Origin':'https://gpt4.xunika.uk',
18
  'Referer':'https://gpt4.xunika.uk/'
 
21
  'model': model,
22
  'temperature': kwargs.get("temperature", 0.7),
23
  'presence_penalty': kwargs.get('presence_penalty', 0),
24
+ 'top_p':1,
25
+ 'frequency_penalty': 0,
26
  'messages': messages,
27
  }
28
+ response = requests.post('https://gpt4.xunika.uk/api/openai/v1/chat/completions',
29
  json=data, headers=headers,stream=True)
30
 
31
  yield response.json()['choices'][0]['message']['content']