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

Pretrained text encoder #445

Open
ethancohen123 opened this issue Sep 13, 2022 · 2 comments
Open

Pretrained text encoder #445

ethancohen123 opened this issue Sep 13, 2022 · 2 comments

Comments

@ethancohen123
Copy link

Is it possible to use and train dalle with an external ( frozen) text encoder ( as those available in hugging face) ?

@ethancohen123
Copy link
Author

ethancohen123 commented Oct 3, 2022

Anyone has an idea about this ? @lucidrains

@kingnobro
Copy link

kingnobro commented Dec 20, 2022

Hi. If you want to use pretrained language model, you are actually using the text embedding of that model.

  1. At first, you can load and save the text embedding layer weight of pretrained models like CLIP and BERT.
  2. Then, you need to replace the text_emb in DALLE __init__ function. Now, instead of using nn.Embedding to create new text embedding, you can use torch.load to load pretrained weight saved in step 1.

Example: link

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

2 participants