k2-fsa / sherpa

Speech-to-text server framework with next-gen Kaldi
https://k2-fsa.github.io/sherpa
Apache License 2.0
473 stars 97 forks source link

sharpa/triton/whisper下面的readme文件里的操作能不能合并到docker file中? #592

Open taorui-plus opened 1 month ago

taorui-plus commented 1 month ago

这是sharpa/triton/whisper下面的readme文件,我想把这里的操作写到dockerfile里面,将server一键run起来,但是标记出来的编译操作在dockerfile中用RUN执行会报很多环境错误,直接在docker中执行没有这些问题,想知道这个操作是不是不适合写在dockerfile中。

执行的操作:


# Build the large-v3 model using a single GPU with plugins.
python3 build.py --output_dir whisper_large_v3 --use_gpt_attention_plugin --use_gemm_plugin  --use_bert_attention_plugin --enable_context_fmha

报错:


OSError: libcuda.so.1: cannot open shared object file: No such file or directory

解决:


export LD_LIBRARY_PATH=/usr/local/cuda-12.4/compat/lib.real:$LD_LIBRARY_PATH

继续报错:


TypeError: pybind11::init(): factory function returned nullptr

@yuekaizhang

taorui-plus commented 1 month ago

在 Dockerfile 中使用 RUN 命令执行 Python 脚本可能会遇到一些问题,因为 Dockerfile 中的每个 RUN 命令都在一个新的层中执行,这意味着它们不会共享环境变量或其他状态。 解决方案是使用一个 shell 脚本来执行所有的命令,然后在 Dockerfile 中运行这个脚本