Skip to content

Commit

Permalink
chore(scheduler): remove experimental doc index config (#2438)
Browse files Browse the repository at this point in the history
  • Loading branch information
boxbeam authored Jun 18, 2024
1 parent b485d12 commit af39631
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
8 changes: 0 additions & 8 deletions crates/tabby-common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ pub struct Config {

#[serde(default)]
pub model: ModelConfigGroup,

#[serde(default)]
pub experimental: ExperimentalConfig,
}

impl Config {
Expand Down Expand Up @@ -249,11 +246,6 @@ fn default_num_gpu_layers() -> u16 {
9999
}

#[derive(Serialize, Deserialize, Default, Debug, Clone)]
pub struct ExperimentalConfig {
pub doc: Option<DocIndexConfig>,
}

#[derive(Serialize, Deserialize, Default, Debug, Clone)]
pub struct DocIndexConfig {
pub start_urls: Vec<String>,
Expand Down
16 changes: 1 addition & 15 deletions crates/tabby-scheduler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use indexer::{IndexAttributeBuilder, Indexer};
use tabby_inference::Embedding;

mod doc;
use std::{env, sync::Arc};
use std::sync::Arc;

use tokio_cron_scheduler::{Job, JobScheduler};
use tracing::{debug, info, warn};
Expand All @@ -25,9 +25,6 @@ use crate::doc::SourceDocument;
pub async fn scheduler(now: bool, config: &tabby_common::config::Config) {
if now {
scheduler_pipeline(config).await;
if env::var("TABBY_SCHEDULER_EXPERIMENTAL_DOC_INDEX").is_ok() {
doc_index_pipeline(config).await;
}
} else {
let scheduler = JobScheduler::new()
.await
Expand Down Expand Up @@ -78,17 +75,6 @@ async fn scheduler_pipeline(config: &tabby_common::config::Config) {
code.garbage_collection(repositories);
}

async fn doc_index_pipeline(config: &tabby_common::config::Config) {
let Some(index_config) = &config.experimental.doc else {
return;
};

let embedding_config = &config.model.embedding;
let embedding = llama_cpp_server::create_embedding(embedding_config).await;

crawl_index_docs(&index_config.start_urls, embedding).await;
}

pub async fn crawl_index_docs(urls: &[String], embedding: Arc<dyn Embedding>) {
for url in urls {
debug!("Starting doc index pipeline for {url}");
Expand Down

0 comments on commit af39631

Please sign in to comment.