Artrajz / vits-simple-api

A simple VITS HTTP API, developed by extending Moegoe with additional features.
GNU Affero General Public License v3.0
823 stars 121 forks source link

gunicorn worker 崩溃 #96

Closed xinhecuican closed 1 year ago

xinhecuican commented 1 year ago

我是使用docker部署的 image 每次调用接口过一会就会出现上面的提示。

xinhecuican commented 1 year ago

日志文件 INFO:root:Loading yaml from /app/config.yml 2023-11-19 13:20:06 [INFO] [ModelManager._load_model_from_path:217] model_type:VITS model_id:0 n_speakers:4 model_path:/app/Model/Nene_Nanami_Rong_Tang/1374_epochs.pth 2023-11-19 13:20:06 [INFO] [ModelManager.log_device_info:142] PyTorch Version: 1.13.1+cpu Cuda available:False Device type:cpu 2023-11-19 13:20:07 [INFO] [ModelManager.log_device_info:155] Using CPU on Intel(R) Core(TM) i7-7700T CPU @ 2.90GHz with 4 cores and 8 threads. 2023-11-19 13:20:07 [INFO] [ModelManager.model_init:87] [VITS] 4 speakers 2023-11-19 13:20:07 [INFO] [ModelManager.model_init:95] 4 speakers in total. 2023-11-19 13:20:07 [INFO] [phrases_dict.phrases_dict_init:30] Loading phrases_dict 2023-11-19 13:20:08 [WARNING] [phrases_dict.load_phrases_from_file:24] File /app/phrases_dict.txt not found. You can create /app/phrases_dict.txt and write your phrases_dict. Building prefix dict from the default dictionary ... 2023-11-19 13:20:08 [DEBUG] [init.initialize:113] Building prefix dict from the default dictionary ... 2023-11-19 13:20:08 [DEBUG] [init.initialize:132] Loading model from cache /tmp/jieba.cache Loading model from cache /tmp/jieba.cache Loading model cost 0.621 seconds. Prefix dict has been built successfully. 2023-11-19 13:20:09 [DEBUG] [init.initialize:164] Loading model cost 0.621 seconds. 2023-11-19 13:20:09 [DEBUG] [init.initialize:166] Prefix dict has been built successfully. 2023-11-19 13:20:09 [INFO] [base.start:181] Scheduler started 2023-11-19 13:20:09 [INFO] [base._real_add_job:895] Added job "clean_task" to job store "default" [2023-11-19 13:20:09 +0800] [1] [INFO] Starting gunicorn 21.2.0 [2023-11-19 13:20:09 +0800] [1] [INFO] Listening at: http://0.0.0.0:23456 (1) [2023-11-19 13:20:09 +0800] [1] [INFO] Using worker: sync [2023-11-19 13:20:09 +0800] [37] [INFO] Booting worker with pid: 37 Objects frozen in perm gen: 1996774 2023-11-19 13:21:04 [INFO] [views.voice_vits_api:71] [VITS] id:0 format:wav lang:auto length:1 noise:0.33 noisew:0.4 segment_size:50 2023-11-19 13:21:04 [INFO] [views.voice_vits_api:73] [VITS] len:2 text:你好 2023-11-19 13:21:04 [INFO] [langid.load_model:162] initializing identifier 2023-11-19 13:21:05 [DEBUG] [sentence.sentence_split_and_markup:128] [ZH]你好[ZH] 2023-11-19 13:21:06 [INFO] [download._download_file:22] Downloading: https://github.com/r9y9/open_jtalk/releases/download/v1.11.1/open_jtalk_dic_utf_8-1.11.tar.gz 2023-11-19 13:21:08 [INFO] [download._download_file:22] Downloading: https://objects.githubusercontent.com/github-production-release-asset-2e65be/45774148/cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream

cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 0%| | 0.00/22.6M [00:00<?, ?B/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 4%|▍ | 1.00M/22.6M [00:00<00:20, 1.10MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 9%|▉ | 2.00M/22.6M [00:01<00:10, 2.03MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 13%|█▎ | 3.00M/22.6M [00:01<00:06, 2.97MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 18%|█▊ | 4.00M/22.6M [00:01<00:05, 3.78MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 27%|██▋ | 6.00M/22.6M [00:01<00:03, 5.54MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 35%|███▌ | 8.00M/22.6M [00:01<00:02, 7.27MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 44%|████▍ | 10.0M/22.6M [00:02<00:01, 8.66MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 53%|█████▎ | 12.0M/22.6M [00:02<00:01, 10.0MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 62%|██████▏ | 14.0M/22.6M [00:02<00:00, 10.7MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 71%|███████ | 16.0M/22.6M [00:02<00:00, 11.5MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 75%|███████▌ | 17.0M/22.6M [00:02<00:00, 9.89MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 84%|████████▍ | 19.0M/22.6M [00:02<00:00, 11.2MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 93%|█████████▎| 21.0M/22.6M [00:02<00:00, 12.1MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 98%|█████████▊| 22.0M/22.6M [00:03<00:00, 11.6MB/s] cf290182-252c-43ac-81d8-c3ac9b3f137f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231119%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231119T052107Z&X-Amz-Expires=300&X-Amz-Signature=6aa448bbea4ad9ebfff636a3896ff556ba949d65107529dd66279140773d3aa8&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=45774148&response-content-disposition=attachment%3B%20filename%3Dopen_jtalk_dic_utf_8-1.11.tar.gz&response-content-type=application%2Foctet-stream: 100%|██████████| 22.6M/22.6M [00:03<00:00, 7.59MB/s]

Artrajz commented 1 year ago

日志中只看到正在下载pyopenjtalk的词典,如果反复提示gunicorn worker timeout,可以尝试在gunicorn_config.py将timeout超时时间设置长一点,例如:

preload_app = True
timeout = 90

如果还是解决不了,也可以不先使用gunicorn来启动。修改docker-compose.yaml文件,加一行command: ['python', 'app.py']

services:
  vits:
    image: artrajz/vits-simple-api:latest-gpu
    restart: always
    ports:
      - 23456:23456
    environment:
      LANG: 'C.UTF-8'
      TZ: Asia/Shanghai #timezone
    command: ['python', 'app.py']
xinhecuican commented 1 year ago

我是用本地环境部署成功了,应该是docker没配代理的问题。非常感谢