mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	Better document the rayon limitation condition
This commit is contained in:
		| @@ -118,6 +118,8 @@ impl Embedder { | ||||
|         text_chunks: Vec<Vec<String>>, | ||||
|         threads: &ThreadPoolNoAbort, | ||||
|     ) -> Result<Vec<Vec<Embedding>>, EmbedError> { | ||||
|         // This condition helps reduce the number of active rayon jobs | ||||
|         // so that we avoid consuming all the LMDB rtxns and avoid stack overflows. | ||||
|         if threads.active_operations() >= REQUEST_PARALLELISM { | ||||
|             text_chunks.into_iter().map(move |chunk| self.embed(&chunk, None)).collect() | ||||
|         } else { | ||||
| @@ -137,6 +139,8 @@ impl Embedder { | ||||
|         texts: &[&str], | ||||
|         threads: &ThreadPoolNoAbort, | ||||
|     ) -> Result<Vec<Vec<f32>>, EmbedError> { | ||||
|         // This condition helps reduce the number of active rayon jobs | ||||
|         // so that we avoid consuming all the LMDB rtxns and avoid stack overflows. | ||||
|         if threads.active_operations() >= REQUEST_PARALLELISM { | ||||
|             let embeddings: Result<Vec<Vec<Embedding>>, _> = texts | ||||
|                 .chunks(self.prompt_count_in_chunk_hint()) | ||||
|   | ||||
| @@ -255,6 +255,8 @@ impl Embedder { | ||||
|         text_chunks: Vec<Vec<String>>, | ||||
|         threads: &ThreadPoolNoAbort, | ||||
|     ) -> Result<Vec<Vec<Embedding>>, EmbedError> { | ||||
|         // This condition helps reduce the number of active rayon jobs | ||||
|         // so that we avoid consuming all the LMDB rtxns and avoid stack overflows. | ||||
|         if threads.active_operations() >= REQUEST_PARALLELISM { | ||||
|             text_chunks.into_iter().map(move |chunk| self.embed(&chunk, None)).collect() | ||||
|         } else { | ||||
| @@ -274,6 +276,8 @@ impl Embedder { | ||||
|         texts: &[&str], | ||||
|         threads: &ThreadPoolNoAbort, | ||||
|     ) -> Result<Vec<Vec<f32>>, EmbedError> { | ||||
|         // This condition helps reduce the number of active rayon jobs | ||||
|         // so that we avoid consuming all the LMDB rtxns and avoid stack overflows. | ||||
|         if threads.active_operations() >= REQUEST_PARALLELISM { | ||||
|             let embeddings: Result<Vec<Vec<Embedding>>, _> = texts | ||||
|                 .chunks(self.prompt_count_in_chunk_hint()) | ||||
|   | ||||
| @@ -188,6 +188,8 @@ impl Embedder { | ||||
|         text_chunks: Vec<Vec<String>>, | ||||
|         threads: &ThreadPoolNoAbort, | ||||
|     ) -> Result<Vec<Vec<Embedding>>, EmbedError> { | ||||
|         // This condition helps reduce the number of active rayon jobs | ||||
|         // so that we avoid consuming all the LMDB rtxns and avoid stack overflows. | ||||
|         if threads.active_operations() >= REQUEST_PARALLELISM { | ||||
|             text_chunks.into_iter().map(move |chunk| self.embed(chunk, None)).collect() | ||||
|         } else { | ||||
| @@ -207,6 +209,8 @@ impl Embedder { | ||||
|         texts: &[&str], | ||||
|         threads: &ThreadPoolNoAbort, | ||||
|     ) -> Result<Vec<Embedding>, EmbedError> { | ||||
|         // This condition helps reduce the number of active rayon jobs | ||||
|         // so that we avoid consuming all the LMDB rtxns and avoid stack overflows. | ||||
|         if threads.active_operations() >= REQUEST_PARALLELISM { | ||||
|             let embeddings: Result<Vec<Vec<Embedding>>, _> = texts | ||||
|                 .chunks(self.prompt_count_in_chunk_hint()) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user