Closed infojunkie closed 2 months ago
Hi @infojunkie ! Thanks for raising this issue. I don't think it has anything to do with your memory. You have more than enough normally.
I have yet to comply with the new ggml`s memory allocation API. I will do it in the next few days, which should fix your issue. I'll be sure to ping you on this issue, once it's done.
I edited the line https://github.com/PABannier/bark.cpp/blob/main/bark.cpp#L1269 to change the factor to 1.5 instead of 1.2, and this arbitrary number "fixed" the fine encoder:
[...]
bark_forward_fine_encoder: .....
bark_print_statistics: mem per token = 0.42 MB
bark_print_statistics: sample time = 108.56 ms / 6144 tokens
bark_print_statistics: predict time = 61210.73 ms / 8744.39 ms per token
bark_print_statistics: total time = 61324.55 ms
GGML_ASSERT: /home/kratib/src/misc/bark.cpp/ggml/src/ggml.c:13701: false
Aborted (core dumped)
Now the app crashes at:
static void ggml_compute_forward_conv_1d_stage_0(
const struct ggml_compute_params * params,
const struct ggml_tensor * src0,
const struct ggml_tensor * src1,
struct ggml_tensor * dst) {
switch(src0->type) {
case GGML_TYPE_F16:
{
ggml_compute_forward_conv_1d_stage_0_f32(params, src0, src1, dst);
} break;
default:
{
GGML_ASSERT(false);
} break;
}
}
It would seem the function is called with GGML_TYPE_F32
tensors. Not sure how to proceed.
@PABannier is there a workaround for this? i'm running into the same issue as well
Same problem here
Also having this issue.
I'm able to build and run when I switch to this commit:
git checkout 07e651618b3a8a27de3bfa7f733cdb0aa8f46b8a
I also switched the ggml/ checkout to master branch too, not sure if that matters though or not.
Posting to hopefully help figure out what is wrong. I will look closer at it but am not familiar with the code so not sure how much I can help explain why this works.
Hi @groovybits @lin72h ! Thanks for taking the time to find a partial fix.
With the upcoming #124 this should be fixed as the memory estimation is delegated to ggml-alloc
, instead of my hacky estimate. I'll try to have it merged asap.
@groovybits I tried switching the commit and does not run, builds fail. It looks like ggml/ is using a custom fork done by @PABannier with some changes to get it to work, REFLEC pieces added. So unsure of as to how you got that commit to work.
I wouldn't mind if a hacky solution was implemented in the meantime, as long as the master branch or some branch has a working interface I can get started with. If anything needs to be implemented I also am willing to make a PR.
Best of luck to the refactor @PABannier, this is a massive undertaking and will be very impressive if everything starts working!
Hello All,
This should now be fixed with #139 . Could you give it a try?
Thanks, I was able to generate an audio with the latest. The instructions in this repo are not up to date, so here's what I did:
encodec_load_model_weights: loading model from './encodec_weights.bin'
encodec_load_model_weights: failed to open './encodec_weights.bin'
encodec_load_model: failed to load model weights from './encodec_weights.bin'
bark_generate_audio: error during loading encodec model
cd encodec.cpp
cd encodec.cpp
mkdir ggml_weights
curl https://dl.fbaipublicfiles.com/encodec/v0/encodec_24khz-d7cc33bc.th -o ggml_weights/encodec_24khz-d7cc33bc.th
python convert.py --dir-model ./ggml_weights/ --out-dir ./ggml_weights/ --use-f16
cd ..
ln -s encodec.cpp/ggml_weights/ggml-model.bin encodec_weights.bin
./build/examples/main/main -m ./ggml_weights/ -p "this is an audio"
Thanks for the detailed instructions @infojunkie !
In #151 , I greatly simplified the instructions. They should be more straight forward now. We also support bark-small
which is a smaller version of Bark developed by Suno, which should not cause memory issues.
Following your instructions, I get the following:
Is this related to my machine memory?