-
Notifications
You must be signed in to change notification settings - Fork 2
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
ERROR:model.generate(input_tokens.ids, max_length=200)-------AttributeError: 'list' object has no attribute 'ids' #2
Comments
First of all, congratulations on the work! It is all very well structured and all resources are available. I was trying to replicate the results and also do some small test like this and I have some doubts that maybe @Natooz can help me here. Using the model card code available here: And trying with this example midi:
When I try to get the midi back from the tokenizer I get an error like this:
I hope you could give me a hand with this. Thanks a lot! |
Hi, thank you for your kind comment! :) In most cases, models take input ids (i.e. integers which can be seen as the idx of the tokens in the vocabulary), which allows it to use embeddings (I won't go into that here). For the output, the tokenizer can expect different input format depending on its configuration. Here if I remember well the tokenizer do not support |
Thank you so much @Natooz. I think that I understand better the code now.
I'm not entirely sure it worked well, but at least it does follow the sequence provided. I am still studying the documentation and code a bit as this domain is a bit new to me. Thank you very much for the reply and help. Regards, |
How to fix it?
generated_token_ids = model.generate(input_tokens.ids, max_length=200)
AttributeError Traceback (most recent call last)
in <cell line: 12>()
10 input_tokens = tokenizer(input_midi)
11
---> 12 generated_token_ids = model.generate(input_tokens.ids, max_length=200)
13 # generated_midi = tokenizer(generated_token_ids)
14 # generated_midi.dump("/content/out/continued.mid")
AttributeError: 'list' object has no attribute 'ids'
The text was updated successfully, but these errors were encountered: