netease-youdao / QAnything

Question and Answer based on Anything.
https://qanything.ai
GNU Affero General Public License v3.0
11.54k stars 1.12k forks source link

[BUG] ocr service (3/8) 启动失败! #271

Open ysun opened 5 months ago

ysun commented 5 months ago

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

当前行为 | Current Behavior

在启动后端的时候,失败了就一句错误信息: (core dumped) CUDA_VISIBLE_DEVICES=$gpu_id1 nohup /opt/tritonserver/bin/tritonserver

实际上是这段脚本失败了,然后监听不到启动成功。

nohup python3 -u qanything_kernel/qanything_server/sanic_api.py --mode "local" > /workspace/qanything_local/logs/debug_logs/sanic_api.log 2>&1 &

# 监听后端服务启动
backend_start_time=$(date +%s)

while ! grep -q "Starting worker" /workspace/qanything_local/logs/debug_logs/sanic_api.log; do
    echo "Waiting for the backend service to start..."
    echo "等待启动后端服务"
    sleep 1

    # 获取当前时间并计算经过的时间
    current_time=$(date +%s)
    elapsed_time=$((current_time - backend_start_time))

    # 检查是否超时
    if [ $elapsed_time -ge 120 ]; then
        echo "启动后端服务超时,请检查日志文件 /workspace/qanything_local/logs/debug_logs/sanic_api.log 获取更多信息。"
        exit 1
    fi
    sleep 5
done

期望行为 | Expected Behavior

No response

运行环境 | Environment

- OS: Ubuntu 22.04
- NVIDIA Driver:530.30.02
- CUDA: 12.1
- docker:  26.0.1, build d260a54
- docker-compose:  version 1.29.2
- NVIDIA GPU: NVIDIA GeForce RTX 3080
- NVIDIA GPU Memory: 10240MiB

QAnything日志 | QAnything logs

qanything-container-local | llm_api is set to [local]
qanything-container-local | device_id is set to [0]
qanything-container-local | runtime_backend is set to [default]
qanything-container-local | model_name is set to [-t]
qanything-container-local | conv_template is set to []
qanything-container-local | tensor_parallel is set to [1]
qanything-container-local | gpu_memory_utilization is set to [0.81]
qanything-container-local | checksum e18e2231b7a37236b1ac5b3c30277b48
qanything-container-local | default_checksum e18e2231b7a37236b1ac5b3c30277b48
qanything-container-local | GPU ID: 0, 0
qanything-container-local | GPU1 Model: NVIDIA GeForce RTX 3080
qanything-container-local | Compute Capability: 8.6
qanything-container-local | OCR_USE_GPU=True because 8.6 >= 7.5
qanything-container-local | ====================================================
qanything-container-local | ******************** ������������ ********************
qanything-container-local | ====================================================
qanything-container-local |
qanything-container-local | ��������������������� 10240 MiB���������������3B���3B���������������������������������OpenAI AP
I
qanything-container-local | Executing default FastTransformer runtime_backend
qanything-container-local | The triton server will start on 0 GPU
qanything-container-local | The llm transfer service is ready! (1/8)
qanything-container-local | ������������������������������! (1/8)
qanything-container-local | The rerank service is ready! (2/8)
qanything-container-local | rerank���������������! (2/8)
qanything-container-local | The ocr service is ready! (3/8)
qanything-container-local | OCR���������������! (3/8)
qanything-container-local | Waiting for the backend service to start...
qanything-container-local | ������������������������
qanything-container-local | Waiting for the backend service to start...
qanything-container-local | ������������������������
qanything-container-local | Waiting for the backend service to start...
qanything-container-local | ������������������������
qanything-container-local | Waiting for the backend service to start...
qanything-container-local | ������������������������
qanything-container-local | /workspace/qanything_local/scripts/run_for_local_option.sh: line 401:   176 Segmentation fault
     (core dumped) CUDA_VISIBLE_DEVICES=$gpu_id1 nohup /opt/tritonserver/bin/tritonserver --model-store=/model_repos/QAEnse
mble --http-port=10000 --grpc-port=10001 --metrics-port=10002 --log-verbose=1 > /workspace/qanything_local/logs/debug_logs/
llm_embed_rerank_tritonserver.log 2>&1

复现方法 | Steps To Reproduce

bash ./run.sh

备注 | Anything else?

另外,在启动初期,中文字符是正常的,脚本进到run_for_local_option.sh 之后,中文字符就成乱码了,尝试过export LANG 也不好用。

cakat commented 5 months ago

https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/craft_mlt_25k.zip https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/zh_sim_g2.zip 解压后保存至~/.EasyOCR/model (说明:需要在HOME目录下,选择显示隐藏文件才能看到.EasyOCR目录)