From 7a089d846ec2b0f5447d253a52e884a5a6607881 Mon Sep 17 00:00:00 2001 From: sigoden Date: Fri, 21 Jun 2024 21:56:25 +0800 Subject: refactor: rename model.max_concurrent_chunks to model.max_batch_size (#626) --- src/client/model.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/client/model.rs') diff --git a/src/client/model.rs b/src/client/model.rs index 0584f82..4c69d78 100644 --- a/src/client/model.rs +++ b/src/client/model.rs @@ -175,8 +175,8 @@ impl Model { self.data.default_chunk_size.unwrap_or(1000) } - pub fn max_concurrent_chunks(&self) -> usize { - self.data.max_concurrent_chunks.unwrap_or(1) + pub fn max_batch_size(&self) -> usize { + self.data.max_batch_size.unwrap_or(1) } pub fn max_tokens_param(&self) -> Option { @@ -234,9 +234,9 @@ impl Model { Ok(()) } - pub fn guard_max_concurrent_chunks(&self, data: &EmbeddingsData) -> Result<()> { - if data.texts.len() > self.max_concurrent_chunks() { - bail!("Exceed max_concurrent_chunks limit"); + pub fn guard_max_batch_size(&self, data: &EmbeddingsData) -> Result<()> { + if data.texts.len() > self.max_batch_size() { + bail!("Exceed max_batch_size limit"); } Ok(()) } @@ -262,7 +262,7 @@ pub struct ModelData { // embedding-only properties pub default_chunk_size: Option, - pub max_concurrent_chunks: Option, + pub max_batch_size: Option, } impl ModelData { -- cgit v1.2.3