lucidrains / DALLE2-pytorch

Implementation of DALL-E 2, OpenAI's updated text-to-image synthesis neural network, in Pytorch
MIT License
11.17k stars 1.09k forks source link

How should I get the tensor from a piece of text for a given dataset? #257

Open QinSY123 opened 2 years ago

QinSY123 commented 2 years ago

In the sample code, the input for the text is a random tensor, how should I get this tensor from a piece of text for a given dataset? text = torch.randint(0, 49408, (4, 256)).cuda()

krrishdholakia commented 1 year ago

Are you using a specific dataset or is this a general approach?

You could use a pre-trained model like BERT for this.

Let me know if that helps!

QinSY123 commented 1 year ago

Are you using a specific dataset or is this a general approach?

You could use a pre-trained model like BERT for this.

Let me know if that helps!

Thanks a lot!

xiefei1026 commented 1 year ago

Hello, have you solved this problem? I have the same problem