Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

updated vector store settings to remove batch embeddings size

KCaverlyb68cd58a3b9a
diff --git a/assets/settings/default.json b/assets/settings/default.json
index cf8f630dfbd..1f8d12a3d9d 100644
--- a/assets/settings/default.json
+++ b/assets/settings/default.json
@@ -293,9 +293,8 @@
},
// Difference settings for vector_store
"vector_store": {
- "enable": false,
- "reindexing_delay_seconds": 600,
- "embedding_batch_size": 150
+ "enabled": false,
+ "reindexing_delay_seconds": 600
},
// Different settings for specific languages.
"languages": {
diff --git a/crates/vector_store/src/vector_store.rs b/crates/vector_store/src/vector_store.rs
index 87e70230ee5..0a197bc4066 100644
--- a/crates/vector_store/src/vector_store.rs
+++ b/crates/vector_store/src/vector_store.rs
@@ -37,6 +37,7 @@ use util::{
use workspace::{Workspace, WorkspaceCreated};
const VECTOR_STORE_VERSION: usize = 0;
+const EMBEDDINGS_BATCH_SIZE: usize = 150;
pub fn init(
fs: Arc<dyn Fs>,
@@ -70,7 +71,7 @@ pub fn init(
);
if *RELEASE_CHANNEL == ReleaseChannel::Stable
- || !settings::get::<VectorStoreSettings>(cx).enable
+ || !settings::get::<VectorStoreSettings>(cx).enabled
{
return;
}
@@ -353,7 +354,6 @@ impl VectorStore {
});
// batch_tx/rx: Batch Files to Send for Embeddings
- let batch_size = settings::get::<VectorStoreSettings>(cx).embedding_batch_size;
let (batch_files_tx, batch_files_rx) = channel::unbounded::<EmbeddingJob>();
let _batch_files_task = cx.background().spawn(async move {
let mut queue_len = 0;
@@ -368,7 +368,7 @@ impl VectorStore {
} => {
queue_len += &document_spans.len();
embeddings_queue.push((worktree_id, parsed_file, document_spans));
- queue_len >= batch_size
+ queue_len >= EMBEDDINGS_BATCH_SIZE
}
EmbeddingJob::Flush => true,
};
diff --git a/crates/vector_store/src/vector_store_settings.rs b/crates/vector_store/src/vector_store_settings.rs
index 0bde07dd651..e1fa7cc05a3 100644
--- a/crates/vector_store/src/vector_store_settings.rs
+++ b/crates/vector_store/src/vector_store_settings.rs
@@ -5,16 +5,14 @@ use settings::Setting;
#[derive(Deserialize, Debug)]
pub struct VectorStoreSettings {
- pub enable: bool,
+ pub enabled: bool,
pub reindexing_delay_seconds: usize,
- pub embedding_batch_size: usize,
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
pub struct VectorStoreSettingsContent {
- pub enable: Option<bool>,
+ pub enabled: Option<bool>,
pub reindexing_delay_seconds: Option<usize>,
- pub embedding_batch_size: Option<usize>,
}
impl Setting for VectorStoreSettings {