-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Load model from check-points #2746
Comments
I'm currently trying doing it manually like from sentence_transformers.models import Pooling, Transformers
model = Transformer(path)
pooling_model = Pooling(model.get_word_embedding_dimension(), "mean")
sbert = SentenceTransformer(modules=[model, pooling_model]) but I'm not entirely sure if that is correct i.e if "mean-pooling" was used or "cls" (the model does work fine though). (would you be interested in me making a PR of a |
You can directly load the sentencetransformer with a path
|
If the base model is not yet a SentenceTransformer model, then this (i.e., mean pooling) is indeed equivalent. Like @ganeshkrishnan1 rightfully points out, you can also use a path, and even if it's a non-ST model, it'll automatically add the mean pooling. Otherwise, it'll add whatever modules (including pooling) was specified in the configuration files.
I don't think so, my intention is that the As for your original question: I'm not super familiar with the automatic push_to_hub via the Training Args, but I think it depends on what your In short, in your case I think you can just do model = SentenceTransformers("MyRepo/Model-train")
model.push_to_hub("MyRepo/Model-train") but it depends on the base model. If it was:
then you're good to go with this.
|
I have a training which pushes to
MyRepo/model-train
during training phase at each logging interval i.ewhen the training was done, the
model.push_to_hub()
failed (my fault) thus I wanted to just load the model from my checkpoint and push that.If I try to do
SentenceTransformers("MyRepo/Model-train")
then I getNo sentence-transformers model found with name ... Creating a new one with mean pooling.
.Is there anything I can do? Or do I just need to retrain and wait for 18 hours? 😬
If I go to the repo I have the following files
The text was updated successfully, but these errors were encountered: