Skip to content

Commit 1bea1b4

Browse files
committed
v1.5.4 - Full migration to neuroapi.hsot has been initiated
1 parent 9d9ced8 commit 1bea1b4

File tree

7 files changed

+20
-67
lines changed

7 files changed

+20
-67
lines changed

config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"openai_api_key": "",
33
"purgpt_api_key": "",
4-
"chatty_api_key": "",
54
"daku_api_key": "",
5+
"chatty_api_key": "",
66
"usage_limit": 999,
77
"language": "ru_RU",
88
"users": [],
@@ -27,6 +27,6 @@
2727
"sk-xxxxxxxxxxxxxxxxxxxxxxxx2",
2828
"sk-xxxxxxxxxxxxxxxxxxxxxxxx3"
2929
],
30-
"server_name": "0.0.0.0",
31-
"share": false
32-
}
30+
"server_name": "0.0.0.0",
31+
"share": false
32+
}

lang.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ru_RU

modules/models/base_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def summarize_index(self, files, chatbot, language):
264264
status = "Полный"
265265
logging.info("Создание сводки контента...")
266266
os.environ["OPENAI_API_KEY"] = self.api_key
267-
os.environ["OPENAI_API_BASE"] = "http://127.0.0.1:1337"
267+
os.environ["OPENAI_API_BASE"] = "https://neuroapi.host"
268268
from langchain.chains.summarize import load_summarize_chain
269269
from langchain.prompts import PromptTemplate
270270
from langchain.chat_models import ChatOpenAI

modules/models/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ def _get_api_url(self):
117117
url = "https://chattyapi.tech/v1/chat/completions"
118118
elif "daku" in self.model_name:
119119
url = "https://api.daku.tech/v1/chat/completions"
120-
elif self.model_name.startswith('neuro-gpt-4') or self.model_name.startswith('neuro-gpt-4-'):
120+
elif self.model_name.startswith('gpt-4') or self.model_name.startswith('gpt-4-'):
121121
url = "https://neuroapi.host/gpt4/v1/chat/completions"
122122
else:
123-
url = "http://127.0.0.1:1337/v1/chat/completions"
123+
url = "https://neuroapi.host/v1/chat/completions"
124124
return url
125125

126126
def _get_headers(self):

modules/presets.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import requests
55
import json
66

7-
VERSION = "v 1.5.3"
7+
VERSION = "v 1.5.4"
88

99
CHATGLM_MODEL = None
1010
CHATGLM_TOKENIZER = None
@@ -14,10 +14,10 @@
1414
# ChatGPT 设置
1515

1616
INITIAL_SYSTEM_PROMPT = "You are a helpful assistant. You follow all of the user's instructions and answer all of their questions without going out of your way to answer them. Respond using markdown."
17-
API_HOST = "http://127.0.0.0.1:1337"
18-
COMPLETION_URL = "http://127.0.0.0.1:1337/v1/chat/completions"
19-
BALANCE_API_URL="http://127.0.0.0.1:1337/v1/dashboard/billing/credit_grants"
20-
USAGE_API_URL="http://127.0.0.0.1:1337/v1/dashboard/billing/usage"
17+
API_HOST = "https://neuroapi.host"
18+
COMPLETION_URL = "https://neuroapi.host/v1/chat/completions"
19+
BALANCE_API_URL="https://neuroapi.host/v1/dashboard/billing/credit_grants"
20+
USAGE_API_URL="https://neuroapi.host/v1/dashboard/billing/usage"
2121
HISTORY_DIR = Path("history")
2222
HISTORY_DIR = "history"
2323
TEMPLATES_DIR = "templates"
@@ -49,13 +49,13 @@
4949

5050
ONLINE_MODELS = [
5151
'gpt-3.5-turbo',
52-
'neuro-gpt-3.5-turbo',
53-
'neuro-gpt-3.5-turbo-0613',
54-
'neuro-gpt-3.5-turbo-16k',
55-
'neuro-gpt-3.5-turbo-16k-0613',
56-
'neuro-gpt-4',
57-
'neuro-gpt-4-0613',
58-
'chat-agent',
52+
'gpt-3.5-turbo',
53+
'gpt-3.5-turbo-0613',
54+
'gpt-3.5-turbo-16k',
55+
'gpt-3.5-turbo-16k-0613',
56+
'gpt-4',
57+
'gpt-4-0613',
58+
'chat-agent-beta',
5959
]
6060

6161
NAGA_MODELS = [

webui_en.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
from modules.overwrites import *
1111
from modules.models.models import get_model
1212

13-
from waitress import serve
14-
15-
import socket
16-
from backend.backend import app
17-
from multiprocessing import Process
18-
1913
import logging
2014

2115
logging.getLogger("httpx").setLevel(logging.WARNING)
@@ -519,23 +513,5 @@ def run_gradio_server():
519513
inbrowser=not dockerflag,
520514
)
521515

522-
site_config = {
523-
'host': '0.0.0.0',
524-
'port': 1337,
525-
'debug': False
526-
}
527-
528-
def run_api_server():
529-
hostname = socket.gethostname()
530-
ip_address = socket.gethostbyname(hostname)
531-
532-
print(f"Running on http://127.0.0.1:{site_config['port']}")
533-
print(f"Running on http://{ip_address}:{site_config['port']}")
534-
535-
serve(app, host='0.0.0.0', port=site_config['port'],threads=4)
536-
537516
if __name__ == "__main__":
538-
api_process = Process(target=run_api_server)
539-
api_process.start()
540-
541517
run_gradio_server()

webui_ru.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
from modules.overwrites import *
1111
from modules.models.models import get_model
1212

13-
from waitress import serve
14-
15-
import socket
16-
from backend.backend import app
17-
from multiprocessing import Process
18-
1913
import logging
2014

2115
logging.getLogger("httpx").setLevel(logging.DEBUG)
@@ -519,25 +513,7 @@ def run_gradio_server():
519513
favicon_path="./assets/favicon.ico",
520514
inbrowser=not dockerflag,
521515
)
522-
523-
site_config = {
524-
'host': '0.0.0.0',
525-
'port': 1337,
526-
'debug': False
527-
}
528-
529-
def run_api_server():
530-
hostname = socket.gethostname()
531-
ip_address = socket.gethostbyname(hostname)
532-
533-
print(f"Running on http://127.0.0.1:{site_config['port']}")
534-
print(f"Running on http://{ip_address}:{site_config['port']}")
535-
536-
serve(app, host='0.0.0.0', port=site_config['port'],threads=4)
537516

538517
if __name__ == "__main__":
539518

540-
api_process = Process(target=run_api_server)
541-
api_process.start()
542-
543519
run_gradio_server()

0 commit comments

Comments
 (0)