Skip to content

Commit

Permalink
Mv embeddingEndpoints.ts (huggingface#688)
Browse files Browse the repository at this point in the history
* Mv embeddingEndpoints.ts

* relative import
  • Loading branch information
Mishig authored Jan 10, 2024
1 parent d1a8b04 commit 72b7ce1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { z } from "zod";
import {
embeddingEndpointTei,
embeddingEndpointTeiParametersSchema,
} from "$lib/server/embeddingEndpoints/tei/embeddingEndpoints";
} from "./tei/embeddingEndpoints";
import {
embeddingEndpointTransformersJS,
embeddingEndpointTransformersJSParametersSchema,
} from "$lib/server/embeddingEndpoints/transformersjs/embeddingEndpoints";
} from "./transformersjs/embeddingEndpoints";

// parameters passed when generating text
interface EmbeddingEndpointParameters {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import type { EmbeddingEndpoint, Embedding } from "$lib/types/EmbeddingEndpoints";
import type { EmbeddingEndpoint, Embedding } from "../embeddingEndpoints";
import { chunk } from "$lib/utils/chunk";

export const embeddingEndpointTeiParametersSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import type { EmbeddingEndpoint } from "$lib/types/EmbeddingEndpoints";
import type { EmbeddingEndpoint } from "../embeddingEndpoints";
import type { Tensor, Pipeline } from "@xenova/transformers";
import { pipeline } from "@xenova/transformers";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/server/embeddingModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
embeddingEndpoints,
embeddingEndpointSchema,
type EmbeddingEndpoint,
} from "$lib/types/EmbeddingEndpoints";
} from "$lib/server/embeddingEndpoints/embeddingEndpoints";
import { embeddingEndpointTransformersJS } from "$lib/server/embeddingEndpoints/transformersjs/embeddingEndpoints";

const modelConfig = z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/lib/server/sentenceSimilarity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { dot } from "@xenova/transformers";
import type { EmbeddingBackendModel } from "$lib/server/embeddingModels";
import type { Embedding } from "$lib/types/EmbeddingEndpoints";
import type { Embedding } from "$lib/server/embeddingEndpoints/embeddingEndpoints";

// see here: https://github.com/nmslib/hnswlib/blob/359b2ba87358224963986f709e593d799064ace6/README.md?plain=1#L34
function innerProduct(embeddingA: Embedding, embeddingB: Embedding) {
Expand Down

0 comments on commit 72b7ce1

Please sign in to comment.