Add `save_in_root` to the custom Module to allow saving & loading locally

#17
by tomaarsen HF staff - opened

Hello!

Pull Request overview

  • Add save_in_root to the custom Module to allow saving & loading locally

Details

Just like in jina-embeddings-v3, we can add save_in_root = True to ensure that this module is saved in the root of the directory. This is required because transformers expects any custom modeling files (such as custom_st.py itself) to be in the root. Without this change, we'll get this after saving with Sentence Transformers:

image.png

With this change in place, we'll instead get this:

image.png

and then you'll be able to save and load this correctly in Sentence Transformers.

  • Tom Aarsen
Jina AI org

looks good ๐Ÿ”ฅ

gmastrapas changed pull request status to merged

Sign up or log in to comment