fix(embedding): resolve large_enum_variant clippy error
This commit is contained in:
1 parent
1ed75ca156
commit
bd20482cea
1 file changed
+2
-2
@@ -193,14 +193,14 @@ fn fallback_embed(text: &str) -> Vec<f32> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum EmbeddingModel {
|
enum EmbeddingModel {
|
||||||
Candle(CandleEmbeddingModel),
|
Candle(Box<CandleEmbeddingModel>),
|
||||||
Fallback,
|
Fallback,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EmbeddingModel {
|
impl EmbeddingModel {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
match CandleEmbeddingModel::new() {
|
match CandleEmbeddingModel::new() {
|
||||||
Ok(model) => EmbeddingModel::Candle(model),
|
Ok(model) => EmbeddingModel::Candle(Box::new(model)),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
"Failed to initialize Candle BERT model ({e}); falling back to deterministic offline embeddings."
|
"Failed to initialize Candle BERT model ({e}); falling back to deterministic offline embeddings."
|
||||||
|
|||||||
Reference in new issue
Block a user