From 36702d28297839f2b41be9a60e822a4059dbe3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=B8=E9=9B=81?= Date: Thu, 4 Jan 2024 11:28:11 +0800 Subject: [PATCH] funasr1.0 --- .../paraformer-long/infer.sh | 3 ++- .../paraformer/demo.py | 8 ++++---- .../paraformer/finetune.sh | 20 ++++++++++--------- .../paraformer/infer.sh | 4 ++-- funasr/version.txt | 2 +- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/examples/industrial_data_pretraining/paraformer-long/infer.sh b/examples/industrial_data_pretraining/paraformer-long/infer.sh index 8f6ea138c..39942195d 100644 --- a/examples/industrial_data_pretraining/paraformer-long/infer.sh +++ b/examples/industrial_data_pretraining/paraformer-long/infer.sh @@ -22,5 +22,6 @@ python funasr/bin/inference.py \ +device="cpu" \ +batch_size_s=300 \ +batch_size_threshold_s=60 \ -+debug="true" ++debug="true" \ ++"hotword='达摩院 魔搭'" diff --git a/examples/industrial_data_pretraining/paraformer/demo.py b/examples/industrial_data_pretraining/paraformer/demo.py index 3c3309c56..119e14fcc 100644 --- a/examples/industrial_data_pretraining/paraformer/demo.py +++ b/examples/industrial_data_pretraining/paraformer/demo.py @@ -5,17 +5,17 @@ from funasr import AutoModel -model = AutoModel(model="/Users/zhifu/Downloads/modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch") +model = AutoModel(model="../modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch") -res = model(input="/Users/zhifu/Downloads/modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/example/asr_example.wav") +res = model(input="../modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/example/asr_example.wav") print(res) from funasr import AutoFrontend -frontend = AutoFrontend(model="/Users/zhifu/Downloads/modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch") +frontend = AutoFrontend(model="../modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch") -fbanks = frontend(input="/Users/zhifu/funasr_github/test_local/wav.scp", batch_size=2) +fbanks = frontend(input="../modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/example/asr_example.wav", batch_size=2) for batch_idx, fbank_dict in enumerate(fbanks): res = model(**fbank_dict) diff --git a/examples/industrial_data_pretraining/paraformer/finetune.sh b/examples/industrial_data_pretraining/paraformer/finetune.sh index ce1953cb3..6dca09f83 100644 --- a/examples/industrial_data_pretraining/paraformer/finetune.sh +++ b/examples/industrial_data_pretraining/paraformer/finetune.sh @@ -1,12 +1,14 @@ -cmd="funasr/bin/train.py" +# download model +local_path_root=../modelscope_models +mkdir -p ${local_path_root} +local_path=${local_path_root}/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch +git clone https://www.modelscope.cn/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch.git ${local_path} -python $cmd \ -+model="/Users/zhifu/modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch" \ -+token_list="/Users/zhifu/.cache/modelscope/hub/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/tokens.txt" \ -+train_data_set_list="/Users/zhifu/funasr_github/test_local/aishell2_dev_ios/asr_task_debug_len.jsonl" \ -+output_dir="/Users/zhifu/Downloads/ckpt/funasr2/exp2" \ -+device="cpu" -#--config-path "/Users/zhifu/funasr_github/examples/industrial_data_pretraining/paraformer-large/conf" \ -#--config-name "finetune.yaml" \ \ No newline at end of file +python funasr/bin/train.py \ ++model="../modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch" \ ++token_list="../modelscope_models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/tokens.txt" \ ++train_data_set_list="data/list/audio_datasets.jsonl" \ ++output_dir="outputs/debug/ckpt/funasr2/exp2" \ ++device="cpu" \ No newline at end of file diff --git a/examples/industrial_data_pretraining/paraformer/infer.sh b/examples/industrial_data_pretraining/paraformer/infer.sh index c7487e269..a9bd8cd87 100644 --- a/examples/industrial_data_pretraining/paraformer/infer.sh +++ b/examples/industrial_data_pretraining/paraformer/infer.sh @@ -1,9 +1,9 @@ # download model -local_path_root=./modelscope_models +local_path_root=../modelscope_models mkdir -p ${local_path_root} local_path=${local_path_root}/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch -git clone https://www.modelscope.cn/damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404.git ${local_path} +git clone https://www.modelscope.cn/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch.git ${local_path} python funasr/bin/inference.py \ diff --git a/funasr/version.txt b/funasr/version.txt index 1e9b46b22..3eefcb9dd 100644 --- a/funasr/version.txt +++ b/funasr/version.txt @@ -1 +1 @@ -0.8.7 +1.0.0