首先把代码下载下来
git@github.com:FunAudioLLM/SenseVoice.git
然后写一个docker文件
FROM ubuntu:latestRUN apt-get update -y
RUN apt-get install -y python3-full python3-pip
RUN mkdir -p /SenseVoice
WORKDIR /SenseVoice
RUN python3 -m venv .
ENV USE_CUDA=0
EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"
RUN ./bin/pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https://download.pytorch.org/whl/cpu
COPY . .
RUN ./bin/pip install -r requirements.txt
由于这里我是Mac电脑不带GPU,所以就用了pytorch的不带GPU的安装模式,如果需要对应GPU的安装方式,可以去pytorch官网看。
第三部,启动容器,把7860端口映射。启动,就可以在http://localhost:7860/?上看到服务了。
然后就可以录音,通过录音进行转换了。考虑我是苹果全家桶,苹果语音转文字的情况使用。
./ffmpeg -i test.m4a output.wav