muzairkhattak / multimodal-prompt-learning

[CVPR 2023] Official repository of paper titled "MaPLe: Multi-modal Prompt Learning".
https://muzairkhattak.github.io/multimodal-prompt-learning/
MIT License
635 stars 48 forks source link

Build a model #45

Closed liuchenxin666 closed 9 months ago

liuchenxin666 commented 9 months ago

Hi, thank you for your excellent work.

Since I'm not very familiar with dassl.pytorch, can I create the model simply and directly? Similar model = build_model();,so that I can get started faster. At the same time, I also want to make some changes to the model. Can you give me some guidance?

Thank you.

muzairkhattak commented 9 months ago

Hi @liuchenxin666,

Thank you for showing interest in MaPLe!

If you only want to create a model, you can proceed like the following:

  1. You can create the MaPLe trainer class object by executing this line.
  2. Next you can create your model by running trainer.build_model()
  3. Lastly you can retrieve your MaPLe model as model = trainer.model

Regarding your second query, you can make changes to the model in the maple model class which is given in maple.py at this location.

Additionally, maple.py relies on CLIP model architecture which is modified accordingly in model.py at this link.

I hope this will be helpful!

Thank you and kind regards!