pub enum EmbedError {
NoCacheDir {
model: &'static str,
},
HubClient(ApiError),
Fetch {
repo: &'static str,
file: &'static str,
source: ApiError,
},
ReadFile {
path: String,
source: Error,
},
Config(Error),
LoadTokenizer(Error),
Model(Error),
Tokenize(Error),
Inference(Error),
}Expand description
Errors from loading the embedding model or running inference.
Variants§
NoCacheDir
The platform has no resolvable user cache directory
(dirs::cache_dir() returned None), so the model has nowhere to be
cached.
HubClient(ApiError)
Failed to initialize the Hugging Face Hub API client.
Fetch
Failed to fetch a required model file from the Hugging Face Hub.
Fields
ReadFile
Failed to read a locally cached model file.
Config(Error)
The model’s config.json was not valid JSON or did not match the
expected BERT config shape.
LoadTokenizer(Error)
Failed to load the tokenizer definition from tokenizer.json.
Model(Error)
Failed to load the model weights into the BERT architecture.
Tokenize(Error)
Failed to tokenize input text.
Inference(Error)
A tensor operation failed during inference.
Trait Implementations§
Source§impl Debug for EmbedError
impl Debug for EmbedError
Source§impl Display for EmbedError
impl Display for EmbedError
Source§impl Error for EmbedError
impl Error for EmbedError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for EmbedError
impl From<Error> for EmbedError
Source§impl From<Error> for EmbedError
impl From<Error> for EmbedError
Source§impl ToProblem for EmbedError
impl ToProblem for EmbedError
Source§fn to_problem(&self) -> ProblemDetails
fn to_problem(&self) -> ProblemDetails
Maps
self to a fully-populated ProblemDetails envelope.Source§fn render(&self, format: OutputFormat) -> String
fn render(&self, format: OutputFormat) -> String
Auto Trait Implementations§
impl !RefUnwindSafe for EmbedError
impl !UnwindSafe for EmbedError
impl Freeze for EmbedError
impl Send for EmbedError
impl Sync for EmbedError
impl Unpin for EmbedError
impl UnsafeUnpin for EmbedError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more