https://huggingface.co/DMetaSoul/Dmeta-embedding-zh

Embedding

10.4K Pulls Updated 3 months ago

3 months ago

55960d8a3a42 · 409MB

model
bert
·
102M

Readme

Note: this model requires Ollama 0.1.30 or later. It can only be used to generate embeddings.

shaw/dmeta-embedding-zh is a Chinese Embedding model with just 400M parameters and suitable for multiple scenarios. It has excellent results on the MTEB benchmark and is especially suitable for semantic retrieval, RAG and other LLM applications.

Usage

This model is an embedding model, meaning it can only be used to generate embeddings.

You should pull this model into local disk first as following:

ollama pull shaw/dmeta-embedding-zh

Then you can call the ollama embedding api via the following methods.

REST API

curl http://localhost:11434/api/embeddings -d '{
  "model": "shaw/dmeta-embedding-zh",
  "prompt": "天空是灰色的"
}'

Python library

ollama.embeddings(model='shaw/dmeta-embedding-zh', prompt='天空是灰色的')

Javascript library

ollama.embeddings({ model: 'shaw/dmeta-embedding-zh', prompt: '天空是灰色的' })

Java library

EmbeddingResponse embeddingResponse = embeddingClient.call(
    new EmbeddingRequest(List.of("天空是灰色的", "天空是蓝色的"),
        OllamaOptions.create()
            .withModel("shaw/dmeta-embedding-zh"));

More Docs