Download sentence-transformers ONNX exports from the Hugging Face Hub into
a local cache, for use with embeddings.core/load-model.
Download sentence-transformers ONNX exports from the Hugging Face Hub into a local cache, for use with `embeddings.core/load-model`.
(fetch-model model-id)(fetch-model model-id opts)Download model-id's ONNX export (onnx/model.onnx, falling back to
model.onnx) and tokenizer.json from the Hugging Face Hub into a local
cache, returning the model directory path for
embeddings.core/load-model. Files already in the cache are not
re-downloaded.
Options: :cache-dir (default ~/.cache/embeddings-clj), :revision
(default "main"), and :variant. :variant :quantized tries common
quantized ONNX paths and stores them under a quantized cache subdir. A
string :variant is an explicit repo-relative .onnx path and is cached in
a path-derived subdir.
Errors are ex-info keyed :embeddings/error
(:invalid-model-id, :invalid-variant, :download-failed).
Download `model-id`'s ONNX export (`onnx/model.onnx`, falling back to `model.onnx`) and `tokenizer.json` from the Hugging Face Hub into a local cache, returning the model directory path for `embeddings.core/load-model`. Files already in the cache are not re-downloaded. Options: `:cache-dir` (default `~/.cache/embeddings-clj`), `:revision` (default "main"), and `:variant`. `:variant :quantized` tries common quantized ONNX paths and stores them under a `quantized` cache subdir. A string `:variant` is an explicit repo-relative `.onnx` path and is cached in a path-derived subdir. 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 |