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-revision, :invalid-variant,
:invalid-cache-path, :download-failed).
A :revision must be a branch, tag, or commit SHA. The library rejects
anything outside [A-Za-z0-9._/-], and rejects .., so a revision can
neither escape the cache dir nor rewrite the Hub URL.
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-revision`, `:invalid-variant`, `:invalid-cache-path`, `:download-failed`). A `:revision` must be a branch, tag, or commit SHA. The library rejects anything outside `[A-Za-z0-9._/-]`, and rejects `..`, so a revision can neither escape the cache dir nor rewrite the Hub URL.
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 |