Closed Matthieu-Tinycoaching closed 3 years ago
Maybe of interest to @nreimers
Hi @Matthieu-Tinycoaching
I was sadly not able to re-produce your error. Have you uploaded such a model to the hub? Could you post the link here?
And how does your code look like to load the model?
Hi @nreimers
I retried with including the custom class definition when loading the model and it worked.
Hi community,
I would like to add mean pooling step inside a custom SentenceTransformer class derived from the model sentence-transformers/stsb-xlm-r-multilingual, in order to avoid to do this supplementary step after getting the tokens embeddings.
My aim is to push this custom model onto model hub. If not using this custom step, it is trivial as below:
However, after defining my custom class SentenceTransformerCustom I can’t manage to push on model hub the definition of this class:
Do I need to place this custom class definition inside a specific .py file ? Or is there anything to do in order to correctly import this custom class from model hub?
Thanks!