Skip to content

Commit

Permalink
Removed unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jul 14, 2024
1 parent 66f21d7 commit 22d51a5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/hybrid-search/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function generateEmbedding(content) {
return Array.from(output.data);
}

for (let [i, content] of input.entries()) {
for (let content of input) {
const embedding = await generateEmbedding(content);
await client.query('INSERT INTO documents (content, embedding) VALUES ($1, $2)', [content, pgvector.toSql(embedding)]);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/transformers/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const input = [

const extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');

for (let [i, content] of input.entries()) {
for (let content of input) {
const output = await extractor(content, {pooling: 'mean', normalize: true});
const embedding = Array.from(output.data);
await client.query('INSERT INTO documents (content, embedding) VALUES ($1, $2)', [content, pgvector.toSql(embedding)]);
Expand Down
2 changes: 1 addition & 1 deletion src/mikro-orm/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Type, raw } = require('@mikro-orm/core');
const { raw } = require('@mikro-orm/core');
const { BitType } = require('./bit');
const { HalfvecType } = require('./halfvec');
const { SparsevecType } = require('./sparsevec');
Expand Down
2 changes: 1 addition & 1 deletion tests/drizzle-orm.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert';
import test from 'node:test';
import { sql, l2Distance, innerProduct, cosineDistance, l1Distance, hammingDistance, jaccardDistance } from 'drizzle-orm';
import { l2Distance, innerProduct, cosineDistance, l1Distance, hammingDistance, jaccardDistance } from 'drizzle-orm';
import { drizzle } from 'drizzle-orm/postgres-js';
import { pgTable, serial, vector, halfvec, bit, sparsevec } from 'drizzle-orm/pg-core';
import { SparseVector } from 'pgvector';
Expand Down
2 changes: 1 addition & 1 deletion tests/mikro-orm.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert';
import test from 'node:test';
import { MikroORM, EntityManager, EntitySchema } from '@mikro-orm/postgresql';
import { MikroORM, EntitySchema } from '@mikro-orm/postgresql';
import { VectorType, HalfvecType, BitType, SparsevecType, l2Distance, maxInnerProduct, cosineDistance, l1Distance, hammingDistance, jaccardDistance } from 'pgvector/mikro-orm';
import { SparseVector } from 'pgvector';

Expand Down
2 changes: 1 addition & 1 deletion tests/sequelize.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert';
import test from 'node:test';
import { Sequelize, DataTypes, Model } from 'sequelize';
import { Sequelize, DataTypes } from 'sequelize';
import pgvector from 'pgvector/sequelize';
import { l2Distance, maxInnerProduct, cosineDistance, l1Distance, hammingDistance, jaccardDistance } from 'pgvector/sequelize';
import { SparseVector } from 'pgvector';
Expand Down

0 comments on commit 22d51a5

Please sign in to comment.