asigalov61/Optimus-VIRTUOSO

Not sure what to put in input_prompt, keep getting KeyError

Closed this issue · 5 comments

I'm running this in collab, but get a KeyError on the "Generate and download the composition as TXT file." step.

The default does not work and if I add "SONG=Relax_with_900_notes" in input_prompt as suggested I get:

511     context = input_prompt

--> 512 x = torch.tensor([train_dataset.stoi[s] for s in context], dtype=torch.long)[None,...].to(trainer.device)
513 y = sample(model, x, number_of_tokens_to_generate, temperature=creativity_temperature, sample=True, top_k=top_k_prob)[0]
514 completion = ''.join([train_dataset.itos[int(i)] for i in y])

KeyError: 'G'

What should the input_prompt be?

Hey @iyusdi

Usually, an input prompt would be something from your dataset. Either a word or a char.

In your case, it seems that the letters S, O, and N are in your dataset, so you can put in one or several of these letters as an input prompt.

Let me know if you still have problems.

Alex

Ohh, and word prompts do not work for Char Token encodings as it is all tokenized down to chars.

So you can bypass Char Token encoding sections and disable Char Token encoding in the Convert to MIDI section.

I honestly need to update the colab with proper default settings. My bad :)

I did get it to run by use SON, but I'm not 100% sure where that comes from. Is it Char Token encoded midi? I'll looks some more. Nice project, the music generation is great.

Great! Try it without Char Token encoding. It's how I call 1 char TXT music encoding I have created.

And thank you. Yes, music generation is awesome :) Just be aware of the plagiarism as the current software can't really produce original music by itself.

@iyusdi

I uploaded original 3.0 colab which does not have char token encoding. You can try it if you having problems with the main colab.
https://github.com/asigalov61/Optimus-VIRTUOSO/blob/main/%5BORIGINAL%5D_Optimus_VIRTUOSO.ipynb

Closing this issue for now but let me know of any problems.

Alex