Read-only mirror of https://github.com/eth-library/CHNOBLi-embedding-engine — ETH Library. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-01-19 12:39:51 +01:00
src/embedding_engine added better automatic device resolution that is fork save 2026-01-14 16:21:25 +01:00
tests added unit tests 2026-01-14 11:19:01 +01:00
.gitignore added src path to setuptoos 2026-01-14 13:17:37 +01:00
pyproject.toml incriesed version for small fixes 2026-01-19 12:39:51 +01:00
README.md added unit tests 2026-01-14 11:19:01 +01:00

Embedding Engine

Getting started

To install the module use

uv venv
source .venv/bin/activate
uv pip install -e .

Usage

to create embeddings with different huggingface models use the following routine:

    from embedding_engine.embeddings import generate_embedding

    backend = "huggingface"
    model = "Snowflake/snowflake-arctic-embed-l-v2.0"
    texts = ["Some text to embedd",
             "Some other text to also embedd"]
    
    embeddings = generate_embedding(text = texts, 
                             backend= backend, 
                             model_name= model)
    print(embeddings)

tested with, but not limited to following models:

SUPPORTED_MODELS = ["Snowflake/snowflake-arctic-embed-l-v2.0",
                    "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
                    "sentence-transformers/LaBSE",
                    "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
                    "nomic-ai/nomic-embed-text-v2-moe",
                    "intfloat/multilingual-e5-small",
                    "intfloat/multilingual-e5-base"
                    ]