pub struct Qwen3TextEmbedding { /* private fields */ }Available on crate feature
qwen3 only.Expand description
High-level embedding wrapper around Qwen3Model that handles tokenization,
batching, mean-pooling, and L2-normalization.
Implementations§
Source§impl Qwen3TextEmbedding
impl Qwen3TextEmbedding
Sourcepub fn new(model: Qwen3Model, tokenizer: Tokenizer) -> Self
pub fn new(model: Qwen3Model, tokenizer: Tokenizer) -> Self
Build from an already loaded model and tokenizer.
Sourcepub fn from_hf(
repo_id: &str,
device: &Device,
dtype: DType,
max_length: usize,
) -> Result<Self>
Available on crate feature hf-hub only.
pub fn from_hf( repo_id: &str, device: &Device, dtype: DType, max_length: usize, ) -> Result<Self>
hf-hub only.Load from a Hugging Face repo.
Supported model families:
- Qwen3 text embedding checkpoints (e.g.
Qwen/Qwen3-Embedding-0.6B) - Qwen3-VL embedding checkpoints in text-only mode
(e.g.
Qwen/Qwen3-VL-Embedding-2B)
pub fn config(&self) -> &Config
pub fn device(&self) -> &Device
Auto Trait Implementations§
impl !Freeze for Qwen3TextEmbedding
impl !RefUnwindSafe for Qwen3TextEmbedding
impl !UnwindSafe for Qwen3TextEmbedding
impl Send for Qwen3TextEmbedding
impl Sync for Qwen3TextEmbedding
impl Unpin for Qwen3TextEmbedding
impl UnsafeUnpin for Qwen3TextEmbedding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more