candding 0.1.0

Pure candle embeddings for Rust with no ONNX: dense, sparse, multi-vector and rerank models today, image models on the roadmap
Documentation
use candle_core::DType;

use super::DtypeSupport;
use super::Family;
use super::Support;
use super::WeightsFormat;
use super::entry::Entry;
use crate::pooling::Pooling;

/// Gemma's `search result` prompt; the other task names go through `query_embed_with_instruction`.
const QUERY: &str = "task: {instruction} | query: {text}";
const INSTRUCTION: &str = "search result";
const PASSAGE: &str = "title: none | text: {text}";

/// F32 on CPU and Metal, BF16 on Metal. F16 is refused: the residual stream passes f16's 65 504 by the last
/// layer and the vectors come out NaN, in transformers too.
pub(super) const ENTRIES: &[Entry] = &[Entry {
  id: "google/embeddinggemma-300m",
  family: Family::Gemma3,
  dim: 768,
  default_max_length: 2048,
  pooling: Pooling::Mean,
  cpu: Support::Verified,
  metal: Support::Verified,
  cuda: Support::Untested,
  query_template: Some(QUERY),
  passage_template: Some(PASSAGE),
  default_instruction: Some(INSTRUCTION),
  dense_dirs: &["2_Dense", "3_Dense"],
  mrl: true,
  layer_norm_after_pooling: false,
  gated: true,
  default_dtype: DType::F32,
  dtypes: DtypeSupport {
    f32: Support::Verified,
    f16: Support::Unsupported,
    bf16: Support::Verified,
  },
  license: "gemma",
  size_gb: 1.2,
  phase: 1,
  weights: WeightsFormat::Safetensors,
  accel_only_dtypes: &[],
  cell_exceptions: &[],
}];