--- # For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1 # Doc / guide: https://huggingface.co/docs/hub/model-cards language: en license: mit base_model: Alibaba-NLP/gte-modernbert-base --- # NIFE GTE-ModernBERT-Base This is a [NIFE](https://github.com/stephantul/nife) model finetuned from [Alibaba-NLP/gte-modernbert-base](https://huggingface.co/Alibaba-NLP/gte-modernbert-base). It is fully aligned with its base model [Alibaba-NLP/gte-modernbert-base](https://huggingface.co/Alibaba-NLP/gte-modernbert-base), and can be used to perform Inference Free querying using an index made by this model. It can also be used in standalone mode. ## Model Details ### Model Description - **Model Type:** Static Model - **Base model:** [Alibaba-NLP/gte-modernbert-base](https://huggingface.co/Alibaba-NLP/gte-modernbert-base) - **Output Dimensionality:** 768 dimensions ### Full Model Architecture ``` SentenceTransformer( (0): TrainableStaticEmbedding( (embedding): EmbeddingBag(100003, 768, mode='mean') ) (1): Normalize() ) ``` ## Usage ### Direct Usage (NIFE) First install the NIFE library ```bash pip install -U pynife ``` Then you can run the model as follows: ```python from nife import load_as_router model = load_as_router("stephantulkens/NIFE-gte-modernbert-base") query = "What is the capital of France?" query_embeddings = model.encode_query(query) # Five locales near France index_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"]) similarity = model.similarity(query_vec, index_doc) print(similarity) # It correctly retrieved the document containing the statement about paris. # tensor([[0.7065, 0.5012, 0.3596, 0.2765, 0.6648]]) ``` ## Training Details ## Citation ### BibTeX ```bibtex @software{Tulkens2025pyNIFE, author = {St\'{e}phan Tulkens}, title = {pyNIFE: nearly inference free embeddings in python}, year = {2025}, publisher = {Zenodo}, doi = {10.5281/zenodo.17512919}, url = {https://github.com/stephantulkens/pynife}, license = {MIT}, } ```