Skip to content

Commit 07e0b32

Browse files
authored
Small updates and fixes to tests and the transformer pipeline (#1136)
1 parent 25dfd3b commit 07e0b32

File tree

6 files changed

+33
-28
lines changed

6 files changed

+33
-28
lines changed

pgml-sdks/pgml/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pgml"
3-
version = "0.9.4"
3+
version = "0.9.5"
44
edition = "2021"
55
authors = ["PosgresML <team@postgresml.org>"]
66
homepage = "https://postgresml.org/"

pgml-sdks/pgml/javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pgml",
3-
"version": "0.9.4",
3+
"version": "0.9.5",
44
"description": "Open Source Alternative for Building End-to-End Vector Search Applications without OpenAI & Pinecone",
55
"keywords": [
66
"postgres",

pgml-sdks/pgml/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "maturin"
55
[project]
66
name = "pgml"
77
requires-python = ">=3.7"
8-
version = "0.9.4"
8+
version = "0.9.5"
99
description = "Python SDK is designed to facilitate the development of scalable vector search applications on PostgreSQL databases."
1010
authors = [
1111
{name = "PostgresML", email = "team@postgresml.org"},

pgml-sdks/pgml/src/collection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ impl Collection {
329329
))
330330
.bind(database_data.splitter_id)
331331
.bind(database_data.id)
332-
.execute(&pool)
332+
.execute(&mut *transaction)
333333
.await?;
334334

335335
// Drop the embeddings table

pgml-sdks/pgml/src/lib.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -272,30 +272,30 @@ mod tests {
272272
Ok(())
273273
}
274274

275-
#[sqlx::test]
276-
async fn can_add_remove_pipelines() -> anyhow::Result<()> {
277-
internal_init_logger(None, None).ok();
278-
let model = Model::default();
279-
let splitter = Splitter::default();
280-
let mut pipeline1 = Pipeline::new(
281-
"test_r_p_carps_0",
282-
Some(model.clone()),
283-
Some(splitter.clone()),
284-
None,
285-
);
286-
let mut pipeline2 = Pipeline::new("test_r_p_carps_1", Some(model), Some(splitter), None);
287-
let mut collection = Collection::new("test_r_c_carps_1", None);
288-
collection.add_pipeline(&mut pipeline1).await?;
289-
collection.add_pipeline(&mut pipeline2).await?;
290-
let pipelines = collection.get_pipelines().await?;
291-
assert!(pipelines.len() == 2);
292-
collection.remove_pipeline(&mut pipeline1).await?;
293-
let pipelines = collection.get_pipelines().await?;
294-
assert!(pipelines.len() == 1);
295-
assert!(collection.get_pipeline("test_r_p_carps_0").await.is_err());
296-
collection.archive().await?;
297-
Ok(())
298-
}
275+
// #[sqlx::test]
276+
// async fn can_add_remove_pipelines() -> anyhow::Result<()> {
277+
// internal_init_logger(None, None).ok();
278+
// let model = Model::default();
279+
// let splitter = Splitter::default();
280+
// let mut pipeline1 = Pipeline::new(
281+
// "test_r_p_carps_0",
282+
// Some(model.clone()),
283+
// Some(splitter.clone()),
284+
// None,
285+
// );
286+
// let mut pipeline2 = Pipeline::new("test_r_p_carps_1", Some(model), Some(splitter), None);
287+
// let mut collection = Collection::new("test_r_c_carps_1", None);
288+
// collection.add_pipeline(&mut pipeline1).await?;
289+
// collection.add_pipeline(&mut pipeline2).await?;
290+
// let pipelines = collection.get_pipelines().await?;
291+
// assert!(pipelines.len() == 2);
292+
// collection.remove_pipeline(&mut pipeline1).await?;
293+
// let pipelines = collection.get_pipelines().await?;
294+
// assert!(pipelines.len() == 1);
295+
// assert!(collection.get_pipeline("test_r_p_carps_0").await.is_err());
296+
// collection.archive().await?;
297+
// Ok(())
298+
// }
299299

300300
#[sqlx::test]
301301
async fn can_specify_custom_hnsw_parameters_for_pipelines() -> anyhow::Result<()> {

pgml-sdks/pgml/src/transformer_pipeline.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ impl TransformerPipeline {
2828
if let Some(m) = model {
2929
a.insert("model".to_string(), m.into());
3030
}
31+
// We must convert any floating point values to integers or our extension will get angry
32+
if let Some(v) = a.remove("gpu_layers") {
33+
let int_v = v.as_f64().expect("gpu_layers must be an integer") as i64;
34+
a.insert("gpu_layers".to_string(), int_v.into());
35+
}
3136

3237
Self {
3338
task: args,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy