Views
No views yet
SentenceTransformer(
(0): StaticEmbedding(
(embedding): EmbeddingBag(107962, 1024, mode='mean')
)
(1): Normalize()
)
pip install -U pynife1from nife import load_as_router
2
3model = load_as_router("stephantulkens/NIFE-mxbai-embed-large-v1")
4
5query = "What is the capital of France?"
6query_embeddings = model.encode_query(query)
7
8# Five locales near France
9index_doc = model.encode_document(["Paris is the largest city in France", "Lyon is pretty big", "Antwerp is really great, and in Belgium", "Berlin is pretty gloomy in winter", "France is a country in Europe"])
10
11similarity = model.similarity(query_vec, index_doc)
12print(similarity)
13# It correctly retrieved the document containing the statement about paris.
14# tensor([[0.7065, 0.5012, 0.3596, 0.2765, 0.6648]])
151@software{Tulkens2025pyNIFE,
2 author = {St\'{e}phan Tulkens},
3 title = {pyNIFE: nearly inference free embeddings in python},
4 year = {2025},
5 publisher = {Zenodo},
6 doi = {10.5281/zenodo.17512919},
7 url = {https://github.com/stephantulkens/pynife},
8 license = {MIT},
9 note = {If you use NIFE, please cite the following work.},
10}