manual embedders: limit max size of errors to 250

This commit is contained in:
Louis Dureuil 2024-07-15 21:40:50 +02:00
parent 4087a88dbe
commit f4c94ac57f
No known key found for this signature in database

View File

@ -20,7 +20,7 @@ impl Embedder {
pub fn embed(&self, mut texts: Vec<String>) -> Result<Vec<Embeddings<f32>>, EmbedError> { pub fn embed(&self, mut texts: Vec<String>) -> Result<Vec<Embeddings<f32>>, EmbedError> {
let Some(text) = texts.pop() else { return Ok(Default::default()) }; let Some(text) = texts.pop() else { return Ok(Default::default()) };
Err(EmbedError::embed_on_manual_embedder(text)) Err(EmbedError::embed_on_manual_embedder(text.chars().take(250).collect()))
} }
pub fn dimensions(&self) -> usize { pub fn dimensions(&self) -> usize {