remove lancedb logging

This commit is contained in:
timothycarambat 2023-06-14 00:27:19 -07:00
parent 5c933cba17
commit ca8e8245fc

View File

@ -26,8 +26,7 @@ function curateLanceSources(sources = []) {
} }
const LanceDb = { const LanceDb = {
uri: `${ uri: `${!!process.env.STORAGE_DIR ? `${process.env.STORAGE_DIR}/` : "./storage/"
!!process.env.STORAGE_DIR ? `${process.env.STORAGE_DIR}/` : "./storage/"
}lancedb`, }lancedb`,
name: "LanceDb", name: "LanceDb",
connect: async function () { connect: async function () {
@ -91,13 +90,11 @@ const LanceDb = {
updateOrCreateCollection: async function (client, data = [], namespace) { updateOrCreateCollection: async function (client, data = [], namespace) {
if (await this.hasNamespace(namespace)) { if (await this.hasNamespace(namespace)) {
const collection = await client.openTable(namespace); const collection = await client.openTable(namespace);
const result = await collection.add(data); await collection.add(data);
console.log({ result });
return true; return true;
} }
const result = await client.createTable(namespace, data); await client.createTable(namespace, data);
console.log({ result });
return true; return true;
}, },
hasNamespace: async function (namespace = null) { hasNamespace: async function (namespace = null) {
@ -149,7 +146,6 @@ const LanceDb = {
}); });
} }
console.log(submissions);
await this.updateOrCreateCollection(client, submissions, namespace); await this.updateOrCreateCollection(client, submissions, namespace);
await DocumentVectors.bulkInsert(documentVectors); await DocumentVectors.bulkInsert(documentVectors);
return true; return true;