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 비디오입니다.
Bark.cpp를 사용하는 단계는 다음과 같습니다
git clone --recursive https://github.com/PABannier/bark.cpp.git
cd bark.cpp
git submodule update --init --recursive bark.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_0 bark.cpp 는 지속적인 노력과 진화를위한 지역 사회의 노력에 의존하는 지속적인 노력입니다. 당신의 기여는 환영하고 매우 가치가 있습니다. 그럴 수 있습니다
bark.cpp 사용하는 동안 버그가 발생할 수 있습니다. 주저하지 말고 문제 섹션에보고하십시오.