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 super::t4::T4_BF16_UNTESTED;
use crate::pooling::Pooling;

/// The two GTE (new) entries' shared fields: `model_type` `new`, CLS pooling, an 8192 default and no templates.
/// Regenerate a reference with `just golden-remote <id> NewModel 40ced75c3017eb27626c9d4ea981bde21a2662f4`.
const fn gte_new(id: &'static str, mrl: bool, size_gb: f32) -> Entry {
  Entry {
    id,
    family: Family::GteNew,
    dim: 768,
    default_max_length: 8192,
    pooling: Pooling::Cls,
    cpu: Support::Verified,
    metal: Support::Verified,
    cuda: Support::Verified,
    query_template: None,
    passage_template: None,
    default_instruction: None,
    dense_dirs: &[],
    mrl,
    layer_norm_after_pooling: false,
    gated: false,
    default_dtype: DType::F32,
    dtypes: DtypeSupport::verified(),
    license: "Apache-2.0",
    size_gb,
    phase: 2,
    weights: WeightsFormat::Safetensors,
    accel_only_dtypes: &[],
    cell_exceptions: T4_BF16_UNTESTED,
  }
}

/// `Alibaba-NLP/gte-multilingual-base`: tensors under a `new.` prefix beside a discarded token-classification head,
/// a one-row token type table, rope 20000 with NTK factor 8, and Matryoshka from 128 to 768 by its model card.
const MULTILINGUAL_BASE: Entry = gte_new("Alibaba-NLP/gte-multilingual-base", true, 0.61);

/// `Alibaba-NLP/gte-base-en-v1.5`: no tensor prefix, no token type table, rope 500000 with NTK factor 2, and no
/// `Normalize` module.
const BASE_EN_V1_5: Entry = gte_new("Alibaba-NLP/gte-base-en-v1.5", false, 0.55);

pub(super) const ENTRIES: &[Entry] = &[MULTILINGUAL_BASE, BASE_EN_V1_5];