Expand description
Generic backend that pairs a Driver with a ModelArch.
GenericBackend implements EmbedBackend by delegating to the
architecture’s forward() method, which composes driver primitives into
the full inference pipeline. This decouples weight loading from the
backend interface — any (Driver, ModelArch) pair can serve as an
embedding backend.
The _mmap field keeps the memory-mapped safetensors file alive as long
as the backend exists, since Metal zero-copy buffers and CPU MmapTensor
slices reference its pages.
Structs§
- Generic
Backend - Generic backend that pairs a
Driverwith aModelArch.
Enums§
- Mmap
Holder - Holds a memory-mapped file, accepting either an owned
Mmapor anArc<Mmap>. CPU backends share theArcwithMmapTensor::Mappedvariants; GPU backends pass an ownedMmap.