Skip to main content

Module generic

Module generic 

Source
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 reference its pages.

Structs§

GenericBackend
Generic backend that pairs a Driver with a ModelArch.