mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-06 04:36:32 +00:00
remove-me: Introduce an env var to change the embeddings chunk size
This commit is contained in:
committed by
Kerollmops
parent
177648d5bd
commit
c1b0a040e6
@ -321,7 +321,14 @@ impl Embedder {
|
|||||||
pub fn prompt_count_in_chunk_hint(&self) -> usize {
|
pub fn prompt_count_in_chunk_hint(&self) -> usize {
|
||||||
match self.data.request.input_type() {
|
match self.data.request.input_type() {
|
||||||
InputType::Text => 1,
|
InputType::Text => 1,
|
||||||
InputType::TextArray => 10,
|
InputType::TextArray => {
|
||||||
|
let chunk_size = std::env::var("MEILI_EMBEDDINGS_CHUNK_SIZE")
|
||||||
|
.ok()
|
||||||
|
.and_then(|chunk_size| chunk_size.parse().ok())
|
||||||
|
.unwrap_or(10);
|
||||||
|
assert!(chunk_size <= 100, "Embedding chunk size cannot exceed 100");
|
||||||
|
chunk_size
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user