summaryrefslogtreecommitdiffstats
path: root/src/client/model.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-06-21 21:56:25 +0800
committerGitHub <noreply@github.com>2024-06-21 21:56:25 +0800
commit7a089d846ec2b0f5447d253a52e884a5a6607881 (patch)
treee6740bc652c2b93e6f6a4bfa8ace722da8d1f2cf /src/client/model.rs
parentf2378e172548f3357fca6e561803bfe3a013bcb3 (diff)
downloadaichat-7a089d846ec2b0f5447d253a52e884a5a6607881.tar.gz
refactor: rename model.max_concurrent_chunks to model.max_batch_size (#626)
Diffstat (limited to 'src/client/model.rs')
-rw-r--r--src/client/model.rs12
1 files changed, 6 insertions, 6 deletions
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<isize> {
@@ -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<usize>,
- pub max_concurrent_chunks: Option<usize>,
+ pub max_batch_size: Option<usize>,
}
impl ModelData {