songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
18.23k stars 4.12k forks source link

docker 启动后卡在initializing token encoders #564

Closed bincooo closed 1 year ago

bincooo commented 1 year ago

例行检查

问题描述 如题,启动后卡在initializing token encoders 要等很久才加载完毕

[root@VM-20-17-opencloudos fastgpt]# docker logs -f oneapi
[SYS] 2023/09/28 - 12:41:51 | One API v0.5.6-alpha.7 started
[SYS] 2023/09/28 - 12:41:51 | SQL_DSN not set, using SQLite as database
[SYS] 2023/09/28 - 12:41:51 | database migrated
[SYS] 2023/09/28 - 12:41:51 | REDIS_CONN_STRING not set, Redis is not enabled
[SYS] 2023/09/28 - 12:41:51 | initializing token encoders
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model dall-e
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model Embedding-V1
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model chatglm_lite
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model text-embedding-v1
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model SparkDesk
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model qwen-turbo
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model 360GPT_S2_V9.4
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model whisper-1
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model claude-2
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model ERNIE-Bot-turbo
[SYS] 2023/09/28 - 12:43:57 | using fallback encoder for model qwen-plus
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model text-moderation-stable
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model ERNIE-Bot
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model chatglm_pro
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model embedding-bert-512-v1
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model 360GPT_S2_V9
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model text-moderation-latest
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model PaLM-2
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model chatglm_std
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model embedding_s1_v1
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model semantic_similarity_s1_v1
[SYS] 2023/09/28 - 12:43:58 | token encoders initialized
[SYS] 2023/09/28 - 12:43:58 | using fallback encoder for model claude-instant-1
[INFO] 2023/09/28 - 12:45:16 | 20230928124516589231051vOpyHLAJ | user 1 has enough quota 60170669, trusted and no need to pre-consume

以上日志算快的,有时卡着20分钟都没有初始化完成。 这是什么原因?

复现步骤

预期结果

相关截图 如果没有的话,请删除此节。

songquanpeng commented 1 year ago

网络问题,用的库需要从网络加载文件。

canghai118 commented 10 months ago

网络问题,用的库需要从网络加载文件。

我升级到最新版后,也是遇到这个问题。 可以改成从本地加载吗。 我把one-api跑在serverless环境下, 启动速度比较关键。

songquanpeng commented 10 months ago

可以的,你本地跑起来后把下面的这个文件夹内容复制过去试一下呢 image

Lesueaen commented 7 months ago

Last failed login: Mon Mar 4 22:11:47 CST 2024 from 118.163.63.23 on ssh:notty There were 24 failed login attempts since the last successful login. Last login: Mon Mar 4 21:44:42 2024 from 127.0.0.1 -bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8) [root@VM-20-4-centos ~]# [root@VM-20-4-centos one-api]# Last login: Mon Mar 4 22:15:31 2024 from 127.0.0.1 cd /www/wwwroot/oneapi.lesu66.com/one-api -bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8) [root@VM-20-4-centos ~]# cd /www/wwwroot/oneapi.lesu66.com/one-api [root@VM-20-4-centos one-api]# chmod u+x one-api [root@VM-20-4-centos one-api]# ./one-api --port 3000 --log-dir ./logs [SYS] 2024/03/04 - 22:15:40 | One API v0.0.0 started [SYS] 2024/03/04 - 22:15:40 | SQL_DSN not set, using SQLite as database [SYS] 2024/03/04 - 22:15:40 | database migration started [SYS] 2024/03/04 - 22:15:40 | database migrated [SYS] 2024/03/04 - 22:15:40 | REDIS_CONN_STRING not set, Redis is not enabled [SYS] 2024/03/04 - 22:15:40 | using theme default [SYS] 2024/03/04 - 22:15:40 | initializing token encoders [SYS] 2024/03/04 - 22:15:40 | token encoders initialized