michaelfeil / michaelfeil/infinity
Support for custom SentenceTransformer models
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Description
Model description
I have a custom SentenceTransformer model that is a custom class (And also quite nested), so on the top level the modules.json file look like
[
{
"idx": 0,
"name": "0",
"path": "0_MyModelClass",
"type": "custom_models.MyModelClass"
}
]
This loads correctly if I use SentenceTransformers directly, but when loading in infinity it complains that the .auto_model attribute is missing (thrown by these lines https://github.com/michaelfeil/infinity/blob/main/libs/infinity_emb/infinity_emb/transformer/embedder/sentence_transformer.py#L81-L93 ). If this sort of custom model can be supported, or if you can give me some guidance on the correct way to save the model, that would be great.
Open source status & huggingface transformers.
- The model implementation is available on transformers
- The model weights are available on huggingface-hub
- I verified that the model is currently not running in the latest version
pip install infinity_emb[all] --upgrade - I made the authors of the model aware that I want to use it with infinity_emb & check if they are aware of the issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in libs/infinity_emb/infinity_emb/transformer/embedder/sentence_transformer.py at lines 81-93, then reproduce loading the reported nested custom SentenceTransformer model in SentenceTransformers and infinity_emb. Determine whether the model can be supported or whether its required save format needs documentation; done means the model loads successfully or clear guidance is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100