PABannier / encodec.cpp

Port of Meta's Encodec in C/C++
187 stars 14 forks source link

I can't find ggml_weights. I build ggml, but none of those libs were comparable with Encodec. #35

Open monircsueb opened 4 months ago

monircsueb commented 4 months ago

Sir, I am trying to compress audio with the examples provided in the short video. I don't find the ggml_model.bin. I would appreciate if you could guide me to correct direction. Thank you

d503i330 commented 4 months ago

Hi monircsueb. You can use the convert script to create the ggml

PABannier commented 4 months ago

Hello @monircsueb !

The instructions have been updated. Could you try again?

romitjain commented 3 months ago

@PABannier I still don't see the script to download weights.

romitjain commented 3 months ago

Okay, in case someone is not able to find it, you'll have to manually download encoded weights from torch hub:

import torch
url = 'https://dl.fbaipublicfiles.com/encodec/v0/encodec_24khz-d7cc33bc.th'
state = torch.hub.load_state_dict_from_url(url, map_location='cpu', check_hash=True)

Once this is done, you can use the convert script provided to convert the weights to ggml

python convert.py \
        --dir-model ~/.cache/torch/hub/checkpoints/ \
        --out-dir ./ggml_weights/ \
        --use-f16
PABannier commented 2 months ago

Thanks for your message, I'll update the instructions in the README file and add a download_weights.py script.