JonathanFly / bark

🚀 BARK INFINITY GUI CMD 🎶 Powered Up Bark Text-prompted Generative Audio Model
MIT License
986 stars 93 forks source link

TypeError: unhashable type: 'list' on M2 Macbook Pro #112

Open EccentricEnigmatic opened 11 months ago

EccentricEnigmatic commented 11 months ago

Screenshot 2023-10-12 at 7 59 09 PM

Kept getting this error. I'm on a M2 macbook pro so the .bat files didn't exactly run since it looks like they're geared towards windows and figured it may be better to see if i could modify a bit of the code to fix it. Programmer but not exactly a python guy. Not sure if it helps but added the "if isintance" line to the api.py right after line 1969 which seemed to fix the error and turned the list item it was complaining about into a string and it's now generating the wave file without the error. Not sure if that messes anything else up with the way the voices are put together but if it helps anyone else who doesn't understand code and isn't on windows, I thought maybe it'd help.

The following two lines is what I added before the audio_segments portion that was already written:

if isinstance(process_text_by_each, list):
    process_text_by_each = ' '.join(process_text_by_each)

audio_segments = text_processing.split_text(
    text_prompt,
    split_type=process_text_by_each,
    split_type_quantity=in_groups_of_size,
    split_type_string=split_type_string,
    split_type_value_type=group_text_by_counting,
)    
JonathanFly commented 11 months ago

I'm borrowing a macbook for unrelated work this weekend, I'll check it. Seems strange for this to only be on mac, maybe a python version mismatch.

EccentricEnigmatic commented 10 months ago

Yeah thinking it's something non-mac related, maybe with my setup. Had it working back in July, beginning of August (Believe i was running python 3.9.* at the time) before the dog decided my screen looked tasty and took a chomp, took it in to be repaired and OS somehow got corrupted when it was returned and didn't get it back for almost a month as was out of town. Spent the next few weeks trying to get everything up and working again. Think i saw mentioned that hugging face is now further along than the suno-ai/bark on github so thinking an update happened when i was gone.

With the new install when i got it back, using pyenv. Python 3.9. versions were getting list type errors which i had gotten on the old versions and got to work but i can't remember how. Tried 3.11. and was getting the unhashable list as mentioned above. Currently on 3.10.6 which is when I decided to modify the code to get it to work as mentioned above. Haven't gone back to test 3.11.* yet .

If the way i set it up helps, here's what i did:

Installed suno-ai/bark from the github with pip install git+https://github.com/suno-ai/bark.git

I have pyenv installed through homebrew. Then from bark infinity used:

git clone https://github.com/JonathanFly/bark.git cd bark

along with: pip install torch torchvision torchaudio pip install -r barki-allpip.txt --upgrade ffdl install -U --add-path

Again, 3.9.* versions were giving list type errors and 3.10-3.11 versions the unhashable list error (using pyenv to switch python versions and setting them to global to see which worked).

Also ran your requirements-allpip.txt file. Kept stopping at pywin32 as pywin from what i looked up won't run on macs. Changed the file to set that as windows only and finished the install. Still got unhashable list. At some point I ran the bark_perform file to and it downloaded some more files. Can't remember what they were if I maybe forgot to install the transformers and they got installed sometime during trying to figure out the unhashable list issue. The following python file i wrote at this point was working but the webui was not.

Screenshot 2023-10-20 at 12 05 00 AM

Saw you mentioned running your INSTALL_BARK_INFINITY.bat file from someone that mentioned the unhashable list here and someone else on discord you replied to. Saw some articles that said you could get them to run on a mac but my attempts just opened the file just i just went through the code you had in it to see what was being installed. Debated the conda thing either installing through pyenv or just straight install. I can't remember why but I decided against it since I had it running without it before. And that's when i decided to look through the code a bit and with a bit of help from chagpt to speed up solving the issue went through and found that piece of code, asked how to concert it to a string and plugged it in. Like i said, I've only written python programs a few times as i'm usually working with php and mysql but I understand python enough and programming to know what to ask in chatgpt and help me get it working through that line of code above.

There's still a few things to look at as i'm getting deprecated warnings like below:

Screenshot 2023-10-19 at 10 00 46 PM

And then there's a few undefined fields and looks like the styling isn't wrapping right in some way as you can see on the bottom two fields in this pic:

Screenshot 2023-10-19 at 9 59 23 PM

But otherwise it's now creating audio files like it did previously so can't complain.

madwurmz commented 10 months ago

insert joke about the dog eating the screen and this topic about bark 🐶

EccentricEnigmatic commented 10 months ago

LOL i didn't even think of that when i posted. The irony!

JonathanFly commented 10 months ago

Just pushed a tiny patch, I think I may have fixed the issue on the gradio UI side, checking there to not pass an empty list in the first place. I still don't understand why I don't get this error, checked in Python 3.9 and 3.10 locally.

The grado UI glitches are known. I need to unhack my custom stuff so it doesn't keep breaking everytime Gradio updates. The missing button images do function though.

EccentricEnigmatic commented 10 months ago

Hmm yeah that's strange. I know i saw someone earlier with the unhashable list issue and you mentioned the bat file, and same thing on discord and both ran it and it fixed it. Are you running it through conda as i'm wondering if that might be the issue causing the problems with the pyenv python vs conda. I did switch my python version to 3.11.5 the other night in pyenv and happy to say other than the gradio UI deprecated warning it's running there too. I know when i ran the requirements txt and such I was getting a bunch of warnings with a few packages at the end, something with versions of ome* and it's versions vs some of the packages being installed. Could always be something there too. If there's anything i can check that might help you problem solve it let me know. Running an m2 max Macbook Pro with Ventura 13.5.2

JonathanFly commented 10 months ago

Hmm yeah that's strange. I know i saw someone earlier with the unhashable list issue and you mentioned the bat file, and same thing on discord and both ran it and it fixed it. Are you running it through conda as i'm wondering if that might be the issue causing the problems with the pyenv python vs conda. I did switch my python version to 3.11.5 the other night in pyenv and happy to say other than the gradio UI deprecated warning it's running there too. I know when i ran the requirements txt and such I was getting a bunch of warnings with a few packages at the end, something with versions of ome* and it's versions vs some of the packages being installed. Could always be something there too. If there's anything i can check that might help you problem solve it let me know. Running an m2 max Macbook Pro with Ventura 13.5.2

In general I never use 3.11 just because I got burned a couple times and now I stick with trusty 3.10 which always works. So I haven't actually tried my own repo in 3.11, it may just be that.