# Load weights to a custom model

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-weights-to-a-custom-model%2F41078%3E%5C
**Category:** Models\
**Created:** [May 26, 2023, 12:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-weights-to-a-custom-model%2F41078 "2023-05-26T12:10:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vaddd](https://avatars.discourse-cdn.com/v4/letter/v/ba8739/32.png) [@Vaddd](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FVaddd)%5C
**Post date:** [May 26, 2023, 12:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fload-weights-to-a-custom-model%2F41078%2F1 "2023-05-26T12:10:59Z")

</div>

The more I read papers, the more frequently I encounter that authors, let`s say, implement a custom attention mechanism and measure its performance in a trained original model (T5 for instance). It is not clear to me how can I load weights to a model that has a slightly different structure than the original one. So is there a way to load weights only to those layers that are identical between an original model and a custom?
