Skip to content

Commit

Permalink
v1.5.4 - Full migration to neuroapi.hsot has been initiated
Browse files Browse the repository at this point in the history
  • Loading branch information
neurogen-dev committed Oct 23, 2023
1 parent 9d9ced8 commit 1bea1b4
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 67 deletions.
8 changes: 4 additions & 4 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"openai_api_key": "",
"purgpt_api_key": "",
"chatty_api_key": "",
"daku_api_key": "",
"chatty_api_key": "",
"usage_limit": 999,
"language": "ru_RU",
"users": [],
Expand All @@ -27,6 +27,6 @@
"sk-xxxxxxxxxxxxxxxxxxxxxxxx2",
"sk-xxxxxxxxxxxxxxxxxxxxxxxx3"
],
"server_name": "0.0.0.0",
"share": false
}
"server_name": "0.0.0.0",
"share": false
}
1 change: 1 addition & 0 deletions lang.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ru_RU
2 changes: 1 addition & 1 deletion modules/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def summarize_index(self, files, chatbot, language):
status = "Полный"
logging.info("Создание сводки контента...")
os.environ["OPENAI_API_KEY"] = self.api_key
os.environ["OPENAI_API_BASE"] = "http://127.0.0.1:1337"
os.environ["OPENAI_API_BASE"] = "https://neuroapi.host"
from langchain.chains.summarize import load_summarize_chain
from langchain.prompts import PromptTemplate
from langchain.chat_models import ChatOpenAI
Expand Down
4 changes: 2 additions & 2 deletions modules/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def _get_api_url(self):
url = "https://chattyapi.tech/v1/chat/completions"
elif "daku" in self.model_name:
url = "https://api.daku.tech/v1/chat/completions"
elif self.model_name.startswith('neuro-gpt-4') or self.model_name.startswith('neuro-gpt-4-'):
elif self.model_name.startswith('gpt-4') or self.model_name.startswith('gpt-4-'):
url = "https://neuroapi.host/gpt4/v1/chat/completions"
else:
url = "http://127.0.0.1:1337/v1/chat/completions"
url = "https://neuroapi.host/v1/chat/completions"
return url

def _get_headers(self):
Expand Down
24 changes: 12 additions & 12 deletions modules/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests
import json

VERSION = "v 1.5.3"
VERSION = "v 1.5.4"

CHATGLM_MODEL = None
CHATGLM_TOKENIZER = None
Expand All @@ -14,10 +14,10 @@
# ChatGPT 设置

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."
API_HOST = "http://127.0.0.0.1:1337"
COMPLETION_URL = "http://127.0.0.0.1:1337/v1/chat/completions"
BALANCE_API_URL="http://127.0.0.0.1:1337/v1/dashboard/billing/credit_grants"
USAGE_API_URL="http://127.0.0.0.1:1337/v1/dashboard/billing/usage"
API_HOST = "https://neuroapi.host"
COMPLETION_URL = "https://neuroapi.host/v1/chat/completions"
BALANCE_API_URL="https://neuroapi.host/v1/dashboard/billing/credit_grants"
USAGE_API_URL="https://neuroapi.host/v1/dashboard/billing/usage"
HISTORY_DIR = Path("history")
HISTORY_DIR = "history"
TEMPLATES_DIR = "templates"
Expand Down Expand Up @@ -49,13 +49,13 @@

ONLINE_MODELS = [
'gpt-3.5-turbo',
'neuro-gpt-3.5-turbo',
'neuro-gpt-3.5-turbo-0613',
'neuro-gpt-3.5-turbo-16k',
'neuro-gpt-3.5-turbo-16k-0613',
'neuro-gpt-4',
'neuro-gpt-4-0613',
'chat-agent',
'gpt-3.5-turbo',
'gpt-3.5-turbo-0613',
'gpt-3.5-turbo-16k',
'gpt-3.5-turbo-16k-0613',
'gpt-4',
'gpt-4-0613',
'chat-agent-beta',
]

NAGA_MODELS = [
Expand Down
24 changes: 0 additions & 24 deletions webui_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
from modules.overwrites import *
from modules.models.models import get_model

from waitress import serve

import socket
from backend.backend import app
from multiprocessing import Process

import logging

logging.getLogger("httpx").setLevel(logging.WARNING)
Expand Down Expand Up @@ -519,23 +513,5 @@ def run_gradio_server():
inbrowser=not dockerflag,
)

site_config = {
'host': '0.0.0.0',
'port': 1337,
'debug': False
}

def run_api_server():
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)

print(f"Running on http://127.0.0.1:{site_config['port']}")
print(f"Running on http://{ip_address}:{site_config['port']}")

serve(app, host='0.0.0.0', port=site_config['port'],threads=4)

if __name__ == "__main__":
api_process = Process(target=run_api_server)
api_process.start()

run_gradio_server()
24 changes: 0 additions & 24 deletions webui_ru.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
from modules.overwrites import *
from modules.models.models import get_model

from waitress import serve

import socket
from backend.backend import app
from multiprocessing import Process

import logging

logging.getLogger("httpx").setLevel(logging.DEBUG)
Expand Down Expand Up @@ -519,25 +513,7 @@ def run_gradio_server():
favicon_path="./assets/favicon.ico",
inbrowser=not dockerflag,
)

site_config = {
'host': '0.0.0.0',
'port': 1337,
'debug': False
}

def run_api_server():
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)

print(f"Running on http://127.0.0.1:{site_config['port']}")
print(f"Running on http://{ip_address}:{site_config['port']}")

serve(app, host='0.0.0.0', port=site_config['port'],threads=4)

if __name__ == "__main__":

api_process = Process(target=run_api_server)
api_process.start()

run_gradio_server()

0 comments on commit 1bea1b4

Please sign in to comment.