Skip to content

Commit

Permalink
Update lanter version on ci, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Feb 9, 2024
1 parent 9fc1067 commit d506866
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ci/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function setup_postgres() {
}

function setup_lantern() {
LANTERN_VERSION=v0.1.0
LANTERN_VERSION=v0.1.1
git clone --recursive https://github.com/lanterndata/lantern.git /tmp/lantern
pushd /tmp/lantern
git checkout ${LANTERN_VERSION} && \
Expand Down
1 change: 0 additions & 1 deletion lantern_daemon/src/embedding_jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ async fn embedding_worker(
client_ref.execute(&format!("UPDATE {jobs_table_name} SET init_finished_at=NOW(), updated_at=NOW() WHERE id=$1"), &[&job.id]).await?;
}

logger.info(&format!("Processed Rows: {processed_rows}, processed_tokens: {processed_tokens}"));
if processed_tokens > 0 {
let fn_name = get_full_table_name(&schema_ref, "increment_embedding_usage");
let res = client_ref.execute(&format!("SELECT {fn_name}({job_id},{usage},{tokens})", job_id=job.id, usage=processed_rows, tokens=processed_tokens), &[]).await;
Expand Down
4 changes: 2 additions & 2 deletions lantern_daemon/tests/daemon_test_with_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ async fn test_embedding_generation_runtime(
let cnt: i64 = client_data.get::<usize, i64>(0);
let client_data = db_client
.query(
&format!("SELECT * FROM {CLIENT_TABLE_NAME} WHERE ARRAY_LENGTH(title_embedding, 1) != {dimensions}"),
&format!("SELECT ARRAY_LENGTH(title_embedding, 1) FROM {CLIENT_TABLE_NAME} WHERE ARRAY_LENGTH(title_embedding, 1) != {dimensions}"),
&[],
)
.await
Expand Down Expand Up @@ -549,7 +549,6 @@ async fn test_cleanup() {
#[tokio::test]
async fn test_daemon() {
let runtimes = [
("ort", "microsoft/all-MiniLM-L12-v2", 384, ""),
(
"openai",
"openai/text-embedding-ada-002",
Expand All @@ -574,6 +573,7 @@ async fn test_daemon() {
768,
"COHERE_TOKEN",
),
("ort", "microsoft/all-MiniLM-L12-v2", 384, ""),
];

for (runtime, model, dim, params) in runtimes {
Expand Down

0 comments on commit d506866

Please sign in to comment.