Load language models in the background

This commit is contained in:
Antonio Scandurra 2024-01-24 13:36:44 +01:00
parent 92b0184036
commit 22046ef9a7
4 changed files with 83 additions and 69 deletions

View file

@ -90,13 +90,12 @@ pub fn init(
.detach();
cx.spawn(move |cx| async move {
let embedding_provider =
OpenAIEmbeddingProvider::new(http_client, cx.background_executor().clone()).await;
let semantic_index = SemanticIndex::new(
fs,
db_file_path,
Arc::new(OpenAIEmbeddingProvider::new(
http_client,
cx.background_executor().clone(),
)),
Arc::new(embedding_provider),
language_registry,
cx.clone(),
)