Skip to contents

Create a HuggingFace embedding function

Usage

embedder_hf(
  model_name,
  modality = c("multimodal", "text", "image"),
  device = "cpu",
  cache_dir = NULL
)

Arguments

model_name

Name of the HuggingFace model

modality

Type of model ("text", "image", or "multimodal")

device

Device to use ("cpu", "cuda", or "mps")

cache_dir

Optional directory for caching model files

Value

An embedding function