修复使用chatgpt等在线API服务时模型加载错误 (#1271)
* close #1172: 给webui_page/utils添加一些log信息,方便定位错误 * 修复:重建知识库时页面未实时显示进度 * skip model_worker running when using online model api such as chatgpt --------- Co-authored-by: liunux4odoo <liunu@qq.com>
This commit is contained in:
parent
58d5787bdf
commit
6ef8844b2b
|
|
@ -70,7 +70,6 @@ llm_model_dict = {
|
||||||
# 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
|
# 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI.
|
||||||
# 需要添加代理访问(正常开的代理软件可能会拦截不上)需要设置配置openai_proxy 或者 使用环境遍历OPENAI_PROXY 进行设置
|
# 需要添加代理访问(正常开的代理软件可能会拦截不上)需要设置配置openai_proxy 或者 使用环境遍历OPENAI_PROXY 进行设置
|
||||||
"gpt-3.5-turbo": {
|
"gpt-3.5-turbo": {
|
||||||
"local_model_path": "gpt-3.5-turbo",
|
|
||||||
"api_base_url": "https://api.openai.com/v1",
|
"api_base_url": "https://api.openai.com/v1",
|
||||||
"api_key": os.environ.get("OPENAI_API_KEY"),
|
"api_key": os.environ.get("OPENAI_API_KEY"),
|
||||||
"openai_proxy": os.environ.get("OPENAI_PROXY")
|
"openai_proxy": os.environ.get("OPENAI_PROXY")
|
||||||
|
|
|
||||||
18
startup.py
18
startup.py
|
|
@ -404,14 +404,16 @@ if __name__ == "__main__":
|
||||||
processes["openai_api"] = process
|
processes["openai_api"] = process
|
||||||
|
|
||||||
if args.model_worker:
|
if args.model_worker:
|
||||||
process = Process(
|
model_path = llm_model_dict[args.model_name].get("local_model_path", "")
|
||||||
target=run_model_worker,
|
if os.path.isdir(model_path):
|
||||||
name=f"model_worker({os.getpid()})",
|
process = Process(
|
||||||
args=(args.model_name, args.controller_address, queue, len(processes) + 1),
|
target=run_model_worker,
|
||||||
daemon=True,
|
name=f"model_worker({os.getpid()})",
|
||||||
)
|
args=(args.model_name, args.controller_address, queue, len(processes) + 1),
|
||||||
process.start()
|
daemon=True,
|
||||||
processes["model_worker"] = process
|
)
|
||||||
|
process.start()
|
||||||
|
processes["model_worker"] = process
|
||||||
|
|
||||||
if args.api:
|
if args.api:
|
||||||
process = Process(
|
process = Process(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue