SentenceTransformerTrainer: checkpoint saves custom_st.py in the wrong folder

#46
by botkop - opened

When you train with arguments

save_strategy="steps"
save_steps=100

the checkpoint saves custom_st.py in subfolder 0_Transformer, but it should be saved in the parent folder, I think.
Otherwise when loading the checkpoint, you get an error:
ModuleNotFoundError: No module named 'custom_st'

sentence-transformers              3.2.0
transformers                       4.45.2

Or maybe I should load from the 0_Transformer subfolder instead of the checkpoint folder?
Because previously mentioned workaround does not load the weights.

Jina AI org

Hi @botkop , are you loading the checkpoint to continue fine-tuning or just for inference? If it's for inference, you can replace the model weights in jinaai/jina-embeddings-v3 with the weights from the checkpoint directory and use the fine-tuned model that way

Yes, it's for inference after fine-tuning.
With model weights, you mean checkpoint-1200/0_Transformer/model.safetensors, correct?
image.png

Jina AI org

Yes, correct

jupyterjazz changed discussion status to closed

Sign up or log in to comment