docs: update readme

This commit is contained in:
aceforeverd
2025-08-29 10:48:15 +08:00
parent 9085bc4ef4
commit 43c1424b0e
2 changed files with 18 additions and 17 deletions

View File

@@ -1,12 +1,13 @@
FROM git.modelhub.org.cn:9443/enginex-metax/maca-c500-pytorch:2.33.0.6-torch2.6-py310-ubuntu24.04-amd64
RUN /opt/conda/bin/pip install funasr modelscope huggingface_hub
RUN /opt/conda/bin/pip install openai-whisper
RUN chmod 1777 -R /tmp && apt update && apt install -y ffmpeg
# RUN chmod 1777 -R /tmp && apt update && apt install -y ffmpeg
WORKDIR /opt/app
COPY ./ ./
RUN /opt/conda/bin/pip install -r requirements.txt
EXPOSE 80
ENTRYPOINT ["python3", "./test_funasr.py"]
ENTRYPOINT ["/opt/conda/bin/python3", "./test_funasr.py"]

View File

@@ -1,7 +1,7 @@
# 沐曦 MetaX C500 FunASR
## 镜像构造
```shell
```bash
docker build -t <built_img> .
```
@@ -9,19 +9,19 @@ docker build -t <built_img> .
### 快速镜像测试
对funasr的测试需要在以上构造好的镜像容器内测试测试步骤
1. 本项目中附带上了示例测试数据,音频文件为`lei-jun-test.wav`,音频的识别准确内容文件为`lei-jun.txt`用户需要准备好相应的ASR模型路径本例中假设我们已经下载好了SenseVoiceSmall模型存放于/model/SenseVoiceSmall
2. 在本项目路径下执行以下快速测试命令
```shell
metax-docker run -it \
--gpus=[0] \
-v $PWD:/tmp/workspace \
-v /model:/model \
-e MODEL_DIR=/model/SenseVoiceSmall \
-e TEST_FILE=lei-jun-test.wav \
-e ANSWER_FILE=lei-jun.txt \
-e RESULT_FILE=result.json \
--cpus=4 --memory=16g \
<built_img>
```
2. 在本项目路径下执行以下快速测试命令, 如果安装了 [metax-docker](https://developer.metax-tech.com/softnova/category?package_kind=Cloud&dimension=metax&chip_name=%E6%9B%A6%E4%BA%91C500%E7%B3%BB%E5%88%97&deliver_type=%E5%88%86%E5%B1%82%E5%8C%85&series_name=metax-docker):
```bash
metax-docker run -it \
--gpus=[0] \
-v $PWD:/tmp/workspace \
-v /model:/model \
-e MODEL_DIR=/model/SenseVoiceSmall \
-e TEST_FILE=lei-jun-test.wav \
-e ANSWER_FILE=lei-jun.txt \
-e RESULT_FILE=result.json \
--cpus=4 --memory=16g \
<built_img>
```
上述测试指令成功运行将会在terminal中看到对测试音频的识别结果运行时间以及1-cer效果指标并且当前文件下会生成一个`result.json`文件记录刚才的测试结果
### 定制化手动运行
@@ -37,4 +37,4 @@ metax-docker run -it \
| whisper | https://www.modelscope.cn/models/iic/Whisper-large-v3 | 23.8337 | ? | 0.910150 | ? | |
| paraformer | https://modelscope.cn/models/iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch | 3.9888 | 4.8517 | 0.955075 | 0.955075 | |
| conformer | https://www.modelscope.cn/models/iic/speech_conformer_asr_nat-zh-cn-16k-aishell2-vocab5212-pytorch | 80.4228 | 78.2914 | 0.349418 | 0.346090 | |
| uni_asr | https://www.modelscope.cn/models/iic/speech_UniASR-large_asr_2pass-zh-cn-16k-common-vocab8358-tensorflow1-offline | 90.8399 | 68.6999 | 0.717138 | 0.717138 | 该部分的适配修改了一些funASR源码 |
| uni_asr | https://www.modelscope.cn/models/iic/speech_UniASR-large_asr_2pass-zh-cn-16k-common-vocab8358-tensorflow1-offline | 90.8399 | 68.6999 | 0.717138 | 0.717138 | |