Download sentence-transformers ONNX exports from the Hugging Face Hub to a
local cache for embeddings.core/load-model.
Download sentence-transformers ONNX exports from the Hugging Face Hub to a local cache for `embeddings.core/load-model`.
(fetch-model model-id)(fetch-model model-id opts)Download the ONNX export for model-id and tokenizer.json from the Hugging
Face Hub to a local cache. Try onnx/model.onnx, then model.onnx. Return
the model directory path for embeddings.core/load-model. Do not download
files that are already in the cache.
Options: :cache-dir (default ~/.cache/embeddings-clj), :revision
(default "main"), and :variant. :variant :quantized tries common
quantized ONNX paths. It stores them in a quantized cache subdir. A string
:variant is an explicit repo-relative .onnx path. The library caches it
in a subdir derived from the path.
Errors are ex-info keyed :embeddings/error
(:invalid-model-id, :invalid-variant, :download-failed).
Download the ONNX export for `model-id` and `tokenizer.json` from the Hugging Face Hub to a local cache. Try `onnx/model.onnx`, then `model.onnx`. Return the model directory path for `embeddings.core/load-model`. Do not download files that are already in the cache. Options: `:cache-dir` (default `~/.cache/embeddings-clj`), `:revision` (default "main"), and `:variant`. `:variant :quantized` tries common quantized ONNX paths. It stores them in a `quantized` cache subdir. A string `:variant` is an explicit repo-relative `.onnx` path. The library caches it in a subdir derived from the path. Errors are `ex-info` keyed `:embeddings/error` (`:invalid-model-id`, `:invalid-variant`, `:download-failed`).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |