Skip to content

lovemefan/paraformer.cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(简体中文|English)

developing ...

paraformer is a chinese asr from funasr. this project provided a port of paraformer model with ggml

  • Define model structure
  • Initialize model
  • Load model parameters and vocabulary
  • fbank + lfr + cmvn feature extraction
  • Build calculation forward graph
    • encoder
    • predictor
    • decoder
    • bias encoder
    • seaco decoder

usage

you need download model from modelscope and convert weight with script

git clone https://github.com/lovemefan/paraformer.cpp
cd git paraformer.cpp
git submodule sync && git submodule update --init --recursive

mkdir build && cd build
cmake ../src/csrc && make -j 8

# download model weight from modelscope
git clone https://www.modelscope.cn/damo/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch.git resource/model
# convert weight and vocab into gguf format
python src/python/convert-pt-to-gguf.py \
  --model /Users/cenglingfan/Code/cpp-project/paraformer.cpp/resource/model/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch \
  --outfile /Users/cenglingfan/Code/cpp-project/paraformer.cpp/resource/model/seaco-paraformer-ggml-model-fp16.bin

Acknowledge

  1. we borrowed and imitated most c++ code from whisper.cpp

  2. we referenced model structure and forward detail from FunASR

  3. we borrowed fbank feature extract algorithm code from kaldi-native-fbank and lrf + cmvn algorithm code fromfunasr

About

Port of Funasr's Paraformer model in C/C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published