bark.cpp
v1.0.0
ロードマップ / encodec.cpp / ggml
純粋なC/C ++におけるSunoaiの樹皮モデルの推論。
bark.cppを使用すると、リアルタイムのリアルな多言語のテキストからスピーチの生成をコミュニティにもたらすことです。
サポートされているモデル
実装したいモデル! PRを開いてください:)
Google Colabのデモ(#95)
bark.cppを使用した典型的な実行です。
./ main - p "This is an audio generated by bark.cpp"
__ __
/ / _ ____ ______ / / __ _________ ____
/ __ / __ `/ ___ / //_/ / ___/ __ / __
/ / _ / / / _ / / / / ,< _ / / __ / / _ / / / _ / /
/ _ . ___ /__,_/ _ / / _ /| _ | ( _ ) ___ / . ___ / . ___ /
/ _ / / _ /
bark_tokenize_input : prompt : 'This is an audio generated by bark.cpp'
bark_tokenize_input : number of tokens in prompt = 513 , first 8 tokens : 20795 20172 20199 33733 58966 20203 28169 20222
Generating semantic tokens : 17 %
bark_print_statistics : sample time = 10.98 ms / 138 tokens
bark_print_statistics : predict time = 614.96 ms / 4.46 ms per token
bark_print_statistics : total time = 633.54 ms
Generating coarse tokens : 100 %
bark_print_statistics : sample time = 3.75 ms / 410 tokens
bark_print_statistics : predict time = 3263.17 ms / 7.96 ms per token
bark_print_statistics : total time = 3274.00 ms
Generating fine tokens : 100 %
bark_print_statistics : sample time = 38.82 ms / 6144 tokens
bark_print_statistics : predict time = 4729.86 ms / 0.77 ms per token
bark_print_statistics : total time = 4772.92 ms
write_wav_on_disk : Number of frames written = 65600.
main : load time = 324.14 ms
main : eval time = 8806.57 ms
main : total time = 9131.68 msこれがiPhoneで実行されている樹皮のビデオです:
Bark.cppを使用する手順は次のとおりです
git clone --recursive https://github.com/PABannier/bark.cpp.git
cd bark.cpp
git submodule update --init --recursiveBark.cppを構築するには、 CMake使用する必要があります。
mkdir build
cd build
# To enable nvidia gpu, use the following option
# cmake -DGGML_CUBLAS=ON ..
cmake ..
cmake --build . --config Release # Install Python dependencies
python3 -m pip install -r requirements.txt
# Download the Bark checkpoints and vocabulary
python3 download_weights.py --out-dir ./models --models bark-small bark
# Convert the model to ggml format
python3 convert.py --dir-model ./models/bark-small --use-f16
# run the inference
./build/examples/main/main -m ./models/bark-small/ggml_weights.bin -p " this is an audio generated by bark.cpp " -t 4次の戦略を使用して重量を量子化できます: q4_0 、 q4_1 、 q5_0 、 q5_1 、 q8_0 。
オーディオの品質を維持するために、コーデックモデルを定量化しないことに注意してください。計算の大部分は、GPTモデルのフォワードパスにあります。
./build/examples/quantize/quantize ./ggml_weights.bin ./ggml_weights_q4.bin q4_0bark.cpp 、長続きして進化するためのコミュニティの努力に依存している継続的な努力です。あなたの貢献は歓迎され、非常に価値があります。それは可能です
bark.cppを使用している間にバグに遭遇する場合があります。問題のセクションでそれを報告することを躊躇しないでください。