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

Embedding

159 Pulls Updated 5 months ago

5 months ago

24d4564ca484 · 295MB

model
bert
·
73.7M

Readme

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

shaw/dmeta-embedding-zh-small is lighter than the shaw/dmeta-embedding-zh model, with less than 300M parameters, and the inference speed is increased by 30%.

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-small

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-small",
  "prompt": "天空是灰色的"
}'

Python library

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

Javascript library

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

Java library

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

More Docs