Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: ord() expected a character, but string of length 0 found #92

Open
TimOgden opened this issue May 26, 2020 · 10 comments
Open

Comments

@TimOgden
Copy link

image

This happens whether I call the sample.py script directly just like how the README.md file says or if I try to run the same code in the ipynb file. I think it may have to do with the code not being able to find the model weights, but I really don't know. Any help on this issue would be greatly appreciated.

@youdontown
Copy link

This is because wget fails and the file is empty. I was able to fix this by manually editing jukebox\utils\gcs_utils.py's download function to call wget with --no-check-certificate.

args = ['wget', '-q', '-O', local_path, remote_path, '--no-check-certificate']

@youdontown
Copy link

Note that this might be a dangerous change to make permanently and this is a problem that could be fixed by properly setting up the wget environment (something I don't know how to do yet). But I think jukebox only downloads a few things and this should at least get you going...

Would be nice if these errors were a little more descriptive. I might make a pull request later to make this more accessible.

@TimOgden
Copy link
Author

I made that change in the gcs_utils.py file but I still get the same Exception, weirdly enough. I also tried to remove the '-q' from the args list hoping that wget would be verbose and give me some more information, but it is still supressed.

@youdontown
Copy link

Try running wget on https://storage.googleapis.com/jukebox-assets/models/5b/vqvae.pth.tar and see what the error is. I had a certificate error, yours might be different.

@TimOgden
Copy link
Author

It's weird, just doing that I get the certification error like so
image

but if I do wget https://storage.googleapis.com/jukebox-assets/models/5b/vqvae.pth.tar --no-check-certificate then it works fine.

So I'm not quite sure why it doesn't work in the ipynb file

@youdontown
Copy link

youdontown commented May 26, 2020

Oh, duh. You need to go and delete the files that were created in the cache, because jukebox thinks they were already downloaded. Go to C:\Users\<you>\.cache\jukebox-assets\models\ and delete the archives in the subfolders.

@TimOgden
Copy link
Author

I ended up just downloading all the files I need into the cache myself as I found that easiest.

wget https://storage.googleapis.com/jukebox-assets/models/5b/vqvae.pth.tar --no-check-certificate -O C:/Users/<you>/.cache/jukebox-assets/models/5b/vqvae.pth.tar

wget https://storage.googleapis.com/jukebox-assets/models/5b/prior_level_0.pth.tar --no-check-certificate -O C:/Users/<you>/.cache/jukebox-assets/models/5b/prior_level_0.pth.tar

wget https://storage.googleapis.com/jukebox-assets/models/5b/prior_level_1.pth.tar --no-check-certificate -O C:/Users/<you>/.cache/jukebox-assets/models/5b/prior_level_1.pth.tar

If you want the 5b_lyrics model
wget https://storage.googleapis.com/jukebox-assets/models/5b/prior_level_2.pth.tar --no-check-certificate -O C:/Users/<you>/.cache/jukebox-assets/models/5b/prior_level_2.pth.tar

If you want the 1b_lyrics model
wget https://storage.googleapis.com/jukebox-assets/models/1b/prior_level_2.pth.tar --no-check-certificate -O C:/Users/<you>/.cache/jukebox-assets/models/1b/prior_level_2.pth.tar

Thanks @youdontown I would've been completely stuck without your help

@kordspace
Copy link

Note that this might be a dangerous change to make permanently and this is a problem that could be fixed by properly setting up the wget environment (something I don't know how to do yet). But I think jukebox only downloads a few things and this should at least get you going...

Would be nice if these errors were a little more descriptive. I might make a pull request later to make this more accessible.

@youdontown Do you happen to know if wget can be configured to run this without removing the certificate check?

@Apokar
Copy link

Apokar commented Sep 23, 2020

I can't download those files

wget https://storage.googleapis.com/jukebox-assets/models/5b/vqvae.pth.tar --no-check-certificate -O /root/.cache/jukebox-assets/models/5b/vqvae.pth.tar

Unable to establish SSL connection

Can I download it from somewhere else?

@Apokar
Copy link

Apokar commented Sep 23, 2020

wow I just replace https with http,and it can download files successfully,Try It!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants