-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kb): fixed some bugs in file-to-embedding process (#35)
Because 1. wronng source table and uid 2. wrong destinaiton 3. fail to save vector type in db This commit fixed the bug above
- Loading branch information
Showing
10 changed files
with
663 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,3 +120,4 @@ tmp | |
/config/config_local.yaml | ||
test_.pdf | ||
test_.md | ||
test_pdf_base64.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package repository | ||
|
||
// import ( | ||
// "context" | ||
// "fmt" | ||
// "os" | ||
// "testing" | ||
|
||
// "github.com/google/uuid" | ||
// "github.com/instill-ai/artifact-backend/config" | ||
// "github.com/instill-ai/artifact-backend/pkg/db" | ||
// ) | ||
|
||
// func TestGetEmbeddingByUIDs(t *testing.T) { | ||
// // set file flag | ||
// // fs := flag.NewFlagSet(os.Args[0], flag.ExitOnError) | ||
// os.Args = []string{"", "-file", "../../config/config_local.yaml"} | ||
// config.Init() | ||
// // get db connection | ||
// db := db.GetConnection() | ||
// // get repository | ||
// repo := NewRepository(db) | ||
// // get embeddings | ||
// uid := "006db525-ad0f-4951-8dd0-d226156b789b" | ||
// // turn uid into uuid | ||
// uidUUID, err := uuid.Parse(uid) | ||
// if err != nil { | ||
// t.Fatalf("Failed to parse uid: %v", err) | ||
// } | ||
|
||
// embeddings, err := repo.GetEmbeddingByUIDs(context.TODO(), []uuid.UUID{uidUUID}) | ||
// if err != nil { | ||
// t.Fatalf("Failed to get embeddings: %v", err) | ||
// } | ||
// fmt.Println(embeddings) | ||
|
||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters