PABannier / bark.cpp

Suno AI's Bark model in C/C++ for fast text-to-speech
MIT License
631 stars 48 forks source link

List of errors in build and seg fault on inference #133

Open ti3x opened 3 months ago

ti3x commented 3 months ago

I started off from update_submodule branch

/oos/bark.cpp/bark/bark.cpp:2048:43: error: use of undeclared identifier 'encodec_verbosity_level'; did you mean 'bark_verbosity_level'?
        encodec_model_path, n_gpu_layers, encodec_verbosity_level::LOW);
                                          ^~~~~~~~~~~~~~~~~~~~~~~
                                          bark_verbosity_level
/oos/bark.cpp/bark/./bark.h:23:12: note: 'bark_verbosity_level' declared here
enum class bark_verbosity_level {
           ^
/oos/bark.cpp/bark/bark.cpp:2047:37: error: no matching function for call to 'encodec_load_model'
    struct encodec_context * ectx = encodec_load_model(
                                    ^~~~~~~~~~~~~~~~~~
/oos/bark.cpp/encodec.cpp/./encodec.h:193:26: note: candidate function not viable: requires 2 arguments, but 3 were provided
struct encodec_context * encodec_load_model(
                         ^
/oos/bark.cpp/bark/bark.cpp:2060:5: error: use of undeclared identifier 'encodec_set_sample_rate'
    encodec_set_sample_rate(ectx, sample_rate);
    ^
3 errors generated.
make[2]: *** [CMakeFiles/bark.dir/bark.cpp.o] Error 1
make[1]: *** [CMakeFiles/bark.dir/all] Error 2
make: *** [all] Error 2

I added fixes here: https://github.com/PABannier/bark.cpp/pull/132 https://github.com/PABannier/encodec.cpp/pull/34

But even then, the example ./bark/build/examples/main/main -m ./ggml_weights/ -p "this is an audio" will produce noise, and any string other than "this is an audio" will cause a segmentation fault. This is on M macOS. Cmake version: cmake version 3.28.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

PABannier commented 2 months ago

This should be fixed with #139 . Could you give it another try?