-
Notifications
You must be signed in to change notification settings - Fork 111
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
Refactoring of internal structure #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍
The pre-commit found some left-out formatting changes.
HF sources were tried first. If they failed or were not present, fallback to GCS. |
DefaultEmbedding = TextEmbedding | ||
FlagEmbedding = TextEmbedding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this retains enough backward compatibility for most users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was our thought as well
JinaOnnxEmbedding, | ||
] | ||
|
||
@classmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we handle the case of models which we use for both dense and sparse? E.g. BGE-M3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would need to implement both TextEmbedding and SparseEmbedding(tba) classes for those models. I am strictly against changing the function output format depending on the model name
fastembed/text/onnx_models.py
Outdated
@@ -0,0 +1,133 @@ | |||
supported_flag_models = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to have a flat models.json or similar config-like file, instead of 3 different lists.
If we want to separate the models into different classes and files, we should move this completely to those corresponding files — that way the places to update in any new model addition are:
- New class in a file
- Embedding Registry
- Tests
That's it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok with moving lists to the corresponding implementation. But having a single list doesn't work. It creates very ugly hacks as with the "exclude" param of the list models method.
But what about multiple GCS and multiple HF courses with different names? |
I did a manual run, but it would be nice to mention a setup for the hook in dev docs |
Added 2 new models to main @generall — let's have those here as well, and then we're good to merge this from my end! |
Co-authored-by: George Panchuk <[email protected]>
c67ebb9
to
7883fa3
Compare
fastembed/text/e5_onnx_embedding.py
Outdated
} | ||
}, | ||
{ | ||
"model": "xenova/paraphrase-multilingual-mpnet-base-v2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"model": "xenova/paraphrase-multilingual-mpnet-base-v2", | |
"model": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2", |
This is the model name. I missed this in the PR from Anush. Apologies for the confusion.
fastembed/text/e5_onnx_embedding.py
Outdated
{ | ||
"model": "xenova/multilingual-e5-large-quantized", | ||
"dim": 1024, | ||
"description": "Multilingual model. Recommended for non-English languages", | ||
"size_in_GB": 2.24, | ||
"sources": { | ||
"hf": "xenova/multilingual-e5-large", | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | |
"model": "xenova/multilingual-e5-large-quantized", | |
"dim": 1024, | |
"description": "Multilingual model. Recommended for non-English languages", | |
"size_in_GB": 2.24, | |
"sources": { | |
"hf": "xenova/multilingual-e5-large", | |
} | |
}, |
We can delete this completely, since the model is covered by Qdrant now.
Why?
exclude
param of the model list, multiple sources for the same model (how it was supposed to work?), remove the gcp fallback wrapper