Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Small updates and fixes to tests and the transformer pipeline#1136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SilasMarvin merged 2 commits intomasterfromsilas-transformer-pipeline-update
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionpgml-sdks/pgml/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
[package]
name = "pgml"
version = "0.9.4"
version = "0.9.5"
edition = "2021"
authors = ["PosgresML <team@postgresml.org>"]
homepage = "https://postgresml.org/"
Expand Down
2 changes: 1 addition & 1 deletionpgml-sdks/pgml/javascript/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "pgml",
"version": "0.9.4",
"version": "0.9.5",
"description": "Open Source Alternative for Building End-to-End Vector Search Applications without OpenAI & Pinecone",
"keywords": [
"postgres",
Expand Down
2 changes: 1 addition & 1 deletionpgml-sdks/pgml/pyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ build-backend = "maturin"
[project]
name = "pgml"
requires-python = ">=3.7"
version = "0.9.4"
version = "0.9.5"
description = "Python SDK is designed to facilitate the development of scalable vector search applications on PostgreSQL databases."
authors = [
{name = "PostgresML", email = "team@postgresml.org"},
Expand Down
2 changes: 1 addition & 1 deletionpgml-sdks/pgml/src/collection.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -329,7 +329,7 @@ impl Collection {
))
.bind(database_data.splitter_id)
.bind(database_data.id)
.execute(&pool)
.execute(&mut *transaction)
.await?;

// Drop the embeddings table
Expand Down
48 changes: 24 additions & 24 deletionspgml-sdks/pgml/src/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -272,30 +272,30 @@ mod tests {
Ok(())
}

#[sqlx::test]
async fn can_add_remove_pipelines() -> anyhow::Result<()> {
internal_init_logger(None, None).ok();
let model = Model::default();
let splitter = Splitter::default();
let mut pipeline1 = Pipeline::new(
"test_r_p_carps_0",
Some(model.clone()),
Some(splitter.clone()),
None,
);
let mut pipeline2 = Pipeline::new("test_r_p_carps_1", Some(model), Some(splitter), None);
let mut collection = Collection::new("test_r_c_carps_1", None);
collection.add_pipeline(&mut pipeline1).await?;
collection.add_pipeline(&mut pipeline2).await?;
let pipelines = collection.get_pipelines().await?;
assert!(pipelines.len() == 2);
collection.remove_pipeline(&mut pipeline1).await?;
let pipelines = collection.get_pipelines().await?;
assert!(pipelines.len() == 1);
assert!(collection.get_pipeline("test_r_p_carps_0").await.is_err());
collection.archive().await?;
Ok(())
}
//#[sqlx::test]
//async fn can_add_remove_pipelines() -> anyhow::Result<()> {
// internal_init_logger(None, None).ok();
// let model = Model::default();
// let splitter = Splitter::default();
// let mut pipeline1 = Pipeline::new(
// "test_r_p_carps_0",
// Some(model.clone()),
// Some(splitter.clone()),
// None,
// );
// let mut pipeline2 = Pipeline::new("test_r_p_carps_1", Some(model), Some(splitter), None);
// let mut collection = Collection::new("test_r_c_carps_1", None);
// collection.add_pipeline(&mut pipeline1).await?;
// collection.add_pipeline(&mut pipeline2).await?;
// let pipelines = collection.get_pipelines().await?;
// assert!(pipelines.len() == 2);
// collection.remove_pipeline(&mut pipeline1).await?;
// let pipelines = collection.get_pipelines().await?;
// assert!(pipelines.len() == 1);
// assert!(collection.get_pipeline("test_r_p_carps_0").await.is_err());
// collection.archive().await?;
// Ok(())
//}

#[sqlx::test]
async fn can_specify_custom_hnsw_parameters_for_pipelines() -> anyhow::Result<()> {
Expand Down
5 changes: 5 additions & 0 deletionspgml-sdks/pgml/src/transformer_pipeline.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,6 +28,11 @@ impl TransformerPipeline {
if let Some(m) = model {
a.insert("model".to_string(), m.into());
}
// We must convert any floating point values to integers or our extension will get angry
if let Some(v) = a.remove("gpu_layers") {
let int_v = v.as_f64().expect("gpu_layers must be an integer") as i64;
a.insert("gpu_layers".to_string(), int_v.into());
}

Self {
task: args,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp