Introduce the ThreadPoolNoAbort wrapper

This commit is contained in:
Clément Renault 2024-04-24 16:40:12 +02:00
parent b3173d0423
commit d4aeff92d0
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
14 changed files with 129 additions and 60 deletions

View file

@ -3,6 +3,7 @@ use std::path::PathBuf;
use hf_hub::api::sync::ApiError;
use crate::error::FaultSource;
use crate::PanicCatched;
#[derive(Debug, thiserror::Error)]
#[error("Error while generating embeddings: {inner}")]
@ -80,6 +81,8 @@ pub enum EmbedErrorKind {
OpenAiUnexpectedDimension(usize, usize),
#[error("no embedding was produced")]
MissingEmbedding,
#[error(transparent)]
PanicInThreadPool(#[from] PanicCatched),
}
impl EmbedError {