Coder Social home page Coder Social logo

Download the models manually about bark HOT 15 CLOSED

suno-ai avatar suno-ai commented on May 31, 2024 4
Download the models manually

from bark.

Comments (15)

gkucsko avatar gkucsko commented on May 31, 2024 5

these should be all the current models needed:

# download small models
wget -c https://dl.suno-models.io/bark/models/v0/text.pt -O ~/.cache/suno/bark_v0/41a4361a0bb21b667a35fbf76a309a77.pt
wget -c https://dl.suno-models.io/bark/models/v0/coarse.pt -O ~/.cache/suno/bark_v0/db7988c269f58606a4b3a3d3497c6b95.pt
wget -c https://dl.suno-models.io/bark/models/v0/fine.pt -O ~/.cache/suno/bark_v0/0f6f3420c8bb574f74e75e6f7f59a510.pt
    
# download large models
wget -c https://dl.suno-models.io/bark/models/v0/text_2.pt -O ~/.cache/suno/bark_v0/e32937063d7ccececc61b2d2a3bb0a13.pt
wget -c https://dl.suno-models.io/bark/models/v0/coarse_2.pt -O ~/.cache/suno/bark_v0/751d4d3d562e63ead5311ebe2a5f45a8.pt
wget -c https://dl.suno-models.io/bark/models/v0/fine_2.pt -O ~/.cache/suno/bark_v0/6285677e88715abde42a9924db939b3b.pt

from bark.

khimaros avatar khimaros commented on May 31, 2024 5

this should work to download all of the files (with resume):

for model in text coarse fine text_2 coarse_2 fine_2; do
    remote_url="https://dl.suno-models.io/bark/models/v0/${model}.pt"
    remote_md5=$(echo -en "${remote_url}" | md5sum | awk '{ print $1 }')
    out_path=~/.cache/suno/bark_v0/${remote_md5}.pt
    echo "fetching model ${model} ${remote_url} to ${out_path} ..."
    wget -c "${remote_url}" -O "${out_path}"
done

this is the list of files with their md5sum after finishing on my computer:

$ md5sum ~/.cache/suno/bark_v0/* | sed -r 's/\/home\/(.*?)\/.cache\///g'
5428d1befe05be2ba32195496e58dc90  suno/bark_v0/0f6f3420c8bb574f74e75e6f7f59a510.pt
b3e42bcbab23b688355cd44128c4cdd3  suno/bark_v0/41a4361a0bb21b667a35fbf76a309a77.pt
59d184ed44e3650774a2f0503a48a97b  suno/bark_v0/6285677e88715abde42a9924db939b3b.pt
8a98094e5e3a255a5c9c0ab7efe8fd28  suno/bark_v0/751d4d3d562e63ead5311ebe2a5f45a8.pt
5fe964825e3b0321f9d5f3857b89194d  suno/bark_v0/db7988c269f58606a4b3a3d3497c6b95.pt
54afa89d65e318d4f5f80e8e8799026a  suno/bark_v0/e32937063d7ccececc61b2d2a3bb0a13.pt

and the checksums as stored in generate.py:

$ grep -B1 checksum ~/.cache/pypoetry/virtualenvs/third-brain-IMBisF_0-py3.10/lib/python3.10/site-packages/bark/generation.py
        "path": os.path.join(REMOTE_BASE_URL, "text.pt"),
        "checksum": "b3e42bcbab23b688355cd44128c4cdd3",
--
        "path": os.path.join(REMOTE_BASE_URL, "coarse.pt"),
        "checksum": "5fe964825e3b0321f9d5f3857b89194d",
--
        "path": os.path.join(REMOTE_BASE_URL, "fine.pt"),
        "checksum": "5428d1befe05be2ba32195496e58dc90",
--
        "path": os.path.join(REMOTE_BASE_URL, "text_2.pt"),
        "checksum": "54afa89d65e318d4f5f80e8e8799026a",
--
        "path": os.path.join(REMOTE_BASE_URL, "coarse_2.pt"),
        "checksum": "8a98094e5e3a255a5c9c0ab7efe8fd28",
--
        "path": os.path.join(REMOTE_BASE_URL, "fine_2.pt"),
        "checksum": "59d184ed44e3650774a2f0503a48a97b",

actually looks like everything matches up nicely.

from bark.

khimaros avatar khimaros commented on May 31, 2024 2

@flyisland maybe you are concatenating the strings incorrectly. here's what worked for me:

for model in text_2 coarse_2 fine_2; do
    wget https://dl.suno-models.io/bark/models/v0/${model}.pt
done

from bark.

mobilestack avatar mobilestack commented on May 31, 2024 1

you might wanna use the reconnect option as well incase of partial downloads, for example this: wget -c https://dl.suno-models.io/bark/models/v0/text_2.pt -O ~/.cache/suno/bark_v0/54afa89d65e318d4f5f80e8e8799026a.pt

Do I have to change the model name to its checksum as the file name? Strange that when I run the example from README, it automatically download a file named with "e32937063d7ccececc61b2d2a3bb0a13.pt", while it is not any checksum listed in the codes.

ll ~/.cache/suno/bark_v0
total 25448312
-rw-r--r--  1 ichen  staff   3.5G Apr 22 18:25 6285677e88715abde42a9924db939b3b.pt
-rw-r--r--  1 ichen  staff   3.7G Apr 22 17:36 751d4d3d562e63ead5311ebe2a5f45a8.pt
-rw-r--r--  1 ichen  staff   5.0G Apr 22 17:11 e32937063d7ccececc61b2d2a3bb0a13.pt

mine is

-rw-r--r--@ 1 tony  staff   5.0G  4 23 13:53 54afa89d65e318d4f5f80e8e8799026a.pt
-rw-r--r--@ 1 tony  staff   3.5G  4 23 14:07 59d184ed44e3650774a2f0503a48a97b.pt
-rw-r--r--@ 1 tony  staff   3.7G  4 23 14:07 8a98094e5e3a255a5c9c0ab7efe8fd28.pt

might be the v1 and v2 difference.

from bark.

khimaros avatar khimaros commented on May 31, 2024 1

following @gkucsko instructions with the large models results in the text_2.pt continuously being overwritten with found outdated text model, removing. -- i think the checksum of that file is incorrect vs. what is listed in the python code in main branch.

i also suspect there is something wrong with the code being used to download these files, as wget is extremely reliable and fast, but generate.py fails almost every time i run it. there should probably be a bug tracking the reliability issue.

EDIT: it seems like the reason the model was being removed is because i was resuming the download after generate.py crashed which was resulting in inconsistent data. if i use the wget method listed in my comment below, everything works great!

from bark.

khimaros avatar khimaros commented on May 31, 2024 1

@mobilestack

Do I have to change the model name to its checksum as the file name? Strange that when I run the example from README, it automatically download a file named with "e32937063d7ccececc61b2d2a3bb0a13.pt", while it is not any checksum listed in the codes.

looking at the code in generate._get_ckpt_path(), it seems like the file name is actually a hash of the URL used to fetch the file, which is quite odd.

    model_name = _string_md5(REMOTE_MODEL_PATHS[model_key]["path"])

perhaps they intended to use _md5() here to hash the contents of the file instead?

just confirming this with a little bit of shell:

$ echo -en "https://dl.suno-models.io/bark/models/v0/text_2.pt" | md5sum
e32937063d7ccececc61b2d2a3bb0a13  -

it seems in general that the model download code is quite buggy and could probably use a bit of a review and tidying up.

from bark.

wiz64 avatar wiz64 commented on May 31, 2024 1

are all three models needed ? can we just use one ?

from bark.

khimaros avatar khimaros commented on May 31, 2024

@flyisland i believe the URLs you're looking for can be constructed from here: https://github.com/suno-ai/bark/blob/main/bark/generation.py#L86

from bark.

flyisland avatar flyisland commented on May 31, 2024

@khimaros Thanks, I tried it but received the message "You are not authorized to view this object." I'm not sure which models I should download. A Readme about this would be greatly appreciated.

from bark.

gkucsko avatar gkucsko commented on May 31, 2024

you might wanna use the reconnect option as well incase of partial downloads, for example this:
wget -c https://dl.suno-models.io/bark/models/v0/text_2.pt -O ~/.cache/suno/bark_v0/54afa89d65e318d4f5f80e8e8799026a.pt

from bark.

flyisland avatar flyisland commented on May 31, 2024

Thanks, @khimaros and @gkucsko, it works for me now!

from bark.

mobilestack avatar mobilestack commented on May 31, 2024

you might wanna use the reconnect option as well incase of partial downloads, for example this: wget -c https://dl.suno-models.io/bark/models/v0/text_2.pt -O ~/.cache/suno/bark_v0/54afa89d65e318d4f5f80e8e8799026a.pt

Do I have to change the model name to its checksum as the file name? Strange that when I run the example from README, it automatically download a file named with "e32937063d7ccececc61b2d2a3bb0a13.pt", while it is not any checksum listed in the codes.

from bark.

flyisland avatar flyisland commented on May 31, 2024

you might wanna use the reconnect option as well incase of partial downloads, for example this: wget -c https://dl.suno-models.io/bark/models/v0/text_2.pt -O ~/.cache/suno/bark_v0/54afa89d65e318d4f5f80e8e8799026a.pt

Do I have to change the model name to its checksum as the file name? Strange that when I run the example from README, it automatically download a file named with "e32937063d7ccececc61b2d2a3bb0a13.pt", while it is not any checksum listed in the codes.

ll ~/.cache/suno/bark_v0
total 25448312
-rw-r--r--  1 ichen  staff   3.5G Apr 22 18:25 6285677e88715abde42a9924db939b3b.pt
-rw-r--r--  1 ichen  staff   3.7G Apr 22 17:36 751d4d3d562e63ead5311ebe2a5f45a8.pt
-rw-r--r--  1 ichen  staff   5.0G Apr 22 17:11 e32937063d7ccececc61b2d2a3bb0a13.pt

from bark.

mobilestack avatar mobilestack commented on May 31, 2024

these should be all the current models needed:

# download small models
wget -c https://dl.suno-models.io/bark/models/v0/text.pt -O ~/.cache/suno/bark_v0/41a4361a0bb21b667a35fbf76a309a77.pt
wget -c https://dl.suno-models.io/bark/models/v0/coarse.pt -O ~/.cache/suno/bark_v0/db7988c269f58606a4b3a3d3497c6b95.pt
wget -c https://dl.suno-models.io/bark/models/v0/fine.pt -O ~/.cache/suno/bark_v0/0f6f3420c8bb574f74e75e6f7f59a510.pt
    
# download large models
wget -c https://dl.suno-models.io/bark/models/v0/text_2.pt -O ~/.cache/suno/bark_v0/e32937063d7ccececc61b2d2a3bb0a13.pt
wget -c https://dl.suno-models.io/bark/models/v0/coarse_2.pt -O ~/.cache/suno/bark_v0/751d4d3d562e63ead5311ebe2a5f45a8.pt
wget -c https://dl.suno-models.io/bark/models/v0/fine_2.pt -O ~/.cache/suno/bark_v0/6285677e88715abde42a9924db939b3b.pt

I wonder why is that for text_2.pt, has these two results? e32937063d7ccececc61b2d2a3bb0a13
and 54afa89d65e318d4f5f80e8e8799026a

from bark.

kevinambrose avatar kevinambrose commented on May 31, 2024

this should work to download all of the files (with resume):

for model in text coarse fine text_2 coarse_2 fine_2; do
    remote_url="https://dl.suno-models.io/bark/models/v0/${model}.pt"
    remote_md5=$(echo -en "${remote_url}" | md5sum | awk '{ print $1 }')
    out_path=~/.cache/suno/bark_v0/${remote_md5}.pt
    echo "fetching model ${model} ${remote_url} to ${out_path} ..."
    wget -c "${remote_url}" -O "${out_path}"
done

this is the list of files with their md5sum after finishing on my computer:

$ md5sum ~/.cache/suno/bark_v0/* | sed -r 's/\/home\/(.*?)\/.cache\///g'
5428d1befe05be2ba32195496e58dc90  suno/bark_v0/0f6f3420c8bb574f74e75e6f7f59a510.pt
b3e42bcbab23b688355cd44128c4cdd3  suno/bark_v0/41a4361a0bb21b667a35fbf76a309a77.pt
59d184ed44e3650774a2f0503a48a97b  suno/bark_v0/6285677e88715abde42a9924db939b3b.pt
8a98094e5e3a255a5c9c0ab7efe8fd28  suno/bark_v0/751d4d3d562e63ead5311ebe2a5f45a8.pt
5fe964825e3b0321f9d5f3857b89194d  suno/bark_v0/db7988c269f58606a4b3a3d3497c6b95.pt
54afa89d65e318d4f5f80e8e8799026a  suno/bark_v0/e32937063d7ccececc61b2d2a3bb0a13.pt

and the checksums as stored in generate.py:

$ grep -B1 checksum ~/.cache/pypoetry/virtualenvs/third-brain-IMBisF_0-py3.10/lib/python3.10/site-packages/bark/generation.py
        "path": os.path.join(REMOTE_BASE_URL, "text.pt"),
        "checksum": "b3e42bcbab23b688355cd44128c4cdd3",
--
        "path": os.path.join(REMOTE_BASE_URL, "coarse.pt"),
        "checksum": "5fe964825e3b0321f9d5f3857b89194d",
--
        "path": os.path.join(REMOTE_BASE_URL, "fine.pt"),
        "checksum": "5428d1befe05be2ba32195496e58dc90",
--
        "path": os.path.join(REMOTE_BASE_URL, "text_2.pt"),
        "checksum": "54afa89d65e318d4f5f80e8e8799026a",
--
        "path": os.path.join(REMOTE_BASE_URL, "coarse_2.pt"),
        "checksum": "8a98094e5e3a255a5c9c0ab7efe8fd28",
--
        "path": os.path.join(REMOTE_BASE_URL, "fine_2.pt"),
        "checksum": "59d184ed44e3650774a2f0503a48a97b",

actually looks like everything matches up nicely.

I get a syntax error when using this code

image

from bark.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.