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

embedding

151.9K 2 weeks ago

Readme

shaw/dmeta-embedding-zh is a Chinese Embedding model with just 100M parameters and supports context length of 1024, compute efficient, and suitable for many task scenarios. It has excellent results on the MTEB benchmark and is especially suitable for semantic vector retrieval, RAG and other LLM applications.

Note: This model requires ollama version 0.5.4 or later. It can only be used to generate embeddings.

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

Usage

You should pull and run model into your computer first as following:

ollama pull shaw/dmeta-embedding-zh

After the above command is done, the model is already running on your computer. Then you can call the ollama embedding api via the following methods.

REST API

New API: The endpoint is /api/embed. The argument input is a single text or a list of text to generate embeddings for.

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

curl http://localhost:11434/api/embed -d '{
  "model": "shaw/dmeta-embedding-zh",
  "input": ["天空是灰色的", "天空是蓝色的"]
}'

Deprecated API: The endpoint is /api/embeddings. The argument prompt is a single text to generate embeddings for.

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

Python SDK

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

Deprecated API

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

Javascript SDK

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

Deprecated API

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

Java SDK

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

FAQ

1) When i upgrade ollama from 0.5 to 0.6, get error like {"error":"unable to load model: /Users/my-user-name/.ollama/models/blobs/sha256-26bd607a51eb1f3a0d3beac444b977e03fa745def499add60c996c08c8c2ddcd"}, how to fix it?

2) Where can i find more about Ollama api details?

Ollama generate embeddings api

3) How can i downgrade Ollama version?

Please go to the Ollama’s github release page, pick the version you would like, download and install it.