Skip to content

Commit

Permalink
[chore/issue127] progress observer activated in model
Browse files Browse the repository at this point in the history
  • Loading branch information
toschoo committed Mar 26, 2024
1 parent 3d4c749 commit 9e4d42d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions crates/edgen_server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ async fn run_server(args: &cli::Serve) -> Result<bool, types::EdgenError> {
.audio_transcriptions_model_name,
)
.await;
status::set_embeddings_active_model(
&SETTINGS.read().await.read().await.embeddings_model_name,
)
.await;
});
});

Expand Down
9 changes: 6 additions & 3 deletions crates/edgen_server/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@ async fn observe_download(
Endpoint::AudioTranscriptions => {
status::observe_audio_transcriptions_progress(dir, size, download).await
}
Endpoint::Embeddings => todo!(),
Endpoint::Embeddings => status::observe_embeddings_progress(dir, size, download).await,
}
}

async fn report_start_of_download(ep: Endpoint) {
match ep {
Endpoint::ChatCompletions => status::set_chat_completions_download(true).await,
Endpoint::AudioTranscriptions => status::set_audio_transcriptions_download(true).await,
Endpoint::Embeddings => todo!(),
Endpoint::Embeddings => status::set_embeddings_download(true).await,
}
}

Expand All @@ -354,7 +354,10 @@ async fn report_end_of_download(ep: Endpoint) {
status::set_audio_transcriptions_progress(100).await;
status::set_audio_transcriptions_download(false).await;
}
Endpoint::Embeddings => todo!(),
Endpoint::Embeddings => {
status::set_embeddings_progress(100).await;
status::set_embeddings_download(false).await;
}
}
}

Expand Down

0 comments on commit 9e4d42d

Please sign in to comment.