Skip to main content

Module candle

Module candle 

Source
Expand description

GTE-small embedder using Candle.

Uses thenlper/gte-small model for text embeddings:

  • 384 dimensions
  • 512 max tokens
  • BERT architecture

Re-exportsยง

use async_trait::async_trait; ๐Ÿ”’
use candle_core::DType; ๐Ÿ”’
use candle_core::Device; ๐Ÿ”’
use candle_core::Tensor; ๐Ÿ”’
use candle_nn::VarBuilder; ๐Ÿ”’
use candle_transformers::models::bert::BertModel; ๐Ÿ”’
use candle_transformers::models::bert::Config; ๐Ÿ”’
use hf_hub::Repo; ๐Ÿ”’
use hf_hub::RepoType; ๐Ÿ”’
use ragfs_core::EmbedError; ๐Ÿ”’
use ragfs_core::Embedder; ๐Ÿ”’
use ragfs_core::EmbeddingConfig; ๐Ÿ”’
use ragfs_core::EmbeddingOutput; ๐Ÿ”’
use ragfs_core::Modality; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use tokenizers::Tokenizer; ๐Ÿ”’
use tokio::sync::RwLock; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use tracing::info; ๐Ÿ”’

Structsยง

CandleEmbedder
GTE-small embedder using Candle.

Constantsยง

EMBEDDING_DIM ๐Ÿ”’
Embedding dimension for gte-small.
MAX_TOKENS ๐Ÿ”’
Maximum sequence length.
MODEL_ID ๐Ÿ”’
Model identifier on HuggingFace Hub.

Functionsยง

resolve_supported_model
Resolve a user-facing model name to the implemented Hugging Face id.