diff --git a/node_modules/@huggingface/hub/src/lib/list-datasets.spec.ts b/node_modules/@huggingface/hub/src/lib/list-datasets.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..9b8c42cdd97840488f01a472febba8661312b319 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/list-datasets.spec.ts @@ -0,0 +1,47 @@ +import { describe, expect, it } from "vitest"; +import type { DatasetEntry } from "./list-datasets"; +import { listDatasets } from "./list-datasets"; + +describe("listDatasets", () => { + it("should list datasets from hf-doc-builder", async () => { + const results: DatasetEntry[] = []; + + for await (const entry of listDatasets({ search: { owner: "hf-doc-build" } })) { + if (entry.name !== "hf-doc-build/doc-build" && entry.name !== "hf-doc-build/doc-build-dev") { + continue; + } + if (typeof entry.downloads === "number") { + entry.downloads = 0; + } + if (typeof entry.likes === "number") { + entry.likes = 0; + } + if (entry.updatedAt instanceof Date && !isNaN(entry.updatedAt.getTime())) { + entry.updatedAt = new Date(0); + } + + results.push(entry); + } + + expect(results.sort((a, b) => a.id.localeCompare(b.id))).to.deep.equal([ + { + id: "6356b19985da6f13863228bd", + name: "hf-doc-build/doc-build", + private: false, + gated: false, + downloads: 0, + likes: 0, + updatedAt: new Date(0), + }, + { + id: "636a1b69f2f9ec4289c4c19e", + name: "hf-doc-build/doc-build-dev", + gated: false, + private: false, + downloads: 0, + likes: 0, + updatedAt: new Date(0), + }, + ]); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/list-datasets.ts b/node_modules/@huggingface/hub/src/lib/list-datasets.ts new file mode 100644 index 0000000000000000000000000000000000000000..f71280cf072538cf2b68b42d1d8fdd8fa7d7f646 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/list-datasets.ts @@ -0,0 +1,135 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import type { ApiDatasetInfo } from "../types/api/api-dataset"; +import type { CredentialsParams } from "../types/public"; +import { checkCredentials } from "../utils/checkCredentials"; +import { parseLinkHeader } from "../utils/parseLinkHeader"; +import { pick } from "../utils/pick"; + +export const DATASET_EXPAND_KEYS = [ + "private", + "downloads", + "gated", + "likes", + "lastModified", +] as const satisfies readonly (keyof ApiDatasetInfo)[]; + +export const DATASET_EXPANDABLE_KEYS = [ + "author", + "cardData", + "citation", + "createdAt", + "disabled", + "description", + "downloads", + "downloadsAllTime", + "gated", + "gitalyUid", + "lastModified", + "likes", + "paperswithcode_id", + "private", + // "siblings", + "sha", + "tags", +] as const satisfies readonly (keyof ApiDatasetInfo)[]; + +export interface DatasetEntry { + id: string; + name: string; + private: boolean; + downloads: number; + gated: false | "auto" | "manual"; + likes: number; + updatedAt: Date; +} + +export async function* listDatasets< + const T extends Exclude<(typeof DATASET_EXPANDABLE_KEYS)[number], (typeof DATASET_EXPAND_KEYS)[number]> = never, +>( + params?: { + search?: { + /** + * Will search in the dataset name for matches + */ + query?: string; + owner?: string; + tags?: string[]; + }; + hubUrl?: string; + additionalFields?: T[]; + /** + * Set to limit the number of datasets returned. + */ + limit?: number; + /** + * Sort datasets by a specific field. + */ + sort?: + | "createdAt" + | "downloads" + | "likes" + | "lastModified" + | "likes30d" + | "trendingScore" + | "datasetsServerInfo.numRows" + | "mainSize" + | "id"; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): AsyncGenerator> { + const accessToken = params && checkCredentials(params); + let totalToFetch = params?.limit ?? Infinity; + const search = new URLSearchParams([ + ...Object.entries({ + limit: String(Math.min(totalToFetch, 500)), + ...(params?.search?.owner ? { author: params.search.owner } : undefined), + ...(params?.search?.query ? { search: params.search.query } : undefined), + ...(params?.sort ? { sort: params.sort } : undefined), + }), + ...(params?.search?.tags?.map((tag) => ["filter", tag]) ?? []), + ...DATASET_EXPAND_KEYS.map((val) => ["expand", val] satisfies [string, string]), + ...(params?.additionalFields?.map((val) => ["expand", val] satisfies [string, string]) ?? []), + ]).toString(); + let url: string | undefined = `${params?.hubUrl || HUB_URL}/api/datasets` + (search ? "?" + search : ""); + + while (url) { + const res: Response = await (params?.fetch ?? fetch)(url, { + headers: { + accept: "application/json", + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined), + }, + }); + + if (!res.ok) { + throw await createApiError(res); + } + + const items: ApiDatasetInfo[] = await res.json(); + + for (const item of items) { + yield { + ...(params?.additionalFields && pick(item, params.additionalFields)), + id: item._id, + name: item.id, + private: item.private, + downloads: item.downloads, + likes: item.likes, + gated: item.gated, + updatedAt: new Date(item.lastModified), + } as DatasetEntry & Pick; + totalToFetch--; + if (totalToFetch <= 0) { + return; + } + } + + const linkHeader = res.headers.get("Link"); + + url = linkHeader ? parseLinkHeader(linkHeader).next : undefined; + // Could update limit in url to fetch less items if not all items of next page are needed. + } +} diff --git a/node_modules/@huggingface/hub/src/lib/list-files.spec.ts b/node_modules/@huggingface/hub/src/lib/list-files.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..00d3777de8f05a034db5d589c1e2113795598d55 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/list-files.spec.ts @@ -0,0 +1,173 @@ +import { assert, it, describe } from "vitest"; +import type { ListFileEntry } from "./list-files"; +import { listFiles } from "./list-files"; + +describe("listFiles", () => { + it("should fetch the list of files from the repo", async () => { + const cursor = listFiles({ + repo: { + name: "google-bert/bert-base-uncased", + type: "model", + }, + revision: "dd4bc8b21efa05ec961e3efc4ee5e3832a3679c7", + }); + + const files: ListFileEntry[] = []; + + for await (const entry of cursor) { + files.push(entry); + } + + assert.deepStrictEqual(files, [ + { + oid: "dc08351d4dc0732d9c8af04070ced089b201ce2f", + path: ".gitattributes", + size: 345, + type: "file", + }, + { + oid: "fca794a5f07ff8f963fe8b61e3694b0fb7f955df", + path: "config.json", + size: 313, + type: "file", + }, + { + lfs: { + oid: "097417381d6c7230bd9e3557456d726de6e83245ec8b24f529f60198a67b203a", + size: 440473133, + pointerSize: 134, + }, + xetHash: "2d8408d3a894d02517d04956e2f7546ff08362594072f3527ce144b5212a3296", + oid: "ba5d19791be1dd7992e33bd61f20207b0f7f50a5", + path: "pytorch_model.bin", + size: 440473133, + type: "file", + }, + { + lfs: { + oid: "a7a17d6d844b5de815ccab5f42cad6d24496db3850a2a43d8258221018ce87d2", + size: 536063208, + pointerSize: 134, + }, + xetHash: "879c5715c18a0b7f051dd33f70f0a5c8dd1522e0a43f6f75520f16167f29279b", + oid: "9eb98c817f04b051b3bcca591bcd4e03cec88018", + path: "tf_model.h5", + size: 536063208, + type: "file", + }, + { + oid: "fb140275c155a9c7c5a3b3e0e77a9e839594a938", + path: "vocab.txt", + size: 231508, + type: "file", + }, + ]); + }); + + it("should fetch the list of files from the repo, including last commit", async () => { + const cursor = listFiles({ + repo: { + name: "google-bert/bert-base-uncased", + type: "model", + }, + revision: "dd4bc8b21efa05ec961e3efc4ee5e3832a3679c7", + expand: true, + }); + + const files: ListFileEntry[] = []; + + for await (const entry of cursor) { + delete entry.securityFileStatus; // flaky + files.push(entry); + } + + assert.deepStrictEqual(files, [ + { + lastCommit: { + date: "2018-11-14T23:35:08.000Z", + id: "504939aa53e8ce310dba3dd2296dbe266c575de4", + title: "initial commit", + }, + oid: "dc08351d4dc0732d9c8af04070ced089b201ce2f", + path: ".gitattributes", + size: 345, + type: "file", + }, + { + lastCommit: { + date: "2019-06-18T09:06:51.000Z", + id: "bb3c1c3256d2598217df9889a14a2e811587891d", + title: "Update config.json", + }, + oid: "fca794a5f07ff8f963fe8b61e3694b0fb7f955df", + path: "config.json", + size: 313, + type: "file", + }, + { + lastCommit: { + date: "2019-06-18T09:06:34.000Z", + id: "3d2477d72b675a999d1b13ca822aaaf4908634ad", + title: "Update pytorch_model.bin", + }, + lfs: { + oid: "097417381d6c7230bd9e3557456d726de6e83245ec8b24f529f60198a67b203a", + size: 440473133, + pointerSize: 134, + }, + xetHash: "2d8408d3a894d02517d04956e2f7546ff08362594072f3527ce144b5212a3296", + oid: "ba5d19791be1dd7992e33bd61f20207b0f7f50a5", + path: "pytorch_model.bin", + size: 440473133, + type: "file", + }, + { + lastCommit: { + date: "2019-09-23T19:48:44.000Z", + id: "dd4bc8b21efa05ec961e3efc4ee5e3832a3679c7", + title: "Update tf_model.h5", + }, + lfs: { + oid: "a7a17d6d844b5de815ccab5f42cad6d24496db3850a2a43d8258221018ce87d2", + size: 536063208, + pointerSize: 134, + }, + xetHash: "879c5715c18a0b7f051dd33f70f0a5c8dd1522e0a43f6f75520f16167f29279b", + oid: "9eb98c817f04b051b3bcca591bcd4e03cec88018", + path: "tf_model.h5", + size: 536063208, + type: "file", + }, + { + lastCommit: { + date: "2018-11-14T23:35:08.000Z", + id: "2f07d813ca87c8c709147704c87210359ccf2309", + title: "Update vocab.txt", + }, + oid: "fb140275c155a9c7c5a3b3e0e77a9e839594a938", + path: "vocab.txt", + size: 231508, + type: "file", + }, + ]); + }); + + it("should fetch the list of files from the repo, including subfolders", async () => { + const cursor = listFiles({ + repo: { + name: "xsum", + type: "dataset", + }, + revision: "0f3ea2f2b55fcb11e71fb1e3aec6822e44ddcb0f", + recursive: true, + }); + + const files: ListFileEntry[] = []; + + for await (const entry of cursor) { + files.push(entry); + } + + assert(files.some((file) => file.path === "data/XSUM-EMNLP18-Summary-Data-Original.tar.gz")); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/list-files.ts b/node_modules/@huggingface/hub/src/lib/list-files.ts new file mode 100644 index 0000000000000000000000000000000000000000..648a6463a9786bc972394b95da95d9fd4c342b5c --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/list-files.ts @@ -0,0 +1,94 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import type { ApiIndexTreeEntry } from "../types/api/api-index-tree"; +import type { CredentialsParams, RepoDesignation } from "../types/public"; +import { checkCredentials } from "../utils/checkCredentials"; +import { parseLinkHeader } from "../utils/parseLinkHeader"; +import { toRepoId } from "../utils/toRepoId"; + +export interface ListFileEntry { + type: "file" | "directory" | "unknown"; + size: number; + path: string; + oid: string; + lfs?: { + oid: string; + size: number; + /** Size of the raw pointer file, 100~200 bytes */ + pointerSize: number; + }; + /** + * Xet-backed hash, a new protocol replacing LFS for big files. + */ + xetHash?: string; + /** + * Only fetched if `expand` is set to `true` in the `listFiles` call. + */ + lastCommit?: { + date: string; + id: string; + title: string; + }; + /** + * Only fetched if `expand` is set to `true` in the `listFiles` call. + */ + securityFileStatus?: unknown; +} + +/** + * List files in a folder. To list ALL files in the directory, call it + * with {@link params.recursive} set to `true`. + */ +export async function* listFiles( + params: { + repo: RepoDesignation; + /** + * Do we want to list files in subdirectories? + */ + recursive?: boolean; + /** + * Eg 'data' for listing all files in the 'data' folder. Leave it empty to list all + * files in the repo. + */ + path?: string; + /** + * Fetch `lastCommit` and `securityFileStatus` for each file. + */ + expand?: boolean; + revision?: string; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): AsyncGenerator { + const accessToken = checkCredentials(params); + const repoId = toRepoId(params.repo); + let url: string | undefined = `${params.hubUrl || HUB_URL}/api/${repoId.type}s/${repoId.name}/tree/${ + params.revision || "main" + }${params.path ? "/" + params.path : ""}?recursive=${!!params.recursive}&expand=${!!params.expand}`; + + while (url) { + const res: Response = await (params.fetch ?? fetch)(url, { + headers: { + accept: "application/json", + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined), + }, + }); + + if (!res.ok) { + throw await createApiError(res); + } + + const items: ApiIndexTreeEntry[] = await res.json(); + + for (const item of items) { + yield item; + } + + const linkHeader = res.headers.get("Link"); + + url = linkHeader ? parseLinkHeader(linkHeader).next : undefined; + } +} diff --git a/node_modules/@huggingface/hub/src/lib/list-models.spec.ts b/node_modules/@huggingface/hub/src/lib/list-models.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..8307031c6a4f5853ba0feb1c7bf81282dd3b34da --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/list-models.spec.ts @@ -0,0 +1,151 @@ +import { describe, expect, it } from "vitest"; +import type { ModelEntry } from "./list-models"; +import { listModels } from "./list-models"; + +describe("listModels", () => { + it("should list models for depth estimation", async () => { + const results: ModelEntry[] = []; + + for await (const entry of listModels({ + search: { owner: "Intel", task: "depth-estimation" }, + })) { + if (typeof entry.downloads === "number") { + entry.downloads = 0; + } + if (typeof entry.likes === "number") { + entry.likes = 0; + } + if (entry.updatedAt instanceof Date && !isNaN(entry.updatedAt.getTime())) { + entry.updatedAt = new Date(0); + } + + if (!["Intel/dpt-large", "Intel/dpt-hybrid-midas"].includes(entry.name)) { + expect(entry.task).to.equal("depth-estimation"); + continue; + } + + results.push(entry); + } + + results.sort((a, b) => a.id.localeCompare(b.id)); + + expect(results).deep.equal([ + { + id: "621ffdc136468d709f17e709", + name: "Intel/dpt-large", + private: false, + gated: false, + downloads: 0, + likes: 0, + task: "depth-estimation", + updatedAt: new Date(0), + }, + { + id: "638f07977559bf9a2b2b04ac", + name: "Intel/dpt-hybrid-midas", + gated: false, + private: false, + downloads: 0, + likes: 0, + task: "depth-estimation", + updatedAt: new Date(0), + }, + ]); + }); + + it("should list indonesian models with gguf format", async () => { + let count = 0; + for await (const entry of listModels({ + search: { tags: ["gguf", "id"] }, + additionalFields: ["tags"], + limit: 2, + })) { + count++; + expect(entry.tags).to.include("gguf"); + expect(entry.tags).to.include("id"); + } + + expect(count).to.equal(2); + }); + + it("should search model by name", async () => { + let count = 0; + for await (const entry of listModels({ + search: { query: "t5" }, + limit: 10, + })) { + count++; + expect(entry.name.toLocaleLowerCase()).to.include("t5"); + } + + expect(count).to.equal(10); + }); + + it("should search model by inference provider", async () => { + let count = 0; + for await (const entry of listModels({ + search: { inferenceProviders: ["together"] }, + additionalFields: ["inferenceProviderMapping"], + limit: 10, + })) { + count++; + if (Array.isArray(entry.inferenceProviderMapping)) { + expect(entry.inferenceProviderMapping.map(({ provider }) => provider)).to.include("together"); + } + } + + expect(count).to.equal(10); + }); + + it("should search model by several inference providers", async () => { + let count = 0; + const inferenceProviders = ["together", "replicate"]; + for await (const entry of listModels({ + search: { inferenceProviders }, + additionalFields: ["inferenceProviderMapping"], + limit: 10, + })) { + count++; + if (Array.isArray(entry.inferenceProviderMapping)) { + expect( + entry.inferenceProviderMapping.filter(({ provider }) => inferenceProviders.includes(provider)).length, + ).toBeGreaterThan(0); + } + } + + expect(count).to.equal(10); + }); + + it("should list meta-llama models with inference provider mapping", async () => { + let count = 0; + for await (const entry of listModels({ + search: { owner: "meta-llama" }, + additionalFields: ["inferenceProviderMapping"], + limit: 1, + })) { + count++; + expect(entry.inferenceProviderMapping).to.be.an("array").that.is.not.empty; + for (const item of entry.inferenceProviderMapping ?? []) { + expect(item).to.have.property("provider").that.is.a("string").and.is.not.empty; + expect(item).to.have.property("hfModelId").that.is.a("string").and.is.not.empty; + expect(item).to.have.property("providerId").that.is.a("string").and.is.not.empty; + } + } + + expect(count).to.equal(1); + }); + + it("should search models by apps", async () => { + let count = 0; + for await (const entry of listModels({ + search: { apps: ["mlx-lm"] }, + additionalFields: ["tags"], + limit: 10, + })) { + count++; + expect(entry.tags).to.include("mlx"); + } + + expect(count).to.equal(10); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/list-models.ts b/node_modules/@huggingface/hub/src/lib/list-models.ts new file mode 100644 index 0000000000000000000000000000000000000000..8a8e1e41c80263c2d931455ec3abdc820078df19 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/list-models.ts @@ -0,0 +1,171 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import type { ApiModelInfo } from "../types/api/api-model"; +import type { CredentialsParams, PipelineType } from "../types/public"; +import { checkCredentials } from "../utils/checkCredentials"; +import { parseLinkHeader } from "../utils/parseLinkHeader"; +import { pick } from "../utils/pick"; +import { normalizeInferenceProviderMapping } from "../utils/normalizeInferenceProviderMapping"; + +export const MODEL_EXPAND_KEYS = [ + "pipeline_tag", + "private", + "gated", + "downloads", + "likes", + "lastModified", +] as const satisfies readonly (keyof ApiModelInfo)[]; + +export const MODEL_EXPANDABLE_KEYS = [ + "author", + "cardData", + "config", + "createdAt", + "disabled", + "downloads", + "downloadsAllTime", + "gated", + "gitalyUid", + "inferenceProviderMapping", + "lastModified", + "library_name", + "likes", + "model-index", + "pipeline_tag", + "private", + "safetensors", + "sha", + // "siblings", + "spaces", + "tags", + "transformersInfo", +] as const satisfies readonly (keyof ApiModelInfo)[]; + +export interface ModelEntry { + id: string; + name: string; + private: boolean; + gated: false | "auto" | "manual"; + task?: PipelineType; + likes: number; + downloads: number; + updatedAt: Date; +} + +export async function* listModels< + const T extends Exclude<(typeof MODEL_EXPANDABLE_KEYS)[number], (typeof MODEL_EXPAND_KEYS)[number]> = never, +>( + params?: { + search?: { + /** + * Will search in the model name for matches + */ + query?: string; + owner?: string; + task?: PipelineType; + tags?: string[]; + /** + * Will search for models that have one of the inference providers in the list. + */ + inferenceProviders?: string[]; + /** + * Will search for models that support at least one of those local apps (eg "lmstudio", "mlx-lm", ...) + */ + apps?: string[]; + }; + hubUrl?: string; + additionalFields?: T[]; + /** + * Set to limit the number of models returned. + */ + limit?: number; + /** + * Sort models by a specific field. + */ + sort?: + | "createdAt" + | "downloads" + | "likes" + | "lastModified" + | "likes30d" + | "trendingScore" + | "num_parameters" + | "mainSize" + | "id"; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): AsyncGenerator> { + const accessToken = params && checkCredentials(params); + let totalToFetch = params?.limit ?? Infinity; + const search = new URLSearchParams([ + ...Object.entries({ + limit: String(Math.min(totalToFetch, 500)), + ...(params?.search?.owner ? { author: params.search.owner } : undefined), + ...(params?.search?.task ? { pipeline_tag: params.search.task } : undefined), + ...(params?.search?.query ? { search: params.search.query } : undefined), + ...(params?.search?.inferenceProviders + ? { inference_provider: params.search.inferenceProviders.join(",") } + : undefined), + ...(params?.search?.apps ? { apps: params.search.apps.join(",") } : undefined), + ...(params?.sort ? { sort: params.sort } : undefined), + }), + ...(params?.search?.tags?.map((tag) => ["filter", tag]) ?? []), + ...MODEL_EXPAND_KEYS.map((val) => ["expand", val] satisfies [string, string]), + ...(params?.additionalFields?.map((val) => ["expand", val] satisfies [string, string]) ?? []), + ]).toString(); + let url: string | undefined = `${params?.hubUrl || HUB_URL}/api/models?${search}`; + + while (url) { + const res: Response = await (params?.fetch ?? fetch)(url, { + headers: { + accept: "application/json", + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined), + }, + }); + + if (!res.ok) { + throw await createApiError(res); + } + + const items: ApiModelInfo[] = await res.json(); + + for (const item of items) { + // Handle inferenceProviderMapping normalization + const normalizedItem = { ...item }; + if ( + (params?.additionalFields as string[])?.includes("inferenceProviderMapping") && + item.inferenceProviderMapping + ) { + normalizedItem.inferenceProviderMapping = normalizeInferenceProviderMapping( + item.id, + item.inferenceProviderMapping, + ); + } + + yield { + ...(params?.additionalFields && pick(normalizedItem, params.additionalFields)), + id: item._id, + name: item.id, + private: item.private, + task: item.pipeline_tag, + downloads: item.downloads, + gated: item.gated, + likes: item.likes, + updatedAt: new Date(item.lastModified), + } as ModelEntry & Pick; + totalToFetch--; + + if (totalToFetch <= 0) { + return; + } + } + + const linkHeader = res.headers.get("Link"); + + url = linkHeader ? parseLinkHeader(linkHeader).next : undefined; + // Could update url to reduce the limit if we don't need the whole 500 of the next batch. + } +} diff --git a/node_modules/@huggingface/hub/src/lib/list-spaces.spec.ts b/node_modules/@huggingface/hub/src/lib/list-spaces.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..3cc5999137a7837ae4312374a7a89ec46985dff3 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/list-spaces.spec.ts @@ -0,0 +1,40 @@ +import { describe, expect, it } from "vitest"; +import type { SpaceEntry } from "./list-spaces"; +import { listSpaces } from "./list-spaces"; + +describe("listSpaces", () => { + it("should list spaces for Microsoft", async () => { + const results: SpaceEntry[] = []; + + for await (const entry of listSpaces({ + search: { owner: "microsoft" }, + additionalFields: ["subdomain"], + })) { + if (entry.name !== "microsoft/visual_chatgpt") { + continue; + } + if (typeof entry.likes === "number") { + entry.likes = 0; + } + if (entry.updatedAt instanceof Date && !isNaN(entry.updatedAt.getTime())) { + entry.updatedAt = new Date(0); + } + + results.push(entry); + } + + results.sort((a, b) => a.id.localeCompare(b.id)); + + expect(results).deep.equal([ + { + id: "6409a392bbc73d022c58c980", + name: "microsoft/visual_chatgpt", + private: false, + likes: 0, + sdk: "gradio", + subdomain: "microsoft-visual-chatgpt", + updatedAt: new Date(0), + }, + ]); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/list-spaces.ts b/node_modules/@huggingface/hub/src/lib/list-spaces.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1bd4d7fa86662dc12c19e58327b4f8d47124abc --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/list-spaces.ts @@ -0,0 +1,116 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import type { ApiSpaceInfo } from "../types/api/api-space"; +import type { CredentialsParams, SpaceSdk } from "../types/public"; +import { checkCredentials } from "../utils/checkCredentials"; +import { parseLinkHeader } from "../utils/parseLinkHeader"; +import { pick } from "../utils/pick"; + +export const SPACE_EXPAND_KEYS = [ + "sdk", + "likes", + "private", + "lastModified", +] as const satisfies readonly (keyof ApiSpaceInfo)[]; +export const SPACE_EXPANDABLE_KEYS = [ + "author", + "cardData", + "datasets", + "disabled", + "gitalyUid", + "lastModified", + "createdAt", + "likes", + "private", + "runtime", + "sdk", + // "siblings", + "sha", + "subdomain", + "tags", + "models", +] as const satisfies readonly (keyof ApiSpaceInfo)[]; + +export interface SpaceEntry { + id: string; + name: string; + sdk?: SpaceSdk; + likes: number; + private: boolean; + updatedAt: Date; + // Use additionalFields to fetch the fields from ApiSpaceInfo +} + +export async function* listSpaces< + const T extends Exclude<(typeof SPACE_EXPANDABLE_KEYS)[number], (typeof SPACE_EXPAND_KEYS)[number]> = never, +>( + params?: { + search?: { + /** + * Will search in the space name for matches + */ + query?: string; + owner?: string; + tags?: string[]; + }; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + /** + * Additional fields to fetch from huggingface.co. + */ + additionalFields?: T[]; + /** + * Sort spaces by a specific field. + */ + sort?: "createdAt" | "downloads" | "likes" | "lastModified" | "likes30d" | "trendingScore" | "mainSize" | "id"; + } & Partial, +): AsyncGenerator> { + const accessToken = params && checkCredentials(params); + const search = new URLSearchParams([ + ...Object.entries({ + limit: "500", + ...(params?.search?.owner ? { author: params.search.owner } : undefined), + ...(params?.search?.query ? { search: params.search.query } : undefined), + ...(params?.sort ? { sort: params.sort } : undefined), + }), + ...(params?.search?.tags?.map((tag) => ["filter", tag]) ?? []), + ...[...SPACE_EXPAND_KEYS, ...(params?.additionalFields ?? [])].map( + (val) => ["expand", val] satisfies [string, string], + ), + ]).toString(); + let url: string | undefined = `${params?.hubUrl || HUB_URL}/api/spaces?${search}`; + + while (url) { + const res: Response = await (params?.fetch ?? fetch)(url, { + headers: { + accept: "application/json", + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined), + }, + }); + + if (!res.ok) { + throw await createApiError(res); + } + + const items: ApiSpaceInfo[] = await res.json(); + + for (const item of items) { + yield { + ...(params?.additionalFields && pick(item, params.additionalFields)), + id: item._id, + name: item.id, + sdk: item.sdk, + likes: item.likes, + private: item.private, + updatedAt: new Date(item.lastModified), + } as SpaceEntry & Pick; + } + + const linkHeader = res.headers.get("Link"); + + url = linkHeader ? parseLinkHeader(linkHeader).next : undefined; + } +} diff --git a/node_modules/@huggingface/hub/src/lib/model-info.spec.ts b/node_modules/@huggingface/hub/src/lib/model-info.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..e6cbec4338685afd25ee6e4eb7f180bc5740e7b8 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/model-info.spec.ts @@ -0,0 +1,75 @@ +import { describe, expect, it } from "vitest"; +import { modelInfo } from "./model-info"; +import type { ModelEntry } from "./list-models"; +import type { ApiModelInfo } from "../types/api/api-model"; + +describe("modelInfo", () => { + it("should return the model info", async () => { + const info = await modelInfo({ + name: "openai-community/gpt2", + }); + expect(info).toEqual({ + id: "621ffdc036468d709f17434d", + downloads: expect.any(Number), + gated: false, + name: "openai-community/gpt2", + updatedAt: expect.any(Date), + likes: expect.any(Number), + task: "text-generation", + private: false, + }); + }); + + it("should return the model info with author", async () => { + const info: ModelEntry & Pick = await modelInfo({ + name: "openai-community/gpt2", + additionalFields: ["author"], + }); + expect(info).toEqual({ + id: "621ffdc036468d709f17434d", + downloads: expect.any(Number), + author: "openai-community", + gated: false, + name: "openai-community/gpt2", + updatedAt: expect.any(Date), + likes: expect.any(Number), + task: "text-generation", + private: false, + }); + }); + + it("should return the model info for a specific revision", async () => { + const info: ModelEntry & Pick = await modelInfo({ + name: "openai-community/gpt2", + additionalFields: ["sha"], + revision: "f27b190eeac4c2302d24068eabf5e9d6044389ae", + }); + expect(info).toEqual({ + id: "621ffdc036468d709f17434d", + downloads: expect.any(Number), + gated: false, + name: "openai-community/gpt2", + updatedAt: expect.any(Date), + likes: expect.any(Number), + task: "text-generation", + private: false, + sha: "f27b190eeac4c2302d24068eabf5e9d6044389ae", + }); + }); + + it("should return model info deepseek-ai models with inference provider mapping", async () => { + const info = await modelInfo({ + name: "deepseek-ai/DeepSeek-R1-0528", + additionalFields: ["inferenceProviderMapping"], + }); + + expect(info.inferenceProviderMapping).toBeDefined(); + expect(info.inferenceProviderMapping).toBeInstanceOf(Array); + expect(info.inferenceProviderMapping?.length).toBeGreaterThan(0); + info.inferenceProviderMapping?.forEach((item) => { + expect(item).toHaveProperty("provider"); + expect(item).toHaveProperty("hfModelId", "deepseek-ai/DeepSeek-R1-0528"); + expect(item).toHaveProperty("providerId"); + }); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/model-info.ts b/node_modules/@huggingface/hub/src/lib/model-info.ts new file mode 100644 index 0000000000000000000000000000000000000000..413d81a334e47eb6f9d37b9cf744d2c116d65bef --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/model-info.ts @@ -0,0 +1,68 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import type { ApiModelInfo } from "../types/api/api-model"; +import type { CredentialsParams } from "../types/public"; +import { checkCredentials } from "../utils/checkCredentials"; +import { pick } from "../utils/pick"; +import { normalizeInferenceProviderMapping } from "../utils/normalizeInferenceProviderMapping"; +import { MODEL_EXPAND_KEYS, type MODEL_EXPANDABLE_KEYS, type ModelEntry } from "./list-models"; + +export async function modelInfo< + const T extends Exclude<(typeof MODEL_EXPANDABLE_KEYS)[number], (typeof MODEL_EXPAND_KEYS)[number]> = never, +>( + params: { + name: string; + hubUrl?: string; + additionalFields?: T[]; + /** + * An optional Git revision id which can be a branch name, a tag, or a commit hash. + */ + revision?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise> { + const accessToken = params && checkCredentials(params); + + const search = new URLSearchParams([ + ...MODEL_EXPAND_KEYS.map((val) => ["expand", val] satisfies [string, string]), + ...(params?.additionalFields?.map((val) => ["expand", val] satisfies [string, string]) ?? []), + ]).toString(); + + const response = await (params.fetch || fetch)( + `${params?.hubUrl || HUB_URL}/api/models/${params.name}/revision/${encodeURIComponent( + params.revision ?? "HEAD", + )}?${search.toString()}`, + { + headers: { + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}), + }, + }, + ); + + if (!response.ok) { + throw await createApiError(response); + } + + const data = await response.json(); + + // Handle inferenceProviderMapping normalization + const normalizedData = { ...data }; + if ((params?.additionalFields as string[])?.includes("inferenceProviderMapping") && data.inferenceProviderMapping) { + normalizedData.inferenceProviderMapping = normalizeInferenceProviderMapping(data.id, data.inferenceProviderMapping); + } + + return { + ...(params?.additionalFields && pick(normalizedData, params.additionalFields)), + id: data._id, + name: data.id, + private: data.private, + task: data.pipeline_tag, + downloads: data.downloads, + gated: data.gated, + likes: data.likes, + updatedAt: new Date(data.lastModified), + } as ModelEntry & Pick; +} diff --git a/node_modules/@huggingface/hub/src/lib/oauth-handle-redirect.spec.ts b/node_modules/@huggingface/hub/src/lib/oauth-handle-redirect.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..f06f6a40e0dcdb6621ea75dedd369c3771b11561 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/oauth-handle-redirect.spec.ts @@ -0,0 +1,60 @@ +import { describe, expect, it } from "vitest"; +import { TEST_COOKIE, TEST_HUB_URL } from "../test/consts"; +import { oauthLoginUrl } from "./oauth-login-url"; +import { oauthHandleRedirect } from "./oauth-handle-redirect"; + +describe("oauthHandleRedirect", () => { + it("should work", async () => { + const localStorage = { + nonce: undefined, + codeVerifier: undefined, + }; + const url = await oauthLoginUrl({ + clientId: "dummy-app", + redirectUrl: "http://localhost:3000", + localStorage, + scopes: "openid profile email", + hubUrl: TEST_HUB_URL, + }); + const resp = await fetch(url, { + method: "POST", + headers: { + Cookie: `token=${TEST_COOKIE}`, + }, + redirect: "manual", + }); + if (resp.status !== 303) { + throw new Error(`Failed to fetch url ${url}: ${resp.status} ${resp.statusText}`); + } + const location = resp.headers.get("Location"); + if (!location) { + throw new Error(`No location header in response`); + } + const result = await oauthHandleRedirect({ + redirectedUrl: location, + codeVerifier: localStorage.codeVerifier, + nonce: localStorage.nonce, + hubUrl: TEST_HUB_URL, + }); + + if (!result) { + throw new Error("Expected result to be defined"); + } + expect(result.accessToken).toEqual(expect.any(String)); + expect(result.accessTokenExpiresAt).toBeInstanceOf(Date); + expect(result.accessTokenExpiresAt.getTime()).toBeGreaterThan(Date.now()); + expect(result.scope).toEqual(expect.any(String)); + expect(result.userInfo).toEqual({ + sub: "62f264b9f3c90f4b6514a269", + name: "@huggingface/hub CI bot", + preferred_username: "hub.js", + email_verified: true, + email: "eliott@huggingface.co", + isPro: false, + picture: "https://hub-ci.huggingface.co/avatars/934b830e9fdaa879487852f79eef7165.svg", + profile: "https://hub-ci.huggingface.co/hub.js", + website: "https://github.com/huggingface/hub.js", + orgs: [], + }); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/oauth-handle-redirect.ts b/node_modules/@huggingface/hub/src/lib/oauth-handle-redirect.ts new file mode 100644 index 0000000000000000000000000000000000000000..f5ed66bae8289edc5b1480f0d3870a966ed573d5 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/oauth-handle-redirect.ts @@ -0,0 +1,343 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; + +export interface UserInfo { + /** + * OpenID Connect field. Unique identifier for the user, even in case of rename. + */ + sub: string; + /** + * OpenID Connect field. The user's full name. + */ + name: string; + /** + * OpenID Connect field. The user's username. + */ + preferred_username: string; + /** + * OpenID Connect field, available if scope "email" was granted. + */ + email_verified?: boolean; + /** + * OpenID Connect field, available if scope "email" was granted. + */ + email?: string; + /** + * OpenID Connect field. The user's profile picture URL. + */ + picture: string; + /** + * OpenID Connect field. The user's profile URL. + */ + profile: string; + /** + * OpenID Connect field. The user's website URL. + */ + website?: string; + + /** + * Hugging Face field. Whether the user is a pro user. + */ + isPro: boolean; + /** + * Hugging Face field. Whether the user has a payment method set up. Needs "read-billing" scope. + */ + canPay?: boolean; + /** + * Hugging Face field. The user's orgs + */ + orgs?: Array<{ + /** + * OpenID Connect field. Unique identifier for the org. + */ + sub: string; + /** + * OpenID Connect field. The org's full name. + */ + name: string; + /** + * OpenID Connect field. The org's username. + */ + preferred_username: string; + /** + * OpenID Connect field. The org's profile picture URL. + */ + picture: string; + + /** + * Hugging Face field. The org's plan (e.g., "enterprise", "team"). + */ + plan?: string; + /** + * Hugging Face field. Whether the org has a payment method set up. Needs "read-billing" scope, and the user needs to approve access to the org in the OAuth page. + */ + canPay?: boolean; + /** + * Hugging Face field. The user's role in the org. The user needs to approve access to the org in the OAuth page. + */ + roleInOrg?: string; + /** + * @deprecated Use securityRestrictions instead with "sso" + * HuggingFace field. When the user granted the oauth app access to the org, but didn't complete SSO. + * + * Should never happen directly after the oauth flow. + */ + pendingSSO?: boolean; + /** + * @deprecated Use securityRestrictions instead with "mfa" + * + * HuggingFace field. When the user granted the oauth app access to the org, but didn't complete MFA. + * + * Should never happen directly after the oauth flow. + */ + missingMFA?: boolean; + /** + * HuggingFace field. When the user granted the oauth app access to the org, but didn't complete following security restrictions. + * + * Should never happen directly after the oauth flow. + */ + securityRestrictions?: ("mfa" | "sso" | "ip" | "token-policy")[]; + }>; +} + +export interface OAuthResult { + accessToken: string; + accessTokenExpiresAt: Date; + userInfo: UserInfo; + /** + * State passed to the OAuth provider in the original request to the OAuth provider. + */ + state?: string; + /** + * Granted scope + */ + scope: string; +} + +/** + * To call after the OAuth provider redirects back to the app. + * + * There is also a helper function {@link oauthHandleRedirectIfPresent}, which will call `oauthHandleRedirect` if the URL contains an oauth code + * in the query parameters and return `false` otherwise. + */ +export async function oauthHandleRedirect(opts?: { + /** + * The URL of the hub. Defaults to {@link HUB_URL}. + */ + hubUrl?: string; + /** + * The URL to analyze. + * + * @default window.location.href + */ + redirectedUrl?: string; + /** + * nonce generated by oauthLoginUrl + * + * @default localStorage.getItem("huggingface.co:oauth:nonce") + */ + nonce?: string; + /** + * codeVerifier generated by oauthLoginUrl + * + * @default localStorage.getItem("huggingface.co:oauth:code_verifier") + */ + codeVerifier?: string; +}): Promise { + if (typeof window === "undefined" && !opts?.redirectedUrl) { + throw new Error("oauthHandleRedirect is only available in the browser, unless you provide redirectedUrl"); + } + if (typeof localStorage === "undefined" && (!opts?.nonce || !opts?.codeVerifier)) { + throw new Error( + "oauthHandleRedirect requires localStorage to be available, unless you provide nonce and codeVerifier", + ); + } + + const redirectedUrl = opts?.redirectedUrl ?? window.location.href; + const searchParams = (() => { + try { + return new URL(redirectedUrl).searchParams; + } catch (err) { + throw new Error("Failed to parse redirected URL: " + redirectedUrl); + } + })(); + + const [error, errorDescription] = [searchParams.get("error"), searchParams.get("error_description")]; + + if (error) { + throw new Error(`${error}: ${errorDescription}`); + } + + const code = searchParams.get("code"); + const nonce = opts?.nonce ?? localStorage.getItem("huggingface.co:oauth:nonce"); + + if (!code) { + throw new Error("Missing oauth code from query parameters in redirected URL: " + redirectedUrl); + } + + if (!nonce) { + throw new Error("Missing oauth nonce from localStorage"); + } + + const codeVerifier = opts?.codeVerifier ?? localStorage.getItem("huggingface.co:oauth:code_verifier"); + + if (!codeVerifier) { + throw new Error("Missing oauth code_verifier from localStorage"); + } + + const state = searchParams.get("state"); + + if (!state) { + throw new Error("Missing oauth state from query parameters in redirected URL"); + } + + let parsedState: { nonce: string; redirectUri: string; state?: string }; + + try { + parsedState = JSON.parse(state); + } catch { + throw new Error("Invalid oauth state in redirected URL, unable to parse JSON: " + state); + } + + if (parsedState.nonce !== nonce) { + throw new Error("Invalid oauth state in redirected URL"); + } + + const hubUrl = opts?.hubUrl || HUB_URL; + + const openidConfigUrl = `${new URL(hubUrl).origin}/.well-known/openid-configuration`; + const openidConfigRes = await fetch(openidConfigUrl, { + headers: { + Accept: "application/json", + }, + }); + + if (!openidConfigRes.ok) { + throw await createApiError(openidConfigRes); + } + + const openidConfig: { + authorization_endpoint: string; + token_endpoint: string; + userinfo_endpoint: string; + } = await openidConfigRes.json(); + + const tokenRes = await fetch(openidConfig.token_endpoint, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: new URLSearchParams({ + grant_type: "authorization_code", + code, + redirect_uri: parsedState.redirectUri, + code_verifier: codeVerifier, + }).toString(), + }); + + if (!opts?.codeVerifier) { + localStorage.removeItem("huggingface.co:oauth:code_verifier"); + } + if (!opts?.nonce) { + localStorage.removeItem("huggingface.co:oauth:nonce"); + } + + if (!tokenRes.ok) { + throw await createApiError(tokenRes); + } + + const token: { + access_token: string; + expires_in: number; + id_token: string; + // refresh_token: string; + scope: string; + token_type: string; + } = await tokenRes.json(); + + const accessTokenExpiresAt = new Date(Date.now() + token.expires_in * 1000); + + const userInfoRes = await fetch(openidConfig.userinfo_endpoint, { + headers: { + Authorization: `Bearer ${token.access_token}`, + }, + }); + + if (!userInfoRes.ok) { + throw await createApiError(userInfoRes); + } + + const userInfo: UserInfo = await userInfoRes.json(); + + return { + accessToken: token.access_token, + accessTokenExpiresAt, + userInfo: userInfo, + state: parsedState.state, + scope: token.scope, + }; +} + +// if (code && !nonce) { +// console.warn("Missing oauth nonce from localStorage"); +// } + +/** + * To call after the OAuth provider redirects back to the app. + * + * It returns false if the URL does not contain an oauth code in the query parameters, otherwise + * it calls {@link oauthHandleRedirect}. + * + * Depending on your app, you may want to call {@link oauthHandleRedirect} directly instead. + */ +export async function oauthHandleRedirectIfPresent(opts?: { + /** + * The URL of the hub. Defaults to {@link HUB_URL}. + */ + hubUrl?: string; + /** + * The URL to analyze. + * + * @default window.location.href + */ + redirectedUrl?: string; + /** + * nonce generated by oauthLoginUrl + * + * @default localStorage.getItem("huggingface.co:oauth:nonce") + */ + nonce?: string; + /** + * codeVerifier generated by oauthLoginUrl + * + * @default localStorage.getItem("huggingface.co:oauth:code_verifier") + */ + codeVerifier?: string; +}): Promise { + if (typeof window === "undefined" && !opts?.redirectedUrl) { + throw new Error("oauthHandleRedirect is only available in the browser, unless you provide redirectedUrl"); + } + if (typeof localStorage === "undefined" && (!opts?.nonce || !opts?.codeVerifier)) { + throw new Error( + "oauthHandleRedirect requires localStorage to be available, unless you provide nonce and codeVerifier", + ); + } + const searchParams = new URLSearchParams(opts?.redirectedUrl ?? window.location.search); + + if (searchParams.has("error")) { + return oauthHandleRedirect(opts); + } + + if (searchParams.has("code")) { + if (!localStorage.getItem("huggingface.co:oauth:nonce")) { + console.warn( + "Missing oauth nonce from localStorage. This can happen when the user refreshes the page after logging in, without changing the URL.", + ); + return false; + } + + return oauthHandleRedirect(opts); + } + + return false; +} diff --git a/node_modules/@huggingface/hub/src/lib/oauth-login-url.ts b/node_modules/@huggingface/hub/src/lib/oauth-login-url.ts new file mode 100644 index 0000000000000000000000000000000000000000..a7ba0b1cdab559be1fef5c8001eb9faacd810ab5 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/oauth-login-url.ts @@ -0,0 +1,166 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import { base64FromBytes } from "../utils/base64FromBytes"; + +/** + * Use "Sign in with Hub" to authenticate a user, and get oauth user info / access token. + * + * Returns an url to redirect to. After the user is redirected back to your app, call `oauthHandleRedirect` to get the oauth user info / access token. + * + * When called from inside a static Space with OAuth enabled, it will load the config from the space, otherwise you need to at least specify + * the client ID of your OAuth App. + * + * @example + * ```ts + * import { oauthLoginUrl, oauthHandleRedirectIfPresent } from "@huggingface/hub"; + * + * const oauthResult = await oauthHandleRedirectIfPresent(); + * + * if (!oauthResult) { + * // If the user is not logged in, redirect to the login page + * window.location.href = await oauthLoginUrl(); + * } + * + * // You can use oauthResult.accessToken, oauthResult.accessTokenExpiresAt and oauthResult.userInfo + * console.log(oauthResult); + * ``` + * + * (Theoretically, this function could be used to authenticate a user for any OAuth provider supporting PKCE and OpenID Connect by changing `hubUrl`, + * but it is currently only tested with the Hugging Face Hub.) + */ +export async function oauthLoginUrl(opts?: { + /** + * OAuth client ID. + * + * For static Spaces, you can omit this and it will be loaded from the Space config, as long as `hf_oauth: true` is present in the README.md's metadata. + * For other Spaces, it is available to the backend in the OAUTH_CLIENT_ID environment variable, as long as `hf_oauth: true` is present in the README.md's metadata. + * + * You can also create a Developer Application at https://huggingface.co/settings/connected-applications and use its client ID. + */ + clientId?: string; + hubUrl?: string; + /** + * OAuth scope, a list of space-separated scopes. + * + * For static Spaces, you can omit this and it will be loaded from the Space config, as long as `hf_oauth: true` is present in the README.md's metadata. + * For other Spaces, it is available to the backend in the OAUTH_SCOPES environment variable, as long as `hf_oauth: true` is present in the README.md's metadata. + * + * Defaults to "openid profile". + * + * You can also create a Developer Application at https://huggingface.co/settings/connected-applications and use its scopes. + * + * See https://huggingface.co/docs/hub/oauth for a list of available scopes. + */ + scopes?: string; + /** + * Redirect URI, defaults to the current URL. + * + * For Spaces, any URL within the Space is allowed. + * + * For Developer Applications, you can add any URL you want to the list of allowed redirect URIs at https://huggingface.co/settings/connected-applications. + */ + redirectUrl?: string; + /** + * State to pass to the OAuth provider, which will be returned in the call to `oauthLogin` after the redirect. + */ + state?: string; + /** + * If provided, will be filled with the code verifier and nonce used for the OAuth flow, + * instead of using localStorage. + * + * When calling {@link `oauthHandleRedirectIfPresent`} or {@link `oauthHandleRedirect`} you will need to provide the same values. + */ + localStorage?: { + codeVerifier?: string; + nonce?: string; + }; +}): Promise { + if (typeof window === "undefined" && (!opts?.redirectUrl || !opts?.clientId)) { + throw new Error("oauthLogin is only available in the browser, unless you provide clientId and redirectUrl"); + } + if (typeof localStorage === "undefined" && !opts?.localStorage) { + throw new Error( + "oauthLogin requires localStorage to be available in the context, unless you provide a localStorage empty object as argument", + ); + } + + const hubUrl = opts?.hubUrl || HUB_URL; + const openidConfigUrl = `${new URL(hubUrl).origin}/.well-known/openid-configuration`; + const openidConfigRes = await fetch(openidConfigUrl, { + headers: { + Accept: "application/json", + }, + }); + + if (!openidConfigRes.ok) { + throw await createApiError(openidConfigRes); + } + + const opendidConfig: { + authorization_endpoint: string; + token_endpoint: string; + userinfo_endpoint: string; + } = await openidConfigRes.json(); + + const newNonce = globalThis.crypto.randomUUID(); + // Two random UUIDs concatenated together, because min length is 43 and max length is 128 + const newCodeVerifier = globalThis.crypto.randomUUID() + globalThis.crypto.randomUUID(); + + if (opts?.localStorage) { + if (opts.localStorage.codeVerifier !== undefined && opts.localStorage.codeVerifier !== null) { + throw new Error( + "localStorage.codeVerifier must be initially set to null or undefined, and will be filled by oauthLoginUrl", + ); + } + if (opts.localStorage.nonce !== undefined && opts.localStorage.nonce !== null) { + throw new Error( + "localStorage.nonce must be initially set to null or undefined, and will be filled by oauthLoginUrl", + ); + } + opts.localStorage.codeVerifier = newCodeVerifier; + opts.localStorage.nonce = newNonce; + } else { + localStorage.setItem("huggingface.co:oauth:nonce", newNonce); + localStorage.setItem("huggingface.co:oauth:code_verifier", newCodeVerifier); + } + + const redirectUri = opts?.redirectUrl || (typeof window !== "undefined" ? window.location.href : undefined); + if (!redirectUri) { + throw new Error("Missing redirectUrl"); + } + const state = JSON.stringify({ + nonce: newNonce, + redirectUri, + state: opts?.state, + }); + + const variables: Record | null = + // @ts-expect-error window.huggingface is defined inside static Spaces. + typeof window !== "undefined" ? (window.huggingface?.variables ?? null) : null; + + const clientId = opts?.clientId || variables?.OAUTH_CLIENT_ID; + + if (!clientId) { + if (variables) { + throw new Error("Missing clientId, please add hf_oauth: true to the README.md's metadata in your static Space"); + } + throw new Error("Missing clientId"); + } + + const challenge = base64FromBytes( + new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(newCodeVerifier))), + ) + .replace(/[+]/g, "-") + .replace(/[/]/g, "_") + .replace(/=/g, ""); + + return `${opendidConfig.authorization_endpoint}?${new URLSearchParams({ + client_id: clientId, + scope: opts?.scopes || variables?.OAUTH_SCOPES || "openid profile", + response_type: "code", + redirect_uri: redirectUri, + state, + code_challenge: challenge, + code_challenge_method: "S256", + }).toString()}`; +} diff --git a/node_modules/@huggingface/hub/src/lib/parse-safetensors-metadata.spec.ts b/node_modules/@huggingface/hub/src/lib/parse-safetensors-metadata.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..4a664c42e22f90ffc9736c939e654ba28ae0f522 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/parse-safetensors-metadata.spec.ts @@ -0,0 +1,326 @@ +import { assert, it, describe } from "vitest"; +import { parseSafetensorsMetadata, parseSafetensorsShardFilename } from "./parse-safetensors-metadata"; +import { sum } from "../utils/sum"; + +describe("parseSafetensorsMetadata", () => { + it("fetch info for single-file (with the default conventional filename)", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "google-bert/bert-base-uncased", + computeParametersCount: true, + revision: "86b5e0934494bd15c9632b12f734a8a67f723594", + }); + + assert(!parse.sharded); + assert.deepStrictEqual(parse.header.__metadata__, { format: "pt" }); + + // Example of one tensor (the header contains many tensors) + + assert.deepStrictEqual(parse.header["bert.embeddings.LayerNorm.beta"], { + dtype: "F32", + shape: [768], + data_offsets: [0, 3072], + }); + + assert.deepStrictEqual(parse.parameterCount, { F32: 110_106_428 }); + assert.deepStrictEqual(sum(Object.values(parse.parameterCount)), 110_106_428); + // total params = 110m + }); + + it("fetch info for sharded (with the default conventional filename)", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "bigscience/bloom", + computeParametersCount: true, + revision: "053d9cd9fbe814e091294f67fcfedb3397b954bb", + }); + + assert(parse.sharded); + + assert.strictEqual(Object.keys(parse.headers).length, 72); + // This model has 72 shards! + + // Example of one tensor inside one file + + assert.deepStrictEqual(parse.headers["model_00012-of-00072.safetensors"]["h.10.input_layernorm.weight"], { + dtype: "BF16", + shape: [14336], + data_offsets: [3288649728, 3288678400], + }); + + assert.deepStrictEqual(parse.parameterCount, { BF16: 176_247_271_424 }); + assert.deepStrictEqual(sum(Object.values(parse.parameterCount)), 176_247_271_424); + // total params = 176B + }); + + it("fetch info for single-file with multiple dtypes", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "roberta-base", + computeParametersCount: true, + revision: "e2da8e2f811d1448a5b465c236feacd80ffbac7b", + }); + + assert(!parse.sharded); + + assert.deepStrictEqual(parse.parameterCount, { F32: 124_697_433, I64: 514 }); + assert.deepStrictEqual(sum(Object.values(parse.parameterCount)), 124_697_947); + // total params = 124m + }); + + it("fetch info for single-file with file path", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "CompVis/stable-diffusion-v1-4", + computeParametersCount: true, + path: "unet/diffusion_pytorch_model.safetensors", + revision: "133a221b8aa7292a167afc5127cb63fb5005638b", + }); + + assert(!parse.sharded); + assert.deepStrictEqual(parse.header.__metadata__, { format: "pt" }); + + // Example of one tensor (the header contains many tensors) + + assert.deepStrictEqual(parse.header["up_blocks.3.resnets.0.norm2.bias"], { + dtype: "F32", + shape: [320], + data_offsets: [3_409_382_416, 3_409_383_696], + }); + + assert.deepStrictEqual(parse.parameterCount, { F32: 859_520_964 }); + assert.deepStrictEqual(sum(Object.values(parse.parameterCount)), 859_520_964); + }); + + it("fetch info for sharded with file path", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "Alignment-Lab-AI/ALAI-gemma-7b", + computeParametersCount: true, + path: "7b/1/model.safetensors.index.json", + revision: "37e307261fe97bbf8b2463d61dbdd1a10daa264c", + }); + + assert(parse.sharded); + + assert.strictEqual(Object.keys(parse.headers).length, 4); + + assert.deepStrictEqual(parse.headers["model-00004-of-00004.safetensors"]["model.layers.24.mlp.up_proj.weight"], { + dtype: "BF16", + shape: [24576, 3072], + data_offsets: [301996032, 452990976], + }); + + assert.deepStrictEqual(parse.parameterCount, { BF16: 8_537_680_896 }); + assert.deepStrictEqual(sum(Object.values(parse.parameterCount)), 8_537_680_896); + }); + + it("fetch info for sharded, but get param count directly from metadata", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "hf-internal-testing/sharded-model-metadata-num-parameters", + computeParametersCount: true, + revision: "999395eb3db277f3d7a0393402b02486ca91cef8", + }); + + assert(parse.sharded); + assert.deepStrictEqual(parse.parameterTotal, 109_482_240); + // total params = 109M + }); + + it("fetch info for single-file, but get param count directly from metadata", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "hf-internal-testing/single-file-model", + computeParametersCount: true, + revision: "75fcd3fed0285ac7f1092897ff2aefdf24bf872e", + }); + + assert(!parse.sharded); + assert.deepStrictEqual(parse.parameterTotal, 109_482_240); + }); + + it("should detect sharded safetensors filename", async () => { + const safetensorsFilename = "model_00005-of-00072.safetensors"; // https://huggingface.co/bigscience/bloom/blob/4d8e28c67403974b0f17a4ac5992e4ba0b0dbb6f/model_00005-of-00072.safetensors + const safetensorsShardFileInfo = parseSafetensorsShardFilename(safetensorsFilename); + + assert.strictEqual(safetensorsShardFileInfo?.prefix, "model_"); + assert.strictEqual(safetensorsShardFileInfo?.basePrefix, "model"); + assert.strictEqual(safetensorsShardFileInfo?.shard, "00005"); + assert.strictEqual(safetensorsShardFileInfo?.total, "00072"); + }); + + it("should detect sharded safetensors filename with 6 digits", async () => { + const safetensorsFilename = "model-00001-of-000163.safetensors"; // https://huggingface.co/deepseek-ai/DeepSeek-V3.2-Exp/blob/main/model-00001-of-000163.safetensors + const safetensorsShardFileInfo = parseSafetensorsShardFilename(safetensorsFilename); + + assert.strictEqual(safetensorsShardFileInfo?.prefix, "model-"); + assert.strictEqual(safetensorsShardFileInfo?.basePrefix, "model"); + assert.strictEqual(safetensorsShardFileInfo?.shard, "00001"); + assert.strictEqual(safetensorsShardFileInfo?.total, "000163"); + }); + + it("should support sub-byte data types", async () => { + const newDataTypes: Array<"F4" | "F6_E2M3" | "F6_E3M2" | "E8M0"> = ["F4", "F6_E2M3", "F6_E3M2", "E8M0"]; + + for (const dtype of newDataTypes) { + const tensorInfo = { + dtype, + shape: [1, 2], + data_offsets: [0, 1] as [number, number], + }; + + assert.ok(typeof tensorInfo.dtype === "string"); + assert.ok(["F4", "F6_E2M3", "F6_E3M2", "E8M0"].includes(tensorInfo.dtype)); + } + }); + + it("should handle parameter counting with sub-byte data types", () => { + const mockHeader = { + tensor_f4: { + dtype: "F4" as const, + shape: [10, 20], + data_offsets: [0, 100] as [number, number], + }, + tensor_f6_e2m3: { + dtype: "F6_E2M3" as const, + shape: [5, 10], + data_offsets: [100, 150] as [number, number], + }, + tensor_f6_e3m2: { + dtype: "F6_E3M2" as const, + shape: [8, 12], + data_offsets: [150, 246] as [number, number], + }, + tensor_e8m0: { + dtype: "E8M0" as const, + shape: [4, 6], + data_offsets: [246, 270] as [number, number], + }, + __metadata__: { format: "pt" }, + }; + + const computeNumOfParamsByDtypeSingleFile = (header: typeof mockHeader) => { + const counter: Partial> = {}; + const tensors = Object.fromEntries(Object.entries(header).filter(([key]) => key !== "__metadata__")); + + for (const [, v] of Object.entries(tensors) as [ + string, + { dtype: string; shape: number[]; data_offsets: [number, number] }, + ][]) { + if (v.shape.length === 0) { + continue; + } + counter[v.dtype] = (counter[v.dtype] ?? 0) + v.shape.reduce((a: number, b: number) => a * b); + } + return counter; + }; + + const parameterCount = computeNumOfParamsByDtypeSingleFile(mockHeader); + + assert.strictEqual(parameterCount.F4, 200); + assert.strictEqual(parameterCount.F6_E2M3, 50); + assert.strictEqual(parameterCount.F6_E3M2, 96); + assert.strictEqual(parameterCount.E8M0, 24); + }); + + it("fetch info for GPTQ quantized 8B model", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w4a16", + revision: "3921b6aee65496a708b0af456c964ceca7423193", + computeParametersCount: true, + }); + + const parameterCount = parse.parameterCount; + assert.ok(parameterCount); + assert.ok(parameterCount.I32); + assert.ok(parameterCount.F16); + assert.strictEqual(parameterCount.I32, 6_979_321_856); + assert.strictEqual(parameterCount.F16, 1_052_315_648); + + const parameterCountTotal = + parse.parameterTotal ?? + sum( + Object.entries(parameterCount) + .filter(([, value]) => typeof value === "number") + .map(([, value]) => value as number), + ); + + assert.strictEqual(parameterCountTotal, 8_031_637_504); + }); + + it("fetch info for openai/gpt-oss-20b (large sharded model)", async () => { + const parse = await parseSafetensorsMetadata({ + repo: "openai/gpt-oss-20b", + computeParametersCount: true, + revision: "bbf09307421df45099c1e7dcbd64e3106ce5b403", + }); + + assert(parse.sharded); + + assert.ok(Object.keys(parse.headers).length > 1); + assert.ok(parse.parameterCount); + + const totalParams = parse.parameterTotal || sum(Object.values(parse.parameterCount)); + + assert.strictEqual(totalParams, 21_511_953_984); // 21.5B + + assert.ok(parse.parameterCount.BF16 && parse.parameterCount.U8); + + assert.strictEqual(Object.keys(parse.headers).length, 3); + }); + + it("should support FP4 and UE8 data types in type system", () => { + const newDataTypes: Array<"FP4" | "UE8"> = ["FP4", "UE8"]; + + for (const dtype of newDataTypes) { + const tensorInfo = { + dtype, + shape: [1, 2], + data_offsets: [0, 1] as [number, number], + }; + + assert.ok(typeof tensorInfo.dtype === "string"); + assert.ok(["FP4", "UE8"].includes(tensorInfo.dtype)); + } + + const mockHeader = { + tensor_fp4: { + dtype: "FP4" as const, + shape: [100, 200], + data_offsets: [0, 5000] as [number, number], + }, + tensor_ue8: { + dtype: "UE8" as const, + shape: [50, 100], + data_offsets: [5000, 10000] as [number, number], + }, + __metadata__: { format: "pt" }, + }; + + const computeNumOfParamsByDtypeSingleFile = (header: typeof mockHeader) => { + const counter: Partial> = {}; + const tensors = Object.fromEntries(Object.entries(header).filter(([key]) => key !== "__metadata__")); + + for (const [, v] of Object.entries(tensors) as [ + string, + { dtype: string; shape: number[]; data_offsets: [number, number] }, + ][]) { + if (v.shape.length === 0) { + continue; + } + counter[v.dtype] = (counter[v.dtype] ?? 0) + v.shape.reduce((a: number, b: number) => a * b); + } + return counter; + }; + + const parameterCount = computeNumOfParamsByDtypeSingleFile(mockHeader); + + assert.strictEqual(parameterCount.FP4, 20000); + assert.strictEqual(parameterCount.UE8, 5000); + }); + + it("fetch info for moonshotai/Kimi-K2.5 (large index file >20MB)", async () => { + // This model has a ~23.5MB index file due to having many experts + const parse = await parseSafetensorsMetadata({ + repo: "moonshotai/Kimi-K2.5", + revision: "2426b45b6af0da48d0dcce71bbce6225e5c73adc", + }); + + assert(parse.sharded); + assert.strictEqual(Object.keys(parse.headers).length, 64); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/parse-safetensors-metadata.ts b/node_modules/@huggingface/hub/src/lib/parse-safetensors-metadata.ts new file mode 100644 index 0000000000000000000000000000000000000000..f85e845d5831bd3712f928c53447e0d64d2da259 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/parse-safetensors-metadata.ts @@ -0,0 +1,501 @@ +import type { CredentialsParams, RepoDesignation } from "../types/public"; +import { omit } from "../utils/omit"; +import { toRepoId } from "../utils/toRepoId"; +import { typedEntries } from "../utils/typedEntries"; +import { downloadFile } from "./download-file"; +import { fileExists } from "./file-exists"; +import { promisesQueue } from "../utils/promisesQueue"; +import type { SetRequired } from "../vendor/type-fest/set-required"; + +export const SAFETENSORS_FILE = "model.safetensors"; +export const SAFETENSORS_INDEX_FILE = "model.safetensors.index.json"; +/// We advise model/library authors to use the filenames above for convention inside model repos, +/// but in some situations safetensors weights have different filenames. +export const RE_SAFETENSORS_FILE = /\.safetensors$/; +export const RE_SAFETENSORS_INDEX_FILE = /\.safetensors\.index\.json$/; +export const RE_SAFETENSORS_SHARD_FILE = + /^(?(?.*?)[_-])(?\d{5,6})-of-(?\d{5,6})\.safetensors$/; +export interface SafetensorsShardFileInfo { + prefix: string; + basePrefix: string; + shard: string; + total: string; +} +export function parseSafetensorsShardFilename(filename: string): SafetensorsShardFileInfo | null { + const match = RE_SAFETENSORS_SHARD_FILE.exec(filename); + if (match && match.groups) { + return { + prefix: match.groups["prefix"], + basePrefix: match.groups["basePrefix"], + shard: match.groups["shard"], + total: match.groups["total"], + }; + } + return null; +} + +const PARALLEL_DOWNLOADS = 20; +const MAX_HEADER_LENGTH = 25_000_000; // 25MB +const GPTQ_QWEIGHT_SUFFIX = "qweight"; + +class SafetensorParseError extends Error {} + +type FileName = string; + +export type TensorName = string; +export type Dtype = + | "F64" + | "F32" + | "F16" + | "F8_E4M3" + | "F8_E5M2" + | "E8M0" + | "F6_E3M2" + | "F6_E2M3" + | "F4" + | "FP4" + | "BF16" + | "I64" + | "I32" + | "I16" + | "I8" + | "U16" + | "U8" + | "UE8" + | "BOOL"; + +export interface TensorInfo { + dtype: Dtype; + shape: number[]; + data_offsets: [number, number]; +} + +export type SafetensorsFileHeader = Record & { + __metadata__: { total_parameters?: string | number } & Record; +}; + +export interface SafetensorsIndexJson { + dtype?: string; + /// ^there's sometimes a dtype but it looks inconsistent. + metadata?: { total_parameters?: string | number } & Record; + /// ^ why the naming inconsistency? + weight_map: Record; +} + +export type SafetensorsShardedHeaders = Record; + +export type SafetensorsParseFromRepo = + | { + sharded: false; + header: SafetensorsFileHeader; + parameterCount?: Partial>; + parameterTotal?: number; + } + | { + sharded: true; + index: SafetensorsIndexJson; + headers: SafetensorsShardedHeaders; + parameterCount?: Partial>; + parameterTotal?: number; + }; + +/** + * Fetches and parses model config.json + */ +async function fetchModelConfig( + params: { + repo: RepoDesignation; + revision?: string; + hubUrl?: string; + fetch?: typeof fetch; + } & Partial, +): Promise { + try { + const configBlob = await downloadFile({ + ...params, + path: "config.json", + }); + + if (!configBlob) { + return null; + } + + const config = JSON.parse(await configBlob.text()); + return config as ModelConfig; + } catch (error) { + // Config file might not exist or be inaccessible + return null; + } +} + +async function parseSingleFile( + path: string, + params: { + repo: RepoDesignation; + revision?: string; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise { + const blob = await downloadFile({ ...params, path }); + + if (!blob) { + throw new SafetensorParseError(`Failed to parse file ${path}: failed to fetch safetensors header length.`); + } + + const bufLengthOfHeaderLE = await blob.slice(0, 8).arrayBuffer(); + const lengthOfHeader = new DataView(bufLengthOfHeaderLE).getBigUint64(0, true); + // ^little-endian + if (lengthOfHeader <= 0) { + throw new SafetensorParseError(`Failed to parse file ${path}: safetensors header is malformed.`); + } + if (lengthOfHeader > MAX_HEADER_LENGTH) { + throw new SafetensorParseError( + `Failed to parse file ${path}: safetensor header is too big. Maximum supported size is ${MAX_HEADER_LENGTH} bytes.`, + ); + } + + try { + // no validation for now, we assume it's a valid FileHeader. + const header: SafetensorsFileHeader = JSON.parse(await blob.slice(8, 8 + Number(lengthOfHeader)).text()); + return header; + } catch (err) { + throw new SafetensorParseError(`Failed to parse file ${path}: safetensors header is not valid JSON.`); + } +} + +async function parseShardedIndex( + path: string, + params: { + repo: RepoDesignation; + revision?: string; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise { + const indexBlob = await downloadFile({ + ...params, + path, + }); + + if (!indexBlob) { + throw new SafetensorParseError(`Failed to parse file ${path}: failed to fetch safetensors index.`); + } + + try { + // no validation for now, we assume it's a valid IndexJson. + const index = JSON.parse(await indexBlob.slice(0, MAX_HEADER_LENGTH).text()); + return index; + } catch (error) { + throw new SafetensorParseError(`Failed to parse file ${path}: not a valid JSON.`); + } +} + +async function fetchAllHeaders( + path: string, + index: SafetensorsIndexJson, + params: { + repo: RepoDesignation; + revision?: string; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise { + const pathPrefix = path.slice(0, path.lastIndexOf("/") + 1); + const filenames = [...new Set(Object.values(index.weight_map))]; + const shardedMap: SafetensorsShardedHeaders = Object.fromEntries( + await promisesQueue( + filenames.map( + (filename) => async () => + [filename, await parseSingleFile(pathPrefix + filename, params)] satisfies [string, SafetensorsFileHeader], + ), + PARALLEL_DOWNLOADS, + ), + ); + return shardedMap; +} + +/** + * Analyze model.safetensors.index.json or model.safetensors from a model hosted + * on Hugging Face using smart range requests to extract its metadata. + */ +export async function parseSafetensorsMetadata( + params: { + /** Only models are supported */ + repo: RepoDesignation; + /** + * Relative file path to safetensors file inside `repo`. Defaults to `SAFETENSORS_FILE` or `SAFETENSORS_INDEX_FILE` (whichever one exists). + */ + path?: string; + /** + * Will include SafetensorsParseFromRepo["parameterCount"], an object containing the number of parameters for each DType + * + * @default false + */ + computeParametersCount: true; + hubUrl?: string; + revision?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise>; +export async function parseSafetensorsMetadata( + params: { + /** Only models are supported */ + repo: RepoDesignation; + path?: string; + /** + * Will include SafetensorsParseFromRepo["parameterCount"], an object containing the number of parameters for each DType + * + * @default false + */ + computeParametersCount?: boolean; + hubUrl?: string; + revision?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise; +export async function parseSafetensorsMetadata( + params: { + repo: RepoDesignation; + path?: string; + computeParametersCount?: boolean; + hubUrl?: string; + revision?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise { + const repoId = toRepoId(params.repo); + + if (repoId.type !== "model") { + throw new TypeError("Only model repos should contain safetensors files."); + } + + // Fetch model config for quantization information + const modelConfig = params.computeParametersCount ? await fetchModelConfig(params) : null; + const quantConfig = modelConfig?.quantization_config; + + if ( + (params.path && RE_SAFETENSORS_FILE.test(params.path)) || + (await fileExists({ ...params, path: SAFETENSORS_FILE })) + ) { + const header = await parseSingleFile(params.path ?? SAFETENSORS_FILE, params); + return { + sharded: false, + header, + ...(params.computeParametersCount + ? { + parameterCount: computeNumOfParamsByDtypeSingleFile(header, quantConfig), + parameterTotal: + /// shortcut: get param count directly from metadata + header.__metadata__.total_parameters + ? typeof header.__metadata__.total_parameters === "number" + ? header.__metadata__.total_parameters + : typeof header.__metadata__.total_parameters === "string" + ? parseInt(header.__metadata__.total_parameters) + : undefined + : undefined, + } + : undefined), + }; + } else if ( + (params.path && RE_SAFETENSORS_INDEX_FILE.test(params.path)) || + (await fileExists({ ...params, path: SAFETENSORS_INDEX_FILE })) + ) { + const path = params.path ?? SAFETENSORS_INDEX_FILE; + const index = await parseShardedIndex(path, params); + const shardedMap = await fetchAllHeaders(path, index, params); + + return { + sharded: true, + index, + headers: shardedMap, + ...(params.computeParametersCount + ? { + parameterCount: computeNumOfParamsByDtypeSharded(shardedMap, quantConfig), + parameterTotal: + /// shortcut: get param count directly from metadata + index.metadata?.total_parameters + ? typeof index.metadata.total_parameters === "number" + ? index.metadata.total_parameters + : typeof index.metadata.total_parameters === "string" + ? parseInt(index.metadata.total_parameters) + : undefined + : undefined, + } + : undefined), + }; + } else { + throw new Error("model id does not seem to contain safetensors weights"); + } +} + +export interface QuantizationConfig { + quant_method?: string; + modules_to_not_convert?: string[]; + bits?: number; + load_in_4bit?: boolean; + load_in_8bit?: boolean; +} + +export interface ModelConfig { + quantization_config?: QuantizationConfig; +} + +/** + * Determines if a tensor is quantized based on quantization config and tensor name + */ +function isQuantizedTensor(tensorName: string, quantConfig?: QuantizationConfig): boolean { + if (!quantConfig) { + return false; + } + + if (!quantConfig.modules_to_not_convert || quantConfig.modules_to_not_convert.length === 0) { + return true; + } + + for (const pattern of quantConfig.modules_to_not_convert) { + const regexPattern = pattern.replace(/\*/g, ".*"); + const regex = new RegExp(regexPattern); + if (regex.test(tensorName)) { + return false; + } + } + + return true; +} + +/** + * Gets the parameter multiplier for a quantized tensor based on quantization method + */ +function getQuantizationMultiplier(tensorName: string, dtype: Dtype, quantConfig?: QuantizationConfig): number { + if (!quantConfig || !isQuantizedTensor(tensorName, quantConfig)) { + return 1; + } + + const quantMethod = quantConfig.quant_method?.toLowerCase(); + + switch (quantMethod) { + case "mxfp4": + if (dtype === "U8" && tensorName.includes("_blocks")) { + return 2; + } + return 1; + + case "gptq": + case "awq": + if (getTensorSuffix(tensorName) === GPTQ_QWEIGHT_SUFFIX) { + const bits = quantConfig.bits && quantConfig.bits > 0 ? quantConfig.bits : 4; + return Math.max(1, Math.floor(32 / bits)); + } + if (quantConfig.bits === 4 && dtype === "U8") { + return 2; + } + if (quantConfig.bits === 2 && dtype === "U8") { + return 4; + } + return 1; + + case "bitsandbytes": + if (quantConfig.load_in_4bit && dtype === "U8") { + return 2; + } + if (quantConfig.load_in_8bit) { + return 1; + } + return 1; + + default: + if (quantConfig.load_in_4bit && dtype === "U8") { + return 2; + } + if (quantConfig.bits === 4 && dtype === "U8") { + return 2; + } + return 1; + } +} + +function computeNumOfParamsByDtypeSingleFile( + header: SafetensorsFileHeader, + quantConfig?: QuantizationConfig, +): Partial> { + const counter: Partial> = {}; + const tensors = omit(header, "__metadata__"); + + for (const [tensorName, v] of typedEntries(tensors)) { + if (shouldSkipTensor(tensorName, quantConfig)) { + continue; + } + if (v.shape.length === 0) { + continue; + } + + const elements = v.shape.reduce((a, b) => a * b); + const multiplier = quantConfig ? getQuantizationMultiplier(tensorName, v.dtype, quantConfig) : 1; + if (multiplier === 0) { + continue; + } + counter[v.dtype] = (counter[v.dtype] ?? 0) + elements * multiplier; + } + return counter; +} + +function computeNumOfParamsByDtypeSharded( + shardedMap: SafetensorsShardedHeaders, + quantConfig?: QuantizationConfig, +): Partial> { + const counter: Partial> = {}; + for (const header of Object.values(shardedMap)) { + for (const [k, v] of typedEntries(computeNumOfParamsByDtypeSingleFile(header, quantConfig))) { + counter[k] = (counter[k] ?? 0) + (v ?? 0); + } + } + return counter; +} + +function getTensorSuffix(tensorName: string): string { + const lastDotIndex = tensorName.lastIndexOf("."); + return lastDotIndex === -1 ? tensorName : tensorName.slice(lastDotIndex + 1); +} + +function shouldSkipTensor(tensorName: string, quantConfig?: QuantizationConfig): boolean { + const GPTQ_AWQ_AUXILIARY_SUFFIXES = ["qzeros", "g_idx", "scales"]; + + if (!quantConfig) { + return false; + } + + const quantMethod = quantConfig.quant_method?.toLowerCase(); + if (!quantMethod || (quantMethod !== "gptq" && quantMethod !== "awq")) { + return false; + } + + if (!isQuantizedTensor(tensorName, quantConfig)) { + return false; + } + + const suffix = getTensorSuffix(tensorName); + if (suffix === GPTQ_QWEIGHT_SUFFIX) { + return false; + } + + return GPTQ_AWQ_AUXILIARY_SUFFIXES.includes(suffix); +} diff --git a/node_modules/@huggingface/hub/src/lib/paths-info.spec.ts b/node_modules/@huggingface/hub/src/lib/paths-info.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a888251b387f1244bcf4238abcb35a86c0db0e4 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/paths-info.spec.ts @@ -0,0 +1,73 @@ +import { expect, it, describe } from "vitest"; +import type { CommitInfo, PathInfo } from "./paths-info"; +import { pathsInfo } from "./paths-info"; + +describe("pathsInfo", () => { + it("should fetch LFS path info", async () => { + const result: PathInfo[] = await pathsInfo({ + repo: { + name: "google-bert/bert-base-uncased", + type: "model", + }, + paths: ["tf_model.h5"], + revision: "dd4bc8b21efa05ec961e3efc4ee5e3832a3679c7", + }); + + expect(result).toHaveLength(1); + + const modelPathInfo = result[0]; + expect(modelPathInfo.path).toBe("tf_model.h5"); + expect(modelPathInfo.type).toBe("file"); + // lfs pointer, therefore lfs should be defined + expect(modelPathInfo?.lfs).toBeDefined(); + expect(modelPathInfo?.lfs?.oid).toBe("a7a17d6d844b5de815ccab5f42cad6d24496db3850a2a43d8258221018ce87d2"); + expect(modelPathInfo?.lfs?.size).toBe(536063208); + expect(modelPathInfo?.lfs?.pointerSize).toBe(134); + + // should not include expand info + expect(modelPathInfo.lastCommit).toBeUndefined(); + expect(modelPathInfo.securityFileStatus).toBeUndefined(); + }); + + it("expand params should fetch lastCommit", async () => { + const result: (PathInfo & { + lastCommit: CommitInfo; + })[] = await pathsInfo({ + repo: { + name: "google-bert/bert-base-uncased", + type: "model", + }, + paths: ["tf_model.h5"], + revision: "dd4bc8b21efa05ec961e3efc4ee5e3832a3679c7", + expand: true, // include + }); + + expect(result).toHaveLength(1); + + const modelPathInfo = result[0]; + + // should include expand info + expect(modelPathInfo.lastCommit).toBeDefined(); + + expect(modelPathInfo.lastCommit.id).toBe("dd4bc8b21efa05ec961e3efc4ee5e3832a3679c7"); + expect(modelPathInfo.lastCommit.title).toBe("Update tf_model.h5"); + expect(modelPathInfo.lastCommit.date.getTime()).toBe(1569268124000); // 2019-09-23T19:48:44.000Z + }); + + it("non-LFS pointer should have lfs undefined", async () => { + const result: PathInfo[] = await pathsInfo({ + repo: { + name: "google-bert/bert-base-uncased", + type: "model", + }, + paths: ["config.json"], + revision: "dd4bc8b21efa05ec961e3efc4ee5e3832a3679c7", + }); + + expect(result).toHaveLength(1); + + const modelPathInfo = result[0]; + expect(modelPathInfo.path).toBe("config.json"); + expect(modelPathInfo.lfs).toBeUndefined(); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/paths-info.ts b/node_modules/@huggingface/hub/src/lib/paths-info.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f8a60c0489863d704b43de0db344fe7d5aa245e --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/paths-info.ts @@ -0,0 +1,124 @@ +import type { CredentialsParams, RepoDesignation } from "../types/public"; +import { checkCredentials } from "../utils/checkCredentials"; +import { toRepoId } from "../utils/toRepoId"; +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; + +export interface LfsPathInfo { + oid: string; + size: number; + pointerSize: number; +} + +export interface CommitInfo { + id: string; + title: string; + date: Date; +} + +export interface SecurityFileStatus { + status: string; +} + +export interface PathInfo { + path: string; + type: string; + oid: string; + size: number; + /** + * Only defined when path is LFS pointer + */ + lfs?: LfsPathInfo; + lastCommit?: CommitInfo; + securityFileStatus?: SecurityFileStatus; +} + +// Define the overloaded signatures +export function pathsInfo( + params: { + repo: RepoDesignation; + paths: string[]; + expand: true; // if expand true + revision?: string; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise<(PathInfo & { lastCommit: CommitInfo; securityFileStatus: SecurityFileStatus })[]>; +export function pathsInfo( + params: { + repo: RepoDesignation; + paths: string[]; + expand?: boolean; + revision?: string; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise; + +export async function pathsInfo( + params: { + repo: RepoDesignation; + paths: string[]; + expand?: boolean; + revision?: string; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise { + const accessToken = checkCredentials(params); + const repoId = toRepoId(params.repo); + + const hubUrl = params.hubUrl ?? HUB_URL; + + const url = `${hubUrl}/api/${repoId.type}s/${repoId.name}/paths-info/${encodeURIComponent( + params.revision ?? "main", + )}`; + + const resp = await (params.fetch ?? fetch)(url, { + method: "POST", + headers: { + ...(accessToken && { + Authorization: `Bearer ${accessToken}`, + }), + Accept: "application/json", + "Content-Type": "application/json", + }, + body: JSON.stringify({ + paths: params.paths, + expand: params.expand, + }), + }); + + if (!resp.ok) { + throw await createApiError(resp); + } + + const json: unknown = await resp.json(); + if (!Array.isArray(json)) throw new Error("malformed response: expected array"); + + return json.map((item: PathInfo) => ({ + path: item.path, + lfs: item.lfs, + type: item.type, + oid: item.oid, + size: item.size, + // expand fields + securityFileStatus: item.securityFileStatus, + lastCommit: item.lastCommit + ? { + date: new Date(item.lastCommit.date), + title: item.lastCommit.title, + id: item.lastCommit.id, + } + : undefined, + })); +} diff --git a/node_modules/@huggingface/hub/src/lib/repo-exists.spec.ts b/node_modules/@huggingface/hub/src/lib/repo-exists.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..c4bbb192f236db689fbed854df5609d5d6c091e9 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/repo-exists.spec.ts @@ -0,0 +1,13 @@ +import { describe, expect, it } from "vitest"; +import { repoExists } from "./repo-exists"; + +describe("repoExists", () => { + it("should check if a repo exists", async () => { + const exists1 = await repoExists({ repo: { type: "model", name: "openai-community/gpt2" } }); + + expect(exists1).toBe(true); + + const exists2 = await repoExists({ repo: { type: "model", name: "openai-community/gpt9000" } }); + expect(exists2).toBe(false); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/repo-exists.ts b/node_modules/@huggingface/hub/src/lib/repo-exists.ts new file mode 100644 index 0000000000000000000000000000000000000000..8be149df4337adfd02675e2b3f2682c1552f9de8 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/repo-exists.ts @@ -0,0 +1,43 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import type { RepoDesignation } from "../types/public"; +import { toRepoId } from "../utils/toRepoId"; + +export async function repoExists(params: { + repo: RepoDesignation; + + hubUrl?: string; + /** + * An optional Git revision id which can be a branch name, a tag, or a commit hash. + */ + revision?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + accessToken?: string; +}): Promise { + const repoId = toRepoId(params.repo); + + const res = await (params.fetch ?? fetch)( + `${params.hubUrl ?? HUB_URL}/api/${repoId.type}s/${repoId.name}?expand[]=likes`, + { + method: "GET", + headers: { + ...(params.accessToken && { + Authorization: `Bearer ${params.accessToken}`, + }), + }, + }, + ); + + if (res.status === 404 || res.status === 401) { + return false; + } + + if (!res.ok) { + throw await createApiError(res); + } + + return true; +} diff --git a/node_modules/@huggingface/hub/src/lib/snapshot-download.spec.ts b/node_modules/@huggingface/hub/src/lib/snapshot-download.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ecb938117814ec9fc409b7b1c420f8cff14807c --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/snapshot-download.spec.ts @@ -0,0 +1,275 @@ +import { expect, test, describe, vi, beforeEach } from "vitest"; +import { dirname, join } from "node:path"; +import { mkdir, writeFile } from "node:fs/promises"; +import { getHFHubCachePath } from "./cache-management"; +import { downloadFileToCacheDir } from "./download-file-to-cache-dir"; +import { snapshotDownload } from "./snapshot-download"; +import type { ListFileEntry } from "./list-files"; +import { listFiles } from "./list-files"; +import { modelInfo } from "./model-info"; +import type { ModelEntry } from "./list-models"; +import type { ApiModelInfo } from "../types/api/api-model"; +import { datasetInfo } from "./dataset-info"; +import type { DatasetEntry } from "./list-datasets"; +import type { ApiDatasetInfo } from "../types/api/api-dataset"; +import { spaceInfo } from "./space-info"; +import type { SpaceEntry } from "./list-spaces"; +import type { ApiSpaceInfo } from "../types/api/api-space"; + +vi.mock("node:fs/promises", () => ({ + writeFile: vi.fn(), + mkdir: vi.fn(), +})); + +vi.mock("./space-info", () => ({ + spaceInfo: vi.fn(), +})); + +vi.mock("./dataset-info", () => ({ + datasetInfo: vi.fn(), +})); + +vi.mock("./model-info", () => ({ + modelInfo: vi.fn(), +})); + +vi.mock("./list-files", () => ({ + listFiles: vi.fn(), +})); + +vi.mock("./download-file-to-cache-dir", () => ({ + downloadFileToCacheDir: vi.fn(), +})); + +const DUMMY_SHA = "dummy-sha"; + +// utility method to transform an array of ListFileEntry to an AsyncGenerator +async function* toAsyncGenerator(content: ListFileEntry[]): AsyncGenerator { + for (const entry of content) { + yield Promise.resolve(entry); + } +} + +beforeEach(() => { + vi.resetAllMocks(); + vi.mocked(listFiles).mockReturnValue(toAsyncGenerator([])); + + // mock repo info + vi.mocked(modelInfo).mockResolvedValue({ + sha: DUMMY_SHA, + } as ModelEntry & ApiModelInfo); + vi.mocked(datasetInfo).mockResolvedValue({ + sha: DUMMY_SHA, + } as DatasetEntry & ApiDatasetInfo); + vi.mocked(spaceInfo).mockResolvedValue({ + sha: DUMMY_SHA, + } as SpaceEntry & ApiSpaceInfo); +}); + +describe("snapshotDownload", () => { + test("empty AsyncGenerator should not call downloadFileToCacheDir", async () => { + await snapshotDownload({ + repo: { + name: "foo/bar", + type: "space", + }, + }); + + expect(downloadFileToCacheDir).not.toHaveBeenCalled(); + }); + + test("repo type model should use modelInfo", async () => { + await snapshotDownload({ + repo: { + name: "foo/bar", + type: "model", + }, + }); + expect(modelInfo).toHaveBeenCalledOnce(); + expect(modelInfo).toHaveBeenCalledWith({ + name: "foo/bar", + additionalFields: ["sha"], + revision: "main", + repo: { + name: "foo/bar", + type: "model", + }, + }); + }); + + test("repo type dataset should use datasetInfo", async () => { + await snapshotDownload({ + repo: { + name: "foo/bar", + type: "dataset", + }, + }); + expect(datasetInfo).toHaveBeenCalledOnce(); + expect(datasetInfo).toHaveBeenCalledWith({ + name: "foo/bar", + additionalFields: ["sha"], + revision: "main", + repo: { + name: "foo/bar", + type: "dataset", + }, + }); + }); + + test("repo type space should use spaceInfo", async () => { + await snapshotDownload({ + repo: { + name: "foo/bar", + type: "space", + }, + }); + expect(spaceInfo).toHaveBeenCalledOnce(); + expect(spaceInfo).toHaveBeenCalledWith({ + name: "foo/bar", + additionalFields: ["sha"], + revision: "main", + repo: { + name: "foo/bar", + type: "space", + }, + }); + }); + + test("commitHash should be saved to ref folder", async () => { + await snapshotDownload({ + repo: { + name: "foo/bar", + type: "space", + }, + revision: "dummy-revision", + }); + + // cross-platform testing + const expectedPath = join(getHFHubCachePath(), "spaces--foo--bar", "refs", "dummy-revision"); + expect(mkdir).toHaveBeenCalledWith(dirname(expectedPath), { recursive: true }); + expect(writeFile).toHaveBeenCalledWith(expectedPath, DUMMY_SHA); + }); + + test("directory ListFileEntry should mkdir it", async () => { + vi.mocked(listFiles).mockReturnValue( + toAsyncGenerator([ + { + oid: "dummy-etag", + type: "directory", + path: "potatoes", + size: 0, + lastCommit: { + date: new Date().toISOString(), + id: DUMMY_SHA, + title: "feat: best commit", + }, + }, + ]), + ); + + await snapshotDownload({ + repo: { + name: "foo/bar", + type: "space", + }, + }); + + // cross-platform testing + const expectedPath = join(getHFHubCachePath(), "spaces--foo--bar", "snapshots", DUMMY_SHA, "potatoes"); + expect(mkdir).toHaveBeenCalledWith(expectedPath, { recursive: true }); + }); + + test("files in ListFileEntry should download them", async () => { + const entries: ListFileEntry[] = Array.from({ length: 10 }, (_, i) => ({ + oid: `dummy-etag-${i}`, + type: "file", + path: `file-${i}.txt`, + size: i, + lastCommit: { + date: new Date().toISOString(), + id: DUMMY_SHA, + title: "feat: best commit", + }, + })); + vi.mocked(listFiles).mockReturnValue(toAsyncGenerator(entries)); + + await snapshotDownload({ + repo: { + name: "foo/bar", + type: "space", + }, + }); + + for (const entry of entries) { + expect(downloadFileToCacheDir).toHaveBeenCalledWith( + expect.objectContaining({ + repo: { + name: "foo/bar", + type: "space", + }, + path: entry.path, + revision: DUMMY_SHA, + }), + ); + } + }); + + test("custom params should be propagated", async () => { + // fetch mock + const fetchMock: typeof fetch = vi.fn(); + const hubMock = "https://foor.bar"; + const accessTokenMock = "dummy-access-token"; + + vi.mocked(listFiles).mockReturnValue( + toAsyncGenerator([ + { + oid: `dummy-etag`, + type: "file", + path: `file.txt`, + size: 10, + lastCommit: { + date: new Date().toISOString(), + id: DUMMY_SHA, + title: "feat: best commit", + }, + }, + ]), + ); + + await snapshotDownload({ + repo: { + name: "foo/bar", + type: "space", + }, + hubUrl: hubMock, + fetch: fetchMock, + accessToken: accessTokenMock, + }); + + expect(spaceInfo).toHaveBeenCalledWith( + expect.objectContaining({ + fetch: fetchMock, + hubUrl: hubMock, + accessToken: accessTokenMock, + }), + ); + + // list files should receive custom fetch + expect(listFiles).toHaveBeenCalledWith( + expect.objectContaining({ + fetch: fetchMock, + hubUrl: hubMock, + accessToken: accessTokenMock, + }), + ); + + // download file to cache should receive custom fetch + expect(downloadFileToCacheDir).toHaveBeenCalledWith( + expect.objectContaining({ + fetch: fetchMock, + hubUrl: hubMock, + accessToken: accessTokenMock, + }), + ); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/snapshot-download.ts b/node_modules/@huggingface/hub/src/lib/snapshot-download.ts new file mode 100644 index 0000000000000000000000000000000000000000..9b8321fd40a2b49f93c9cfd9a69bf8679abddf6e --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/snapshot-download.ts @@ -0,0 +1,124 @@ +import type { CredentialsParams, RepoDesignation } from "../types/public"; +import { listFiles } from "./list-files"; +import { getHFHubCachePath, getRepoFolderName } from "./cache-management"; +import { spaceInfo } from "./space-info"; +import { datasetInfo } from "./dataset-info"; +import { modelInfo } from "./model-info"; +import { toRepoId } from "../utils/toRepoId"; +import { join, dirname } from "node:path"; +import { mkdir, writeFile } from "node:fs/promises"; +import { downloadFileToCacheDir } from "./download-file-to-cache-dir"; + +export const DEFAULT_REVISION = "main"; + +/** + * Downloads an entire repository at a given revision in the cache directory {@link getHFHubCachePath}. + * You can list all cached repositories using {@link scanCachedRepo} + * @remarks It uses internally {@link downloadFileToCacheDir}. + */ +export async function snapshotDownload( + params: { + repo: RepoDesignation; + cacheDir?: string; + /** + * An optional Git revision id which can be a branch name, a tag, or a commit hash. + * + * @default "main" + */ + revision?: string; + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise { + let cacheDir: string; + if (params.cacheDir) { + cacheDir = params.cacheDir; + } else { + cacheDir = getHFHubCachePath(); + } + + let revision: string; + if (params.revision) { + revision = params.revision; + } else { + revision = DEFAULT_REVISION; + } + + const repoId = toRepoId(params.repo); + + // get repository revision value (sha) + let repoInfo: { sha: string }; + switch (repoId.type) { + case "space": + repoInfo = await spaceInfo({ + ...params, + name: repoId.name, + additionalFields: ["sha"], + revision: revision, + }); + break; + case "dataset": + repoInfo = await datasetInfo({ + ...params, + name: repoId.name, + additionalFields: ["sha"], + revision: revision, + }); + break; + case "model": + repoInfo = await modelInfo({ + ...params, + name: repoId.name, + additionalFields: ["sha"], + revision: revision, + }); + break; + default: + throw new Error(`invalid repository type ${repoId.type}`); + } + + const commitHash: string = repoInfo.sha; + + // get storage folder + const storageFolder = join(cacheDir, getRepoFolderName(repoId)); + const snapshotFolder = join(storageFolder, "snapshots", commitHash); + + // if passed revision is not identical to commit_hash + // then revision has to be a branch name or tag name. + // In that case store a ref. + if (revision !== commitHash) { + const refPath = join(storageFolder, "refs", revision); + await mkdir(dirname(refPath), { recursive: true }); + await writeFile(refPath, commitHash); + } + + const cursor = listFiles({ + ...params, + repo: params.repo, + recursive: true, + revision: repoInfo.sha, + }); + + for await (const entry of cursor) { + switch (entry.type) { + case "file": + await downloadFileToCacheDir({ + ...params, + path: entry.path, + revision: commitHash, + cacheDir: cacheDir, + }); + break; + case "directory": + await mkdir(join(snapshotFolder, entry.path), { recursive: true }); + break; + default: + throw new Error(`unknown entry type: ${entry.type}`); + } + } + + return snapshotFolder; +} diff --git a/node_modules/@huggingface/hub/src/lib/space-info.spec.ts b/node_modules/@huggingface/hub/src/lib/space-info.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea966f98bceea2577e268164f8512bc822a8f82e --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/space-info.spec.ts @@ -0,0 +1,53 @@ +import { describe, expect, it } from "vitest"; +import { spaceInfo } from "./space-info"; +import type { SpaceEntry } from "./list-spaces"; +import type { ApiSpaceInfo } from "../types/api/api-space"; + +describe("spaceInfo", () => { + it("should return the space info", async () => { + const info = await spaceInfo({ + name: "huggingfacejs/client-side-oauth", + }); + expect(info).toEqual({ + id: "659835e689010f9c7aed608d", + name: "huggingfacejs/client-side-oauth", + updatedAt: expect.any(Date), + likes: expect.any(Number), + private: false, + sdk: "static", + }); + }); + + it("should return the space info with author", async () => { + const info: SpaceEntry & Pick = await spaceInfo({ + name: "huggingfacejs/client-side-oauth", + additionalFields: ["author"], + }); + expect(info).toEqual({ + id: "659835e689010f9c7aed608d", + name: "huggingfacejs/client-side-oauth", + updatedAt: expect.any(Date), + likes: expect.any(Number), + private: false, + sdk: "static", + author: "huggingfacejs", + }); + }); + + it("should return the space info for a given revision", async () => { + const info: SpaceEntry & Pick = await spaceInfo({ + name: "huggingfacejs/client-side-oauth", + additionalFields: ["sha"], + revision: "e410a9ff348e6bed393b847711e793282d7c672e", + }); + expect(info).toEqual({ + id: "659835e689010f9c7aed608d", + name: "huggingfacejs/client-side-oauth", + updatedAt: expect.any(Date), + likes: expect.any(Number), + private: false, + sdk: "static", + sha: "e410a9ff348e6bed393b847711e793282d7c672e", + }); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/space-info.ts b/node_modules/@huggingface/hub/src/lib/space-info.ts new file mode 100644 index 0000000000000000000000000000000000000000..cbf0fb8555300fd0c77d81d3f4dce0c5563f083e --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/space-info.ts @@ -0,0 +1,60 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import type { ApiSpaceInfo } from "../types/api/api-space"; +import type { CredentialsParams } from "../types/public"; +import { checkCredentials } from "../utils/checkCredentials"; +import { pick } from "../utils/pick"; +import type { SPACE_EXPANDABLE_KEYS, SpaceEntry } from "./list-spaces"; +import { SPACE_EXPAND_KEYS } from "./list-spaces"; + +export async function spaceInfo< + const T extends Exclude<(typeof SPACE_EXPANDABLE_KEYS)[number], (typeof SPACE_EXPAND_KEYS)[number]> = never, +>( + params: { + name: string; + hubUrl?: string; + additionalFields?: T[]; + /** + * An optional Git revision id which can be a branch name, a tag, or a commit hash. + */ + revision?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & Partial, +): Promise> { + const accessToken = params && checkCredentials(params); + + const search = new URLSearchParams([ + ...SPACE_EXPAND_KEYS.map((val) => ["expand", val] satisfies [string, string]), + ...(params?.additionalFields?.map((val) => ["expand", val] satisfies [string, string]) ?? []), + ]).toString(); + + const response = await (params.fetch || fetch)( + `${params?.hubUrl || HUB_URL}/api/spaces/${params.name}/revision/${encodeURIComponent( + params.revision ?? "HEAD", + )}?${search.toString()}`, + { + headers: { + ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}), + }, + }, + ); + + if (!response.ok) { + throw await createApiError(response); + } + + const data = await response.json(); + + return { + ...(params?.additionalFields && pick(data, params.additionalFields)), + id: data._id, + name: data.id, + sdk: data.sdk, + likes: data.likes, + private: data.private, + updatedAt: new Date(data.lastModified), + } as SpaceEntry & Pick; +} diff --git a/node_modules/@huggingface/hub/src/lib/upload-file.spec.ts b/node_modules/@huggingface/hub/src/lib/upload-file.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..e99e0961593949d4375bb98b6790b9c291e72a5b --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/upload-file.spec.ts @@ -0,0 +1,99 @@ +import { assert, it, describe, expect } from "vitest"; + +import { TEST_ACCESS_TOKEN, TEST_HUB_URL, TEST_USER } from "../test/consts"; +import type { RepoId } from "../types/public"; +import { insecureRandomString } from "../utils/insecureRandomString"; +import { createRepo } from "./create-repo"; +import { deleteRepo } from "./delete-repo"; +import { downloadFile } from "./download-file"; +import { uploadFile } from "./upload-file"; + +describe("uploadFile", () => { + it("should upload a file", async () => { + const repoName = `${TEST_USER}/TEST-${insecureRandomString()}`; + const repo = { type: "model", name: repoName } satisfies RepoId; + + try { + const result = await createRepo({ + accessToken: TEST_ACCESS_TOKEN, + repo, + hubUrl: TEST_HUB_URL, + }); + + expect(result).toEqual({ + repoUrl: `${TEST_HUB_URL}/${repoName}`, + id: expect.any(String), + }); + + await uploadFile({ + accessToken: TEST_ACCESS_TOKEN, + repo, + file: { content: new Blob(["file1"]), path: "file1" }, + hubUrl: TEST_HUB_URL, + }); + await uploadFile({ + accessToken: TEST_ACCESS_TOKEN, + repo, + file: new URL("https://huggingface.co/gpt2/raw/main/config.json"), + hubUrl: TEST_HUB_URL, + }); + + let content = await downloadFile({ + repo, + path: "file1", + hubUrl: TEST_HUB_URL, + }); + + assert.strictEqual(await content?.text(), "file1"); + + content = await downloadFile({ + repo, + path: "config.json", + hubUrl: TEST_HUB_URL, + }); + + assert.strictEqual( + (await content?.text())?.trim(), + ` +{ + "activation_function": "gelu_new", + "architectures": [ + "GPT2LMHeadModel" + ], + "attn_pdrop": 0.1, + "bos_token_id": 50256, + "embd_pdrop": 0.1, + "eos_token_id": 50256, + "initializer_range": 0.02, + "layer_norm_epsilon": 1e-05, + "model_type": "gpt2", + "n_ctx": 1024, + "n_embd": 768, + "n_head": 12, + "n_layer": 12, + "n_positions": 1024, + "resid_pdrop": 0.1, + "summary_activation": null, + "summary_first_dropout": 0.1, + "summary_proj_to_labels": true, + "summary_type": "cls_index", + "summary_use_proj": true, + "task_specific_params": { + "text-generation": { + "do_sample": true, + "max_length": 50 + } + }, + "vocab_size": 50257 +} + `.trim(), + ); + } finally { + await deleteRepo({ + repo, + accessToken: TEST_ACCESS_TOKEN, + hubUrl: TEST_HUB_URL, + }); + } + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/upload-file.ts b/node_modules/@huggingface/hub/src/lib/upload-file.ts new file mode 100644 index 0000000000000000000000000000000000000000..e02f5ce38ac54adb8ce72e3d3faf90ceb54e75f6 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/upload-file.ts @@ -0,0 +1,49 @@ +import type { CredentialsParams } from "../types/public"; +import type { CommitOutput, CommitParams, ContentSource } from "./commit"; +import { commit } from "./commit"; + +export function uploadFile( + params: { + repo: CommitParams["repo"]; + file: URL | File | { path: string; content: ContentSource }; + commitTitle?: CommitParams["title"]; + commitDescription?: CommitParams["description"]; + hubUrl?: CommitParams["hubUrl"]; + branch?: CommitParams["branch"]; + isPullRequest?: CommitParams["isPullRequest"]; + parentCommit?: CommitParams["parentCommit"]; + fetch?: CommitParams["fetch"]; + useWebWorkers?: CommitParams["useWebWorkers"]; + abortSignal?: CommitParams["abortSignal"]; + useXet?: CommitParams["useXet"]; + } & Partial, +): Promise { + const path = + params.file instanceof URL + ? (params.file.pathname.split("/").at(-1) ?? "file") + : "path" in params.file + ? params.file.path + : params.file.name; + + return commit({ + ...(params.accessToken ? { accessToken: params.accessToken } : { credentials: params.credentials }), + repo: params.repo, + operations: [ + { + operation: "addOrUpdate", + path, + content: "content" in params.file ? params.file.content : params.file, + }, + ], + title: params.commitTitle ?? `Add ${path}`, + description: params.commitDescription, + hubUrl: params.hubUrl, + branch: params.branch, + isPullRequest: params.isPullRequest, + parentCommit: params.parentCommit, + fetch: params.fetch, + useWebWorkers: params.useWebWorkers, + abortSignal: params.abortSignal, + useXet: params.useXet, + }); +} diff --git a/node_modules/@huggingface/hub/src/lib/upload-files-with-progress.spec.ts b/node_modules/@huggingface/hub/src/lib/upload-files-with-progress.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..a5f19bb48600d9fe2dd6bbf8c5bf5458970f5668 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/upload-files-with-progress.spec.ts @@ -0,0 +1,178 @@ +import { assert, it, describe, expect } from "vitest"; + +import { TEST_HUB_URL, TEST_ACCESS_TOKEN, TEST_USER } from "../test/consts"; +import type { RepoId } from "../types/public"; +import { insecureRandomString } from "../utils/insecureRandomString"; +import { createRepo } from "./create-repo"; +import { deleteRepo } from "./delete-repo"; +import { downloadFile } from "./download-file"; +import { uploadFilesWithProgress } from "./upload-files-with-progress"; +import type { CommitOutput, CommitProgressEvent } from "./commit"; + +describe("uploadFilesWithProgress", () => { + for (const useXet of [false, true]) { + describe(`useXet: ${useXet}`, () => { + it("should upload files", async () => { + const repoName = `${TEST_USER}/TEST-${insecureRandomString()}`; + const repo = { type: "model", name: repoName } satisfies RepoId; + const lfsContent = "O123456789".repeat(100_000); + + try { + const result = await createRepo({ + accessToken: TEST_ACCESS_TOKEN, + repo, + hubUrl: TEST_HUB_URL, + }); + + expect(result).toEqual({ + repoUrl: `${TEST_HUB_URL}/${repoName}`, + id: expect.any(String), + }); + + const it = uploadFilesWithProgress({ + accessToken: TEST_ACCESS_TOKEN, + repo, + files: [ + { content: new Blob(["file1"]), path: "file1" }, + new URL("https://huggingface.co/gpt2/raw/main/config.json"), + // Large file + { + content: new Blob([lfsContent]), + path: "test.lfs.txt", + }, + ], + useWebWorkers: { + minSize: 1_000, + }, + hubUrl: TEST_HUB_URL, + useXet, + }); + + let res: IteratorResult; + let progressEvents: CommitProgressEvent[] = []; + + do { + res = await it.next(); + if (!res.done) { + progressEvents.push(res.value); + } + } while (!res.done); + + // const intermediateHashingEvents = progressEvents.filter( + // (e) => e.event === "fileProgress" && e.type === "hashing" && e.progress !== 0 && e.progress !== 1 + // ); + // if (isFrontend) { + // assert(intermediateHashingEvents.length > 0); + // } + // const intermediateUploadEvents = progressEvents.filter( + // (e) => e.event === "fileProgress" && e.type === "uploading" && e.progress !== 0 && e.progress !== 1 + // ); + // if (isFrontend) { + // assert(intermediateUploadEvents.length > 0, "There should be at least one intermediate upload event"); + // } + progressEvents = progressEvents.filter( + (e, i) => + (e.event !== "fileProgress" || e.progress === 0 || e.progress === 1) && + (i === 0 || JSON.stringify(e) !== JSON.stringify(progressEvents[i - 1])), + ); + + assert.deepStrictEqual(progressEvents, [ + { + event: "phase", + phase: "preuploading", + }, + { + event: "phase", + phase: "uploadingLargeFiles", + }, + { + event: "fileProgress", + path: "test.lfs.txt", + progress: 0, + state: "hashing", + }, + { + event: "fileProgress", + path: "test.lfs.txt", + progress: 1, + state: "hashing", + }, + { + event: "fileProgress", + path: "test.lfs.txt", + progress: 0, + state: "uploading", + }, + { + event: "fileProgress", + path: "test.lfs.txt", + progress: 1, + state: "uploading", + }, + { + event: "phase", + phase: "committing", + }, + ]); + + let content = await downloadFile({ + repo, + path: "file1", + hubUrl: TEST_HUB_URL, + }); + + assert.strictEqual(await content?.text(), "file1"); + + content = await downloadFile({ + repo, + path: "config.json", + hubUrl: TEST_HUB_URL, + }); + + assert.strictEqual( + (await content?.text())?.trim(), + ` +{ + "activation_function": "gelu_new", + "architectures": [ + "GPT2LMHeadModel" + ], + "attn_pdrop": 0.1, + "bos_token_id": 50256, + "embd_pdrop": 0.1, + "eos_token_id": 50256, + "initializer_range": 0.02, + "layer_norm_epsilon": 1e-05, + "model_type": "gpt2", + "n_ctx": 1024, + "n_embd": 768, + "n_head": 12, + "n_layer": 12, + "n_positions": 1024, + "resid_pdrop": 0.1, + "summary_activation": null, + "summary_first_dropout": 0.1, + "summary_proj_to_labels": true, + "summary_type": "cls_index", + "summary_use_proj": true, + "task_specific_params": { + "text-generation": { + "do_sample": true, + "max_length": 50 + } + }, + "vocab_size": 50257 +} + `.trim(), + ); + } finally { + await deleteRepo({ + repo, + accessToken: TEST_ACCESS_TOKEN, + hubUrl: TEST_HUB_URL, + }); + } + }); + }); + } +}); diff --git a/node_modules/@huggingface/hub/src/lib/upload-files-with-progress.ts b/node_modules/@huggingface/hub/src/lib/upload-files-with-progress.ts new file mode 100644 index 0000000000000000000000000000000000000000..364aabdb9ecf0418bdce4b70425155135c6b03ba --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/upload-files-with-progress.ts @@ -0,0 +1,159 @@ +import type { CredentialsParams } from "../types/public"; +import { typedInclude } from "../utils/typedInclude"; +import type { CommitOutput, CommitParams, CommitProgressEvent, ContentSource } from "./commit"; +import { commitIter } from "./commit"; + +const multipartUploadTracking = new WeakMap< + (progress: number) => void, + { + numParts: number; + partsProgress: Record; + } +>(); + +/** + * Uploads with progress + * + * Needs XMLHttpRequest to be available for progress events for uploads on models, datasets and spaces. + * Set useWebWorkers to true in order to have progress events for hashing for models, datasets and spaces. + */ +export async function* uploadFilesWithProgress( + params: { + repo: CommitParams["repo"]; + files: Array; + commitTitle?: CommitParams["title"]; + commitDescription?: CommitParams["description"]; + hubUrl?: CommitParams["hubUrl"]; + branch?: CommitParams["branch"]; + isPullRequest?: CommitParams["isPullRequest"]; + parentCommit?: CommitParams["parentCommit"]; + abortSignal?: CommitParams["abortSignal"]; + maxFolderDepth?: CommitParams["maxFolderDepth"]; + useXet?: CommitParams["useXet"]; + /** + * Set this to true in order to have progress events for hashing + */ + useWebWorkers?: CommitParams["useWebWorkers"]; + } & Partial, +): AsyncGenerator { + return yield* commitIter({ + ...(params.accessToken ? { accessToken: params.accessToken } : { credentials: params.credentials }), + repo: params.repo, + operations: params.files.map((file) => ({ + operation: "addOrUpdate", + path: file instanceof URL ? (file.pathname.split("/").at(-1) ?? "file") : "path" in file ? file.path : file.name, + content: "content" in file ? file.content : file, + })), + title: params.commitTitle ?? `Add ${params.files.length} files`, + description: params.commitDescription, + hubUrl: params.hubUrl, + branch: params.branch, + isPullRequest: params.isPullRequest, + parentCommit: params.parentCommit, + useWebWorkers: params.useWebWorkers, + abortSignal: params.abortSignal, + useXet: params.useXet, + fetch: async (input, init) => { + if (!init) { + return fetch(input); + } + + if ( + !typedInclude(["PUT", "POST"], init.method) || + !("progressHint" in init) || + !init.progressHint || + typeof XMLHttpRequest === "undefined" || + typeof input !== "string" || + (!(init.body instanceof ArrayBuffer) && + !(init.body instanceof Blob) && + !(init.body instanceof File) && + typeof init.body !== "string") + ) { + return fetch(input, init); + } + + const progressHint = init.progressHint as { + progressCallback: (progress: number) => void; + } & (Record | { part: number; numParts: number }); + const progressCallback = progressHint.progressCallback; + + const xhr = new XMLHttpRequest(); + + xhr.upload.addEventListener("progress", (event) => { + if (event.lengthComputable) { + if (progressHint.part !== undefined) { + let tracking = multipartUploadTracking.get(progressCallback); + if (!tracking) { + tracking = { numParts: progressHint.numParts, partsProgress: {} }; + multipartUploadTracking.set(progressCallback, tracking); + } + tracking.partsProgress[progressHint.part] = event.loaded / event.total; + let totalProgress = 0; + for (const partProgress of Object.values(tracking.partsProgress)) { + totalProgress += partProgress; + } + if (totalProgress === tracking.numParts) { + progressCallback(0.9999999999); + } else { + progressCallback(totalProgress / tracking.numParts); + } + } else { + if (event.loaded === event.total) { + progressCallback(0.9999999999); + } else { + progressCallback(event.loaded / event.total); + } + } + } + }); + + xhr.open(init.method, input, true); + + if (init.headers) { + const headers = new Headers(init.headers); + headers.forEach((value, key) => { + xhr.setRequestHeader(key, value); + }); + } + + init.signal?.throwIfAborted(); + xhr.send(init.body); + + return new Promise((resolve, reject) => { + xhr.addEventListener("load", () => { + resolve( + new Response(xhr.responseText, { + status: xhr.status, + statusText: xhr.statusText, + headers: Object.fromEntries( + xhr + .getAllResponseHeaders() + .trim() + .split("\n") + .map((header) => [ + header.slice(0, header.indexOf(":")), + header.slice(header.indexOf(":") + 1).trim(), + ]), + ), + }), + ); + }); + xhr.addEventListener("error", () => { + reject(new Error(xhr.statusText)); + }); + + if (init.signal) { + init.signal.addEventListener("abort", () => { + xhr.abort(); + + try { + init.signal?.throwIfAborted(); + } catch (err) { + reject(err); + } + }); + } + }); + }, + }); +} diff --git a/node_modules/@huggingface/hub/src/lib/upload-files.fs.spec.ts b/node_modules/@huggingface/hub/src/lib/upload-files.fs.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..6692c67d33d01d2f94e9a12ad7d863636a4b8853 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/upload-files.fs.spec.ts @@ -0,0 +1,72 @@ +import { assert, it, describe, expect } from "vitest"; + +import { TEST_ACCESS_TOKEN, TEST_HUB_URL, TEST_USER } from "../test/consts"; +import type { RepoId } from "../types/public"; +import { insecureRandomString } from "../utils/insecureRandomString"; +import { createRepo } from "./create-repo"; +import { deleteRepo } from "./delete-repo"; +import { downloadFile } from "./download-file"; +import { uploadFiles } from "./upload-files"; +import { mkdir } from "fs/promises"; +import { writeFile } from "fs/promises"; +import { pathToFileURL } from "url"; +import { tmpdir } from "os"; + +describe("uploadFiles", () => { + it("should upload local folder", async () => { + const tmpDir = tmpdir(); + + await mkdir(`${tmpDir}/test-folder/sub`, { recursive: true }); + + await writeFile(`${tmpDir}/test-folder/sub/file1.txt`, "file1"); + await writeFile(`${tmpDir}/test-folder/sub/file2.txt`, "file2"); + + await writeFile(`${tmpDir}/test-folder/file3.txt`, "file3"); + await writeFile(`${tmpDir}/test-folder/file4.txt`, "file4"); + + const repoName = `${TEST_USER}/TEST-${insecureRandomString()}`; + const repo = { type: "model", name: repoName } satisfies RepoId; + + try { + const result = await createRepo({ + accessToken: TEST_ACCESS_TOKEN, + repo, + hubUrl: TEST_HUB_URL, + }); + + expect(result).toEqual({ + repoUrl: `${TEST_HUB_URL}/${repoName}`, + id: expect.any(String), + }); + + await uploadFiles({ + accessToken: TEST_ACCESS_TOKEN, + repo, + files: [pathToFileURL(`${tmpDir}/test-folder`)], + hubUrl: TEST_HUB_URL, + }); + + let content = await downloadFile({ + repo, + path: "test-folder/sub/file1.txt", + hubUrl: TEST_HUB_URL, + }); + + assert.strictEqual(await content?.text(), "file1"); + + content = await downloadFile({ + repo, + path: "test-folder/file3.txt", + hubUrl: TEST_HUB_URL, + }); + + assert.strictEqual(await content?.text(), `file3`); + } finally { + await deleteRepo({ + repo, + accessToken: TEST_ACCESS_TOKEN, + hubUrl: TEST_HUB_URL, + }); + } + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/upload-files.spec.ts b/node_modules/@huggingface/hub/src/lib/upload-files.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..58cb24fe3476d295bd198e1299bcee8ecededa27 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/upload-files.spec.ts @@ -0,0 +1,96 @@ +import { assert, it, describe, expect } from "vitest"; + +import { TEST_ACCESS_TOKEN, TEST_HUB_URL, TEST_USER } from "../test/consts"; +import type { RepoId } from "../types/public"; +import { insecureRandomString } from "../utils/insecureRandomString"; +import { createRepo } from "./create-repo"; +import { deleteRepo } from "./delete-repo"; +import { downloadFile } from "./download-file"; +import { uploadFiles } from "./upload-files"; + +describe("uploadFiles", () => { + it("should upload files", async () => { + const repoName = `${TEST_USER}/TEST-${insecureRandomString()}`; + const repo = { type: "model", name: repoName } satisfies RepoId; + + try { + const result = await createRepo({ + accessToken: TEST_ACCESS_TOKEN, + repo, + hubUrl: TEST_HUB_URL, + }); + + expect(result).toEqual({ + repoUrl: `${TEST_HUB_URL}/${repoName}`, + id: expect.any(String), + }); + + await uploadFiles({ + accessToken: TEST_ACCESS_TOKEN, + repo, + files: [ + { content: new Blob(["file1"]), path: "file1" }, + new URL("https://huggingface.co/gpt2/raw/main/config.json"), + ], + hubUrl: TEST_HUB_URL, + }); + + let content = await downloadFile({ + repo, + path: "file1", + hubUrl: TEST_HUB_URL, + }); + + assert.strictEqual(await content?.text(), "file1"); + + content = await downloadFile({ + repo, + path: "config.json", + hubUrl: TEST_HUB_URL, + }); + + assert.strictEqual( + (await content?.text())?.trim(), + ` +{ + "activation_function": "gelu_new", + "architectures": [ + "GPT2LMHeadModel" + ], + "attn_pdrop": 0.1, + "bos_token_id": 50256, + "embd_pdrop": 0.1, + "eos_token_id": 50256, + "initializer_range": 0.02, + "layer_norm_epsilon": 1e-05, + "model_type": "gpt2", + "n_ctx": 1024, + "n_embd": 768, + "n_head": 12, + "n_layer": 12, + "n_positions": 1024, + "resid_pdrop": 0.1, + "summary_activation": null, + "summary_first_dropout": 0.1, + "summary_proj_to_labels": true, + "summary_type": "cls_index", + "summary_use_proj": true, + "task_specific_params": { + "text-generation": { + "do_sample": true, + "max_length": 50 + } + }, + "vocab_size": 50257 +} + `.trim(), + ); + } finally { + await deleteRepo({ + repo, + accessToken: TEST_ACCESS_TOKEN, + hubUrl: TEST_HUB_URL, + }); + } + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/upload-files.ts b/node_modules/@huggingface/hub/src/lib/upload-files.ts new file mode 100644 index 0000000000000000000000000000000000000000..f400cf298a14d4f9ebb435056d1d18300d020e51 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/upload-files.ts @@ -0,0 +1,41 @@ +import type { CredentialsParams } from "../types/public"; +import type { CommitOutput, CommitParams, ContentSource } from "./commit"; +import { commit } from "./commit"; + +export function uploadFiles( + params: { + repo: CommitParams["repo"]; + files: Array; + commitTitle?: CommitParams["title"]; + commitDescription?: CommitParams["description"]; + hubUrl?: CommitParams["hubUrl"]; + branch?: CommitParams["branch"]; + isPullRequest?: CommitParams["isPullRequest"]; + parentCommit?: CommitParams["parentCommit"]; + fetch?: CommitParams["fetch"]; + useWebWorkers?: CommitParams["useWebWorkers"]; + maxFolderDepth?: CommitParams["maxFolderDepth"]; + abortSignal?: CommitParams["abortSignal"]; + useXet?: CommitParams["useXet"]; + } & Partial, +): Promise { + return commit({ + ...(params.accessToken ? { accessToken: params.accessToken } : { credentials: params.credentials }), + repo: params.repo, + operations: params.files.map((file) => ({ + operation: "addOrUpdate", + path: file instanceof URL ? (file.pathname.split("/").at(-1) ?? "file") : "path" in file ? file.path : file.name, + content: "content" in file ? file.content : file, + })), + title: params.commitTitle ?? `Add ${params.files.length} files`, + description: params.commitDescription, + hubUrl: params.hubUrl, + branch: params.branch, + isPullRequest: params.isPullRequest, + parentCommit: params.parentCommit, + fetch: params.fetch, + useWebWorkers: params.useWebWorkers, + abortSignal: params.abortSignal, + useXet: params.useXet, + }); +} diff --git a/node_modules/@huggingface/hub/src/lib/who-am-i.spec.ts b/node_modules/@huggingface/hub/src/lib/who-am-i.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..9996727293ae4b5ca656d8fb949d05c64a7fd3c4 --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/who-am-i.spec.ts @@ -0,0 +1,36 @@ +import { assert, it, describe } from "vitest"; +import { TEST_ACCESS_TOKEN, TEST_HUB_URL } from "../test/consts"; +import { whoAmI } from "./who-am-i"; + +describe("whoAmI", () => { + it("should fetch identity info", async () => { + const info = await whoAmI({ accessToken: TEST_ACCESS_TOKEN, hubUrl: TEST_HUB_URL }); + + if (info.auth.accessToken?.createdAt instanceof Date) { + info.auth.accessToken.createdAt = new Date(0); + } + + assert.deepStrictEqual(info, { + type: "user", + id: "62f264b9f3c90f4b6514a269", + name: "hub.js", + fullname: "@huggingface/hub CI bot", + email: "eliott@huggingface.co", + emailVerified: true, + canPay: false, + isPro: false, + periodEnd: null, + avatarUrl: "/avatars/934b830e9fdaa879487852f79eef7165.svg", + billingMode: "postpaid", + orgs: [], + auth: { + type: "access_token", + accessToken: { + createdAt: new Date(0), + displayName: "ci-hub.js", + role: "write", + }, + }, + }); + }); +}); diff --git a/node_modules/@huggingface/hub/src/lib/who-am-i.ts b/node_modules/@huggingface/hub/src/lib/who-am-i.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c50650bc957c834d1efa5973e17472e4037a4bd --- /dev/null +++ b/node_modules/@huggingface/hub/src/lib/who-am-i.ts @@ -0,0 +1,92 @@ +import { HUB_URL } from "../consts"; +import { createApiError } from "../error"; +import type { ApiWhoAmIReponse } from "../types/api/api-who-am-i"; +import type { AccessTokenRole, AuthType, CredentialsParams } from "../types/public"; +import { checkCredentials } from "../utils/checkCredentials"; + +export interface WhoAmIUser { + /** Unique ID persistent across renames */ + id: string; + type: "user"; + email: string; + emailVerified: boolean; + isPro: boolean; + orgs: WhoAmIOrg[]; + name: string; + fullname: string; + canPay: boolean; + avatarUrl: string; + /** + * Unix timestamp in seconds + */ + periodEnd: number | null; + billingMode: "postpaid" | "prepaid"; +} + +export interface WhoAmIOrg { + /** Unique ID persistent across renames */ + id: string; + type: "org"; + name: string; + fullname: string; + email: string | null; + canPay: boolean; + avatarUrl: string; + /** + * Unix timestamp in seconds + */ + periodEnd: number | null; +} + +export interface WhoAmIApp { + id: string; + type: "app"; + name: string; + scope?: { + entities: string[]; + role: "admin" | "write" | "contributor" | "read"; + }; +} + +export type WhoAmI = WhoAmIApp | WhoAmIOrg | WhoAmIUser; +export interface AuthInfo { + type: AuthType; + accessToken?: { + displayName: string; + role: AccessTokenRole; + createdAt: Date; + }; + expiresAt?: Date; +} + +export async function whoAmI( + params: { + hubUrl?: string; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + } & CredentialsParams, +): Promise { + const accessToken = checkCredentials(params); + + const res = await (params.fetch ?? fetch)(`${params.hubUrl ?? HUB_URL}/api/whoami-v2`, { + headers: { + Authorization: `Bearer ${accessToken}`, + }, + }); + + if (!res.ok) { + throw await createApiError(res); + } + + const response: ApiWhoAmIReponse & { + auth: AuthInfo; + } = await res.json(); + + if (typeof response.auth.accessToken?.createdAt === "string") { + response.auth.accessToken.createdAt = new Date(response.auth.accessToken.createdAt); + } + + return response; +} diff --git a/node_modules/@huggingface/hub/src/test/consts.ts b/node_modules/@huggingface/hub/src/test/consts.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b8b7983d62f140076851c03c901ab2da6c6bff3 --- /dev/null +++ b/node_modules/@huggingface/hub/src/test/consts.ts @@ -0,0 +1,4 @@ +export const TEST_HUB_URL = "https://hub-ci.huggingface.co"; +export const TEST_USER = "hub.js"; +export const TEST_ACCESS_TOKEN = "hf_hub.js"; +export const TEST_COOKIE = "huggingface-hub.js-cookie"; diff --git a/node_modules/@huggingface/hub/src/types/api/api-author.ts b/node_modules/@huggingface/hub/src/types/api/api-author.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9e562a01ff9b2342a23e990318f6b5d53eddfaf --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-author.ts @@ -0,0 +1,26 @@ +export type ApiAuthor = + | { + avatarUrl: string; + fullname: string; + name: string; + isHf: boolean; + isHfAdmin: boolean; + isMod: boolean; + followerCount?: number; + type: "org"; + plan?: string; + isUserFollowing?: boolean; + } + | { + avatarUrl: string; + fullname: string; + name: string; + isHf: boolean; + isHfAdmin: boolean; + isMod: boolean; + followerCount?: number; + type: "user"; + isPro: boolean; + _id: string; + isUserFollowing?: boolean; + }; diff --git a/node_modules/@huggingface/hub/src/types/api/api-collection.ts b/node_modules/@huggingface/hub/src/types/api/api-collection.ts new file mode 100644 index 0000000000000000000000000000000000000000..412e2d1470ab1a475c6c6e81f8b6fddababf895a --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-collection.ts @@ -0,0 +1,328 @@ +import type { ApiAuthor } from "./api-author"; + +export interface ApiCollectionInfo { + slug: string; + title: string; + description?: string; + lastUpdated: string; + gating: + | true + | ( + | false + | { + mode: "auto"; + } + | { + mode: "manual"; + notifications: { + mode: "bulk" | "real-time"; + email?: string; + }; + } + ); + owner: ApiAuthor; + /** + * Note that it's limited to 4 items when the listing endpoint is used. + */ + items: ApiCollectionItem[]; + theme: "orange" | "blue" | "green" | "purple" | "pink" | "indigo"; + private: boolean; + upvotes: number; + isUpvotedByUser: boolean; +} + +interface ApiCollectionItemBase { + _id: string; + position: number; + note?: { + html: string; + text: string; + }; + gallery?: string[]; +} + +interface ApiCollectionItemModel extends ApiCollectionItemBase { + type: "model"; + author: string; + downloads: number; + id: string; + availableInferenceProviders: { + provider: + | "black-forest-labs" + | "cerebras" + | "cohere" + | "fal-ai" + | "featherless-ai" + | "fireworks-ai" + | "groq" + | "hf-inference" + | "hyperbolic" + | "nebius" + | "novita" + | "nscale" + | "openai" + | "ovhcloud" + | "replicate" + | "sambanova" + | "together"; + providerStatus: "live" | "staging" | "error"; + modelStatus: "live" | "staging" | "error"; + providerId: string; + task: + | "text-classification" + | "token-classification" + | "table-question-answering" + | "question-answering" + | "zero-shot-classification" + | "translation" + | "summarization" + | "feature-extraction" + | "text-generation" + | "text2text-generation" + | "fill-mask" + | "sentence-similarity" + | "text-to-speech" + | "text-to-audio" + | "automatic-speech-recognition" + | "audio-to-audio" + | "audio-classification" + | "audio-text-to-text" + | "voice-activity-detection" + | "depth-estimation" + | "image-classification" + | "object-detection" + | "image-segmentation" + | "text-to-image" + | "image-to-text" + | "image-to-image" + | "image-to-video" + | "unconditional-image-generation" + | "video-classification" + | "reinforcement-learning" + | "robotics" + | "tabular-classification" + | "tabular-regression" + | "tabular-to-text" + | "table-to-text" + | "multiple-choice" + | "text-ranking" + | "text-retrieval" + | "time-series-forecasting" + | "text-to-video" + | "image-text-to-text" + | "visual-question-answering" + | "document-question-answering" + | "zero-shot-image-classification" + | "graph-ml" + | "mask-generation" + | "zero-shot-object-detection" + | "text-to-3d" + | "image-to-3d" + | "image-feature-extraction" + | "video-text-to-text" + | "keypoint-detection" + | "visual-document-retrieval" + | "any-to-any" + | "video-to-video" + | "other" + | "conversational"; + adapterType?: "lora"; + adapterWeightsPath?: string; + }[]; + isLikedByUser: boolean; + lastModified: string; + likes: number; + pipeline_tag?: string; + private: boolean; + repoType: "model"; + gated: false | ("auto" | "manual"); + resourceGroup?: { + id: string; + name: string; + numUsers: number; + }; + numParameters?: number; + authorData?: ApiAuthor; + widgetOutputUrls?: string[]; +} + +interface ApiCollectionItemDataset extends ApiCollectionItemBase { + type: "dataset"; + author: string; + id: string; + isLikedByUser: boolean; + likes: number; + datasetsServerInfo?: { + viewer: "preview" | "viewer-partial" | "viewer"; + numRows: number | null; + libraries: ( + | "mlcroissant" + | "webdataset" + | "datasets" + | "pandas" + | "dask" + | "distilabel" + | "fiftyone" + | "argilla" + | "polars" + | "duckdb" + )[]; + formats: ("json" | "csv" | "parquet" | "imagefolder" | "audiofolder" | "webdataset" | "text" | "arrow")[]; + modalities: ("3d" | "audio" | "document" | "geospatial" | "image" | "tabular" | "text" | "timeseries" | "video")[]; + }; + private: boolean; + repoType: "dataset"; + downloads: number; + gated: false | ("auto" | "manual"); + lastModified: string; + resourceGroup?: { + id: string; + name: string; + numUsers: number; + }; +} + +interface ApiCollectionItemSpace extends ApiCollectionItemBase { + type: "space"; + author: string; + colorFrom: string; + colorTo: string; + createdAt: string; + emoji: string; + id: string; + isLikedByUser: boolean; + lastModified: string; + likes: number; + pinned: boolean; + private: boolean; + featured: boolean; + repoType: "space"; + title: string; + sdk?: "gradio" | "docker" | "static" | "streamlit"; + runtime: { + stage: + | "NO_APP_FILE" + | "CONFIG_ERROR" + | "BUILDING" + | "BUILD_ERROR" + | "APP_STARTING" + | "RUNNING" + | "RUNNING_BUILDING" + | "RUNNING_APP_STARTING" + | "RUNTIME_ERROR" + | "DELETING" + | "STOPPED" + | "PAUSED" + | "SLEEPING"; + hardware: { + current: + | ( + | "cpu-basic" + | "cpu-upgrade" + | "cpu-performance" + | "cpu-xl" + | "zero-a10g" + | "t4-small" + | "t4-medium" + | "l4x1" + | "l4x4" + | "l40sx1" + | "l40sx4" + | "l40sx8" + | "a10g-small" + | "a10g-large" + | "a10g-largex2" + | "a10g-largex4" + | "a100-large" + | "h100" + | "h100x8" + ) + | null; + requested: + | ( + | "cpu-basic" + | "cpu-upgrade" + | "cpu-performance" + | "cpu-xl" + | "zero-a10g" + | "t4-small" + | "t4-medium" + | "l4x1" + | "l4x4" + | "l40sx1" + | "l40sx4" + | "l40sx8" + | "a10g-small" + | "a10g-large" + | "a10g-largex2" + | "a10g-largex4" + | "a100-large" + | "h100" + | "h100x8" + ) + | null; + }; + storage: ("small" | "medium" | "large") | null; + errorMessage?: string; + gcTimeout?: number | null; + replicas: { + current?: number | null; + requested: number | "auto"; + }; + devMode?: boolean; + domains?: { + domain: string; + isCustom?: boolean | null; + stage: "READY" | "PENDING"; + }[]; + sha?: string; + }; + originSpace?: { + author: ApiAuthor; + name: string; + }; + ai_short_description?: string; + ai_category?: string; + trendingScore?: number; + resourceGroup?: { + id: string; + name: string; + numUsers: number; + }; + tags: string[]; + authorData?: ApiAuthor; + shortDescription?: string; + semanticRelevancyScore?: number; +} + +interface ApiCollectionItemPaper extends ApiCollectionItemBase { + type: "paper"; + id: string; + title: string; + upvotes: number; + publishedAt: string; + thumbnailUrl?: string; + isUpvotedByUser?: boolean; +} + +interface ApiCollectionItemCollection extends ApiCollectionItemBase { + type: "collection"; + slug: string; + lastUpdated: string; + description?: string; + owner: ApiAuthor; + title: string; + theme: "orange" | "blue" | "green" | "purple" | "pink" | "indigo"; + upvotes: number; + isUpvotedByUser: boolean; + id: string; + numberItems: number; + shareUrl: string; +} + +type ApiCollectionItem = + | ApiCollectionItemModel + | ApiCollectionItemDataset + | ApiCollectionItemSpace + | ApiCollectionItemPaper + | ApiCollectionItemCollection; diff --git a/node_modules/@huggingface/hub/src/types/api/api-commit.ts b/node_modules/@huggingface/hub/src/types/api/api-commit.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ef67730da786d83814a279df8f86fb26f4dc4ce --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-commit.ts @@ -0,0 +1,204 @@ +export interface ApiLfsBatchRequest { + /// github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md + operation: "download" | "upload"; + transfers?: Array; + /** + * Optional object describing the server ref that the objects belong to. Note: Added in v2.4. + * + * We use this object for QOL and to fail early for users when they're trying to push to the wrong reference. + * But it does nothing for security. + */ + ref?: { + name: string; + } | null; + objects: { + oid: string; + /** + * Integer byte size of the LFS object. Must be at least zero. + */ + size: number; + }[]; + /** + * The hash algorithm used to name Git LFS objects. Optional; defaults to sha256 if not specified. + * */ + hash_algo?: string; +} + +export interface ApiLfsBatchResponse { + transfer?: ApiLfsResponseTransfer; + objects: ApiLfsResponseObject[]; +} + +export type ApiLfsResponseTransfer = "basic" | "multipart" | "xet"; + +export interface ApiLfsCompleteMultipartRequest { + oid: string; + parts: { etag: string; partNumber: number }[]; +} + +export interface ApiLfsResponseObject { + /** + * Optional boolean specifying whether the request + * for this specific object is authenticated. + * If omitted or false, Git LFS will attempt to find credentials for this URL. + */ + authenticated?: boolean; + oid: string; + /** + * Integer byte size of the LFS object. Must be at least zero. + */ + size: number; + /** + * Applicable actions depend on which `operation` is specified in the request. + * How these properties are interpreted depends on which transfer adapter + * the client will be using. + */ + actions?: { + /** + * Download operations MUST specify a download action, + * or an object error if the object cannot be downloaded for some reason + */ + download?: ApiLfsAction; + /** + * Upload operations can specify an upload and a verify action. + * The upload action describes how to upload the object. + */ + upload?: ApiLfsAction; + /** + * The LFS client will hit this URL after a successful upload. + * Servers can use this for extra verification, if needed. + */ + verify?: ApiLfsAction; + }; + /** + * If there are problems accessing individual objects, servers should continue + * to return a 200 status code, and provide per-object errors + */ + error?: { + code: number; + message: string; + }; +} + +export interface ApiLfsAction { + href: string; + /** + * Optional hash of String HTTP header key/value pairs to apply to the request + */ + header?: { [key: string]: string } & { chunk_size?: string }; + /** + * Whole number of seconds after local client time when transfer will expire. + * Preferred over `expires_at` if both are provided. + * Maximum of 2147483647, minimum of -2147483647. + */ + expires_in?: number; + /** + * String uppercase RFC 3339-formatted timestamp with second precision + * for when the given action expires (usually due to a temporary token). + */ + expires_at?: string; +} + +export interface ApiPreuploadRequest { + /** + * Optional, otherwise takes the existing content of `.gitattributes` for the revision. + * + * Provide this parameter if you plan to modify `.gitattributes` yourself at the same + * time as uploading LFS files. + * + * Note that this is not needed if you solely rely on automatic LFS detection from HF: the commit endpoint + * will automatically edit the `.gitattributes` file to track the files passed to its `lfsFiles` param. + */ + gitAttributes?: string; + files: Array<{ + /** + * Path of the LFS file + */ + path: string; + /** + * Full size of the LFS file + */ + size: number; + /** + * Base64-encoded sample of the first 512 bytes of the file + */ + sample: string; + }>; +} +export interface ApiBucketBatchResponse { + /** True if all files were successfully added */ + success: boolean; + /** Total number of operations attempted */ + processed: number; + /** Number of successful operations */ + succeeded: number; + /** List of failed operations */ + failed: Array<{ + path: string; + error: string; + }>; +} + +export interface ApiPreuploadResponse { + files: Array<{ + path: string; + uploadMode: "lfs" | "regular"; + }>; +} + +export interface ApiCommitHeader { + summary: string; + description?: string; + /** + * Parent commit. Optional + * + * - When opening a PR: will use parentCommit as the parent commit + * - When committing on a branch: Will make sure that there were no intermediate commits + */ + parentCommit?: string; +} + +export interface ApiCommitDeletedEntry { + path: string; +} + +export interface ApiCommitLfsFile { + path: string; + oldPath?: string; + /** Required if {@link oldPath} is not set */ + algo?: "sha256"; + /** Required if {@link oldPath} is not set */ + oid?: string; + size?: number; +} + +export interface ApiCommitFile { + /** Required if {@link oldPath} is not set */ + content?: string; + path: string; + oldPath?: string; + encoding?: "utf-8" | "base64"; +} + +export type ApiCommitOperation = + | { + key: "file"; + value: ApiCommitFile; + } + | { + key: "lfsFile"; + value: ApiCommitLfsFile; + } + | { + key: "deletedFile"; + value: ApiCommitDeletedEntry; + }; + +export interface ApiCommitData { + id: string; + title: string; + message: string; + authors: Array<{ user: string; avatar: string }>; + date: string; + formatted?: string; +} diff --git a/node_modules/@huggingface/hub/src/types/api/api-create-collection.ts b/node_modules/@huggingface/hub/src/types/api/api-create-collection.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d246b7561b869a6f0f7ea506c25e1e159e93993 --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-create-collection.ts @@ -0,0 +1,19 @@ +export interface ApiCreateCollectionPayload { + /** + * Title of the collection to create. + */ + title: string; + /** + * Namespace of the collection to create (username or org). + */ + namespace: string; + /** + * Description of the collection to create. + */ + description?: string; + /** + * Whether the collection should be private or not. Defaults to False (i.e. public collection). + * @default false + */ + private?: boolean; +} diff --git a/node_modules/@huggingface/hub/src/types/api/api-create-repo.ts b/node_modules/@huggingface/hub/src/types/api/api-create-repo.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf7f0495447199b55cdffadc2b9c1d6d5beb8f77 --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-create-repo.ts @@ -0,0 +1,26 @@ +import type { SetRequired } from "../../vendor/type-fest/set-required"; +import type { RepoType, SpaceHardwareFlavor, SpaceSdk } from "../public"; +import type { ApiCommitFile } from "./api-commit"; + +export type ApiCreateRepoPayload = { + name: string; + canonical?: boolean; + license?: string; + resourceGroupId?: string; + template?: string; + organization?: string; + /** @default false */ + private?: boolean; + lfsmultipartthresh?: number; + files?: SetRequired[]; +} & ( + | { + type: Exclude; + } + | { + type: "space"; + hardware?: SpaceHardwareFlavor; + sdk: SpaceSdk; + sdkVersion?: string; + } +); diff --git a/node_modules/@huggingface/hub/src/types/api/api-dataset.ts b/node_modules/@huggingface/hub/src/types/api/api-dataset.ts new file mode 100644 index 0000000000000000000000000000000000000000..43b0978537d8855745fd668443b3fc102060b3e4 --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-dataset.ts @@ -0,0 +1,89 @@ +import type { License } from "../public"; + +export interface ApiDatasetInfo { + _id: string; + id: string; + arxivIds?: string[]; + author?: string; + cardExists?: true; + cardError?: unknown; + cardData?: ApiDatasetMetadata; + contributors?: Array<{ user: string; _id: string }>; + disabled: boolean; + discussionsDisabled: boolean; + gated: false | "auto" | "manual"; + gitalyUid: string; + lastAuthor: { email: string; user?: string }; + lastModified: string; // date + likes: number; + likesRecent: number; + private: boolean; + updatedAt: string; // date + createdAt: string; // date + tags: string[]; + paperswithcode_id?: string; + sha: string; + files?: string[]; + citation?: string; + description?: string; + downloads: number; + downloadsAllTime: number; + previewable?: boolean; + doi?: { id: string; commit: string }; +} + +export interface ApiDatasetMetadata { + licenses?: undefined; + license?: License | License[]; + license_name?: string; + license_link?: "LICENSE" | "LICENSE.md" | string; + license_details?: string; + languages?: undefined; + language?: string | string[]; + language_bcp47?: string[]; + language_details?: string; + tags?: string[]; + task_categories?: string[]; + task_ids?: string[]; + config_names?: string[]; + configs?: { + config_name: string; + data_files?: + | string + | string[] + | { + split: string; + path: string | string[]; + }[]; + data_dir?: string; + }[]; + benchmark?: string; + paperswithcode_id?: string | null; + pretty_name?: string; + viewer?: boolean; + viewer_display_urls?: boolean; + thumbnail?: string | null; + description?: string | null; + annotations_creators?: string[]; + language_creators?: string[]; + multilinguality?: string[]; + size_categories?: string[]; + source_datasets?: string[]; + extra_gated_prompt?: string; + extra_gated_fields?: { + /** + * "text" | "checkbox" | "date_picker" | "country" | "ip_location" | { type: "text" | "checkbox" | "date_picker" | "country" | "ip_location" } | { type: "select", options: Array } Property + */ + [x: string]: + | "text" + | "checkbox" + | "date_picker" + | "country" + | "ip_location" + | { type: "text" | "checkbox" | "date_picker" | "country" | "ip_location" } + | { type: "select"; options: Array }; + }; + extra_gated_heading?: string; + extra_gated_description?: string; + extra_gated_button_content?: string; +} diff --git a/node_modules/@huggingface/hub/src/types/api/api-index-tree.ts b/node_modules/@huggingface/hub/src/types/api/api-index-tree.ts new file mode 100644 index 0000000000000000000000000000000000000000..a467218cf288dbbdcb90662e72736fcabfa0246a --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-index-tree.ts @@ -0,0 +1,46 @@ +export interface ApiIndexTreeEntry { + type: "file" | "directory" | "unknown"; + size: number; + path: string; + oid: string; + lfs?: { + oid: string; + size: number; + /** Size of the raw pointer file, 100~200 bytes */ + pointerSize: number; + }; + lastCommit?: { + date: string; + id: string; + title: string; + }; + security?: ApiFileScanResult; +} + +export interface ApiFileScanResult { + /** namespaced by repo type (models/, datasets/, spaces/) */ + repositoryId: string; + blobId: string; + name: string; + safe: boolean; + avScan?: ApiAVScan; + pickleImportScan?: ApiPickleImportScan; +} + +interface ApiAVScan { + virusFound: boolean; + virusNames?: string[]; +} + +type ApiSafetyLevel = "innocuous" | "suspicious" | "dangerous"; + +interface ApiPickleImport { + module: string; + name: string; + safety: ApiSafetyLevel; +} + +interface ApiPickleImportScan { + highestSafetyLevel: ApiSafetyLevel; + imports: ApiPickleImport[]; +} diff --git a/node_modules/@huggingface/hub/src/types/api/api-jobs.ts b/node_modules/@huggingface/hub/src/types/api/api-jobs.ts new file mode 100644 index 0000000000000000000000000000000000000000..ba4da0dd74f00046cb75d3ab507a438f263ac068 --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-jobs.ts @@ -0,0 +1,146 @@ +import type { SpaceHardwareFlavor } from "../public"; + +export interface ApiJobHardware { + name: string; + prettyName: string; + cpu: string; + ram: string; + accelerator: { + type: "gpu" | "neuron"; + model: string; + quantity: string; + vram: string; + manufacturer: "Nvidia" | "AWS"; + } | null; + unitCostMicroUSD: number; + unitCostUSD: number; + unitLabel: string; +} + +export type JobStatusStage = "DELETING" | "RUNNING" | "PAUSED" | "STOPPED" | "UPDATING" | "ERROR"; + +export interface ApiJobStatus { + stage: JobStatusStage; + message?: string | null; + failureCount: number; +} + +export interface ApiJobUser { + id: string; + name: string; + type?: "user" | "org"; + avatarUrl?: string; +} + +export interface ApiJob { + type: "job"; + id: string; + status: ApiJobStatus; + createdAt: string; + updatedAt?: string; + startedAt?: string | null; + finishedAt?: string | null; + createdBy?: { + id: string; + name: string; + }; + dockerImage?: string | null; + spaceId?: string | null; + command?: string[] | null; + arguments?: string[] | null; + environment?: Record | null; + flavor: SpaceHardwareFlavor; + arch?: "amd64" | "arm64" | null; + timeoutSeconds?: number | null; + attempts?: number; + owner?: ApiJobUser; + initiator?: ApiJobUser; + secrets?: string[]; + labels?: Record | null; +} + +export interface ApiScheduledJob { + id: string; + schedule: string; + suspend: boolean; + concurrency: boolean; + createdAt: string; + updatedAt: string; + jobSpec: { + dockerImage?: string | null; + spaceId?: string | null; + command?: string[] | null; + environment?: Record | null; + flavor: SpaceHardwareFlavor; + arch?: "amd64" | "arm64" | null; + timeoutSeconds?: number | null; + attempts?: number; + labels?: Record | null; + }; +} + +export interface CreateJobOptions { + /** + * The Docker image to run (e.g., "python:3.12" or "pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel") + */ + dockerImage?: string; + /** + * The Space ID to run (e.g., "username/space-name") + */ + spaceId?: string; + /** + * The command to run (array of strings) + */ + command?: string[]; + /** + * Additional arguments to pass to the command + */ + arguments?: string[]; + /** + * Environment variables to set + */ + environment?: Record; + /** + * Secrets to pass (will be encrypted server-side) + */ + secrets?: Record; + /** + * Hardware flavor to use + */ + flavor: SpaceHardwareFlavor; + /** + * Architecture (defaults to "amd64") + */ + arch?: "amd64" | "arm64"; + /** + * Timeout in seconds + */ + timeoutSeconds?: number | null; + /** + * Maximum number of attempts (defaults to 1) + */ + attempts?: number; + /** + * Labels to attach to the job (key-value pairs) + */ + labels?: Record; +} + +export interface CreateScheduledJobOptions { + /** + * The job specification + */ + jobSpec: Omit; + /** + * CRON schedule expression (e.g., "0 9 * * 1" for 9 AM every Monday) or shortcuts like "@hourly", "@daily" + */ + schedule: string; + /** + * Whether the scheduled job is suspended (paused) + */ + suspend?: boolean; + /** + * Whether multiple instances of this job can run concurrently + */ + concurrency?: boolean; +} diff --git a/node_modules/@huggingface/hub/src/types/api/api-model.ts b/node_modules/@huggingface/hub/src/types/api/api-model.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cd5b819a5d340b065d1a095ec65d41fb75e7089 --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-model.ts @@ -0,0 +1,282 @@ +import type { ModelLibraryKey, TransformersInfo, WidgetType } from "@huggingface/tasks"; +import type { License, PipelineType } from "../public"; + +export interface ApiModelInfo { + _id: string; + id: string; + arxivIds: string[]; + author?: string; + cardData?: ApiModelMetadata; + cardError: unknown; + cardExists?: true; + config: unknown; + contributors: Array<{ user: string; _id: string }>; + disabled: boolean; + discussionsDisabled: boolean; + doi?: { id: string; commit: string }; + downloads: number; + downloadsAllTime: number; + files: string[]; + gitalyUid: string; + inferenceProviderMapping?: ApiModelInferenceProviderMappingEntry[]; + lastAuthor: { email: string; user?: string }; + lastModified: string; // convert to date + library_name?: ModelLibraryKey; + likes: number; + likesRecent: number; + private: boolean; + gated: false | "auto" | "manual"; + sha: string; + spaces: string[]; + updatedAt: string; // convert to date + createdAt: string; // convert to date + pipeline_tag: PipelineType; + tags: string[]; + "model-index": unknown; + safetensors?: { + parameters: Record; + total: number; + }; + transformersInfo?: TransformersInfo; +} + +export interface ApiModelIndex { + name: string; + results: { + task: { + /** + * Example: automatic-speech-recognition +Use task id from https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/tasksData.ts + */ + type: string; + /** + * Example: Speech Recognition + */ + name?: string; + }; + /** + * This will switch to required at some point. +in any case, we need them to link to PWC + */ + dataset?: { + /** + * Example: common_voice. Use dataset id from https://hf.co/datasets + */ + type: string; + /** + * A pretty name for the dataset. Example: Common Voice zh-CN +Also encode config params into the name if relevant. + */ + name: string; + /** + * Optional. The name of the dataset configuration used in `load_dataset()` + */ + config?: string; + /** + * Optional. Example: test + */ + split?: string; + /** + * Optional. Example: 5503434ddd753f426f4b38109466949a1217c2bb + */ + revision?: string; + args?: + | string + | { + /** + * String Property + */ + [x: string]: string; + }; + }; + metrics: { + /** + * Example: wer. Use metric id from https://hf.co/metrics + */ + type: string; + /** + * Required. Example: 20.0 or "20.0 ± 1.2" + */ + value: unknown; + /** + * Example: Test WER + */ + name?: string; + /** + * Optional. The name of the metric configuration used in `load_metric()`. + */ + config?: string; + args?: + | string + | { + /** + * String Property + */ + [x: string]: string; + }; + /** + * [Automatically computed, do not set] Dynamically overridden by huggingface in API calls to indicate if it was verified by Hugging Face. + */ + verified?: boolean; + /** + * Generated by Hugging Face to prove the results are valid. + */ + verifyToken?: string; + }[]; + /** + * The source for this evaluation result. + */ + source?: { + /** + * Example: Open LLM Leaderboard + */ + name?: string; + /** + * Example: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard + */ + url: string; + }; + }[]; +} + +export interface ApiWidgetExampleFromModelcard { + example_title?: string; + group?: string; + text?: string; + src?: string; + table?: { + /** + * (string | number)[] Property + */ + [x: string]: (string | number)[]; + }; + structured_data?: { + /** + * (string | number)[] Property + */ + [x: string]: (string | number)[]; + }; + candidate_labels?: string; + messages?: { + role: "system" | "user" | "assistant"; + content: string; + }[]; + multi_class?: boolean; + source_sentence?: string; + sentences?: string[]; + parameters?: { + aggregation_strategy?: string; + top_k?: number; + top_p?: number; + temperature?: number; + max_new_tokens?: number; + do_sample?: boolean; + negative_prompt?: string; + guidance_scale?: number; + num_inference_steps?: number; + }; + output?: + | { + label: string; + score: number; + }[] + | { + answer: string; + score: number; + } + | { + text: string; + } + | { + url: string; + }; +} + +export interface ApiModelMetadata { + datasets?: string | string[]; + license?: License | License[]; + license_name?: string; + license_link?: "LICENSE" | "LICENSE.md" | string; + license_details?: string; + inference?: + | boolean + | { + parameters?: { + aggregation_strategy?: string; + top_k?: number; + top_p?: number; + temperature?: number; + max_new_tokens?: number; + do_sample?: boolean; + negative_prompt?: string; + guidance_scale?: number; + num_inference_steps?: number; + }; + }; + language?: string | string[]; + language_bcp47?: string[]; + language_details?: string; + tags?: string[]; + pipeline_tag?: string; + co2_eq_emissions?: + | number + | { + /** + * Emissions in grams of CO2 + */ + emissions: number; + /** + * source of the information, either directly from AutoTrain, code carbon or from a scientific article documenting the model + */ + source?: string; + /** + * pre-training or fine-tuning + */ + training_type?: string; + /** + * as granular as possible, for instance Quebec, Canada or Brooklyn, NY, USA + */ + geographical_location?: string; + /** + * how much compute and what kind, e.g. 8 v100 GPUs + */ + hardware_used?: string; + }; + library_name?: string; + thumbnail?: string | null; + description?: string | null; + mask_token?: string; + widget?: ApiWidgetExampleFromModelcard[]; + "model-index"?: ApiModelIndex[]; + finetuned_from?: string; + base_model?: string | string[]; + instance_prompt?: string | null; + extra_gated_prompt?: string; + extra_gated_fields?: { + /** + * "text" | "checkbox" | "date_picker" | "country" | "ip_location" | { type: "text" | "checkbox" | "date_picker" | "country" | "ip_location" } | { type: "select", options: Array } Property + */ + [x: string]: + | "text" + | "checkbox" + | "date_picker" + | "country" + | "ip_location" + | { type: "text" | "checkbox" | "date_picker" | "country" | "ip_location" } + | { type: "select"; options: Array }; + }; + extra_gated_heading?: string; + extra_gated_description?: string; + extra_gated_button_content?: string; +} + +export interface ApiModelInferenceProviderMappingEntry { + provider: string; // Provider name + hfModelId: string; // ID of the model on the Hugging Face Hub + providerId: string; // ID of the model on the provider's side + status: "live" | "staging"; + task: WidgetType; + adapter?: string; + adapterWeightsPath?: string; + type?: "single-file" | "tag-filter"; +} diff --git a/node_modules/@huggingface/hub/src/types/api/api-space.ts b/node_modules/@huggingface/hub/src/types/api/api-space.ts new file mode 100644 index 0000000000000000000000000000000000000000..151677f4b36aa268f6ec95340f838a58b4a0f0f5 --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-space.ts @@ -0,0 +1,93 @@ +import type { License, SpaceRuntime, SpaceSdk } from "../public"; + +type Color = "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink" | "gray"; + +export interface ApiSpaceInfo { + _id: string; + id: string; + arxivIds?: string[]; + author: string; + cardExists?: true; + cardError?: unknown; + cardData?: unknown; + contributors?: Array<{ user: string; _id: string }>; + disabled: boolean; + discussionsDisabled: boolean; + duplicationDisabled: boolean; + gated: false | "auto" | "manual"; + gitalyUid: string; + lastAuthor: { email: string; user?: string }; + lastModified: string; // date + likes: number; + likesRecent: number; + private: boolean; + updatedAt: string; // date + createdAt: string; // date + tags: string[]; + sha: string; + subdomain: string; + title: string; + emoji: string; + colorFrom: Color; + colorTo: Color; + pinned: boolean; + siblings: Array<{ rfilename: string }>; + sdk?: SpaceSdk; + runtime?: SpaceRuntime; + models?: string[]; + datasets?: string[]; + originSpace?: { _id: string; authorId: string }; +} + +export interface ApiSpaceMetadata { + license?: License | License[]; + tags?: string[]; + title?: string; + colorFrom?: "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink" | "gray"; + colorTo?: "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink" | "gray"; + emoji?: string; + sdk?: "streamlit" | "gradio" | "docker" | "static"; + sdk_version?: string | string; + python_version?: string | string; + fullWidth?: boolean; + header?: "mini" | "default"; + app_file?: string; + app_port?: number; + base_path?: string; + models?: string[]; + datasets?: string[]; + pinned?: boolean; + metaTitle?: string; + description?: string; + thumbnail?: string; + /** + * If enabled, will associate an oauth app to the Space, adding variables and secrets to the Space's environment + */ + hf_oauth?: boolean; + /** + * The expiration of access tokens for your oauth app in minutes. max 30 days (43,200 minutes). Defaults to 8 hours (480 minutes) + */ + hf_oauth_expiration_minutes?: number; + /** + * OAuth scopes to request. By default you have access to the user's profile, you can request access to their repos or inference-api. + */ + hf_oauth_scopes?: ("email" | "read-repos" | "write-repos" | "manage-repos" | "inference-api")[]; + suggested_hardware?: + | "cpu-basic" + | "zero-a10g" + | "cpu-upgrade" + | "cpu-xl" + | "t4-small" + | "t4-medium" + | "a10g-small" + | "a10g-large" + | "a10g-largex2" + | "a10g-largex4" + | "a100-large"; + suggested_storage?: "small" | "medium" | "large"; + custom_headers?: { + "cross-origin-embedder-policy"?: "unsafe-none" | "require-corp" | "credentialless"; + "cross-origin-opener-policy"?: "same-origin" | "same-origin-allow-popups" | "unsafe-none"; + "cross-origin-resource-policy"?: "same-site" | "same-origin" | "cross-origin"; + }; +} diff --git a/node_modules/@huggingface/hub/src/types/api/api-who-am-i.ts b/node_modules/@huggingface/hub/src/types/api/api-who-am-i.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ece69e5a25d0b79ef5bd9c937a87c554f1c2156 --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/api/api-who-am-i.ts @@ -0,0 +1,52 @@ +import type { AccessTokenRole, AuthType } from "../public"; + +interface ApiWhoAmIBase { + /** Unique ID persistent across renames */ + id: string; + type: "user" | "org" | "app"; + name: string; +} + +interface ApiWhoAmIEntityBase extends ApiWhoAmIBase { + fullname: string; + email: string | null; + canPay: boolean; + avatarUrl: string; + /** + * Unix timestamp in seconds + */ + periodEnd: number | null; +} + +interface ApiWhoAmIOrg extends ApiWhoAmIEntityBase { + type: "org"; +} + +interface ApiWhoAmIUser extends ApiWhoAmIEntityBase { + type: "user"; + email: string; + emailVerified: boolean; + isPro: boolean; + orgs: ApiWhoAmIOrg[]; + billingMode: "postpaid" | "prepaid"; +} + +interface ApiWhoAmIApp extends ApiWhoAmIBase { + type: "app"; + name: string; + scope?: { + entities: string[]; + role: AccessTokenRole; + }; +} + +export type ApiWhoAmIReponse = ApiWhoAmIUser | ApiWhoAmIOrg | ApiWhoAmIApp; + +export interface ApiWhoAmIAuthInfo { + type: AuthType; + accessToken?: { + displayName: string; + expiration?: string; + role: AccessTokenRole; + }; +} diff --git a/node_modules/@huggingface/hub/src/types/public.ts b/node_modules/@huggingface/hub/src/types/public.ts new file mode 100644 index 0000000000000000000000000000000000000000..632ccde940cc9ea9ea5a0fd85d3dab14d8af9bf7 --- /dev/null +++ b/node_modules/@huggingface/hub/src/types/public.ts @@ -0,0 +1,191 @@ +import type { PipelineType } from "@huggingface/tasks"; + +export type RepoType = "space" | "dataset" | "model" | "bucket"; + +export interface RepoId { + name: string; + type: RepoType; +} + +export type RepoFullName = string | `spaces/${string}` | `datasets/${string}` | `buckets/${string}`; + +export type RepoDesignation = RepoId | RepoFullName; + +/** Actually `hf_${string}`, but for convenience, using the string type */ +export type AccessToken = string; + +/** + * @deprecated Use `AccessToken` instead. Pass { accessToken: "hf_..." } instead of { credentials: { accessToken: "hf_..." } } + */ +export interface Credentials { + accessToken: AccessToken; +} + +export type CredentialsParams = + | { + accessToken?: undefined; + /** + * @deprecated Use `accessToken` instead + */ + credentials: Credentials; + } + | { + accessToken: AccessToken; + /** + * @deprecated Use `accessToken` instead + */ + credentials?: undefined; + }; + +export type SpaceHardwareFlavor = + | "cpu-basic" + | "cpu-upgrade" + | "cpu-performance" + | "cpu-xl" + | "sprx8" + | "zero-a10g" + | "inf2x6" + | "t4-small" + | "t4-medium" + | "l4x1" + | "l4x4" + | "l40sx1" + | "l40sx4" + | "l40sx8" + | "a10g-small" + | "a10g-large" + | "a10g-largex2" + | "a10g-largex4" + | "a100-large" + | "a100x4" + | "a100x8"; + +export type SpaceSdk = "streamlit" | "gradio" | "docker" | "static"; + +export type SpaceStage = + | "NO_APP_FILE" + | "CONFIG_ERROR" + | "BUILDING" + | "BUILD_ERROR" + | "RUNNING" + | "RUNNING_BUILDING" + | "RUNTIME_ERROR" + | "DELETING" + | "PAUSED" + | "SLEEPING"; + +export type AccessTokenRole = "admin" | "write" | "contributor" | "read"; + +export type AuthType = "access_token" | "app_token" | "app_token_as_user"; + +export type { PipelineType }; + +export interface SpaceRuntime { + stage: SpaceStage; + sdk?: SpaceSdk; + sdkVersion?: string; + errorMessage?: string; + hardware?: { + current: SpaceHardwareFlavor | null; + currentPrettyName?: string; + requested: SpaceHardwareFlavor | null; + requestedPrettyName?: string; + }; + /** when calling /spaces, those props are only fetched if ?full=true */ + resources?: SpaceResourceConfig; + /** in seconds */ + gcTimeout?: number | null; +} + +export interface SpaceResourceRequirement { + cpu?: string; + memory?: string; + gpu?: string; + gpuModel?: string; + ephemeral?: string; +} + +export interface SpaceResourceConfig { + requests: SpaceResourceRequirement; + limits: SpaceResourceRequirement; + replicas?: number; + throttled?: boolean; + is_custom?: boolean; +} + +export type License = + | "apache-2.0" + | "mit" + | "openrail" + | "bigscience-openrail-m" + | "creativeml-openrail-m" + | "bigscience-bloom-rail-1.0" + | "bigcode-openrail-m" + | "afl-3.0" + | "artistic-2.0" + | "bsl-1.0" + | "bsd" + | "bsd-2-clause" + | "bsd-3-clause" + | "bsd-3-clause-clear" + | "c-uda" + | "cc" + | "cc0-1.0" + | "cc-by-2.0" + | "cc-by-2.5" + | "cc-by-3.0" + | "cc-by-4.0" + | "cc-by-sa-3.0" + | "cc-by-sa-4.0" + | "cc-by-nc-2.0" + | "cc-by-nc-3.0" + | "cc-by-nc-4.0" + | "cc-by-nd-4.0" + | "cc-by-nc-nd-3.0" + | "cc-by-nc-nd-4.0" + | "cc-by-nc-sa-2.0" + | "cc-by-nc-sa-3.0" + | "cc-by-nc-sa-4.0" + | "cdla-sharing-1.0" + | "cdla-permissive-1.0" + | "cdla-permissive-2.0" + | "wtfpl" + | "ecl-2.0" + | "epl-1.0" + | "epl-2.0" + | "etalab-2.0" + | "eupl-1.1" + | "agpl-3.0" + | "gfdl" + | "gpl" + | "gpl-2.0" + | "gpl-3.0" + | "lgpl" + | "lgpl-2.1" + | "lgpl-3.0" + | "isc" + | "lppl-1.3c" + | "ms-pl" + | "mpl-2.0" + | "odc-by" + | "odbl" + | "openrail++" + | "osl-3.0" + | "postgresql" + | "ofl-1.1" + | "ncsa" + | "unlicense" + | "zlib" + | "pddl" + | "lgpl-lr" + | "deepfloyd-if-license" + | "llama2" + | "llama3" + | "llama3.1" + | "llama3.2" + | "llama3.3" + | "gemma" + | "apple-ascl" + | "apple-amlr" + | "unknown" + | "other"; diff --git a/node_modules/@huggingface/hub/src/utils/ChunkCache.spec.ts b/node_modules/@huggingface/hub/src/utils/ChunkCache.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7901501e9479c81fc7c43d685a72eb41603ec11 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/ChunkCache.spec.ts @@ -0,0 +1,265 @@ +import { describe, it, expect } from "vitest"; +import { ChunkCache } from "./ChunkCache"; + +describe("ChunkCache", () => { + describe("basic operations", () => { + it("should create a cache with specified max size", () => { + const cache = new ChunkCache(5); + expect(cache.maxSize).toBe(5); + expect(cache.index).toBe(0); + }); + + it("should add and retrieve chunks", () => { + const cache = new ChunkCache(5); + + cache.addChunkToCache("hash1", 100, 10, null); + cache.addChunkToCache("hash2", 200, 20, null); + + const chunk1 = cache.getChunk("hash1", null); + const chunk2 = cache.getChunk("hash2", null); + + expect(chunk1).toEqual({ xorbIndex: 100, chunkIndex: 10 }); + expect(chunk2).toEqual({ xorbIndex: 200, chunkIndex: 20 }); + }); + + it("should return undefined for non-existent chunks", () => { + const cache = new ChunkCache(5); + + const chunk = cache.getChunk("nonexistent", null); + expect(chunk).toBeUndefined(); + }); + + it("should remove chunks from cache", () => { + const cache = new ChunkCache(5); + + cache.addChunkToCache("hash1", 100, 10, null); + expect(cache.getChunk("hash1", null)).toBeDefined(); + + cache.removeChunkFromCache("hash1"); + expect(cache.getChunk("hash1", null)).toBeUndefined(); + }); + }); + + describe("duplicate handling", () => { + it("should ignore duplicate hashes", () => { + const cache = new ChunkCache(5); + + // Add initial chunk + cache.addChunkToCache("hash1", 100, 10, null); + expect(cache.index).toBe(1); + expect(cache.map.size).toBe(1); + + // Try to add same hash again - should be ignored + cache.addChunkToCache("hash1", 999, 99, null); + expect(cache.index).toBe(1); // index should not increment + expect(cache.map.size).toBe(1); // map size should not increase + + // Original data should be preserved + const chunk = cache.getChunk("hash1", null); + expect(chunk).toEqual({ xorbIndex: 100, chunkIndex: 10 }); + }); + + it("should maintain consistency when adding duplicates mixed with new hashes", () => { + const cache = new ChunkCache(5); + + // Add some chunks + cache.addChunkToCache("hash1", 100, 10, null); + cache.addChunkToCache("hash2", 200, 20, null); + cache.addChunkToCache("hash3", 300, 30, null); + + expect(cache.index).toBe(3); + expect(cache.map.size).toBe(3); + + // Try to add duplicates + cache.addChunkToCache("hash1", 999, 99, null); // duplicate + cache.addChunkToCache("hash4", 400, 40, null); // new + cache.addChunkToCache("hash2", 888, 88, null); // duplicate + + expect(cache.index).toBe(4); // only incremented for hash4 + expect(cache.map.size).toBe(4); + + // Verify all chunks are accessible and have correct data + expect(cache.getChunk("hash1", null)).toEqual({ xorbIndex: 100, chunkIndex: 10 }); + expect(cache.getChunk("hash2", null)).toEqual({ xorbIndex: 200, chunkIndex: 20 }); + expect(cache.getChunk("hash3", null)).toEqual({ xorbIndex: 300, chunkIndex: 30 }); + expect(cache.getChunk("hash4", null)).toEqual({ xorbIndex: 400, chunkIndex: 40 }); + }); + }); + + describe("cache overflow and circular buffer behavior", () => { + it("should handle cache overflow correctly", () => { + const cache = new ChunkCache(3); // Small cache size + + // Fill the cache to capacity + cache.addChunkToCache("hash1", 100, 10, null); + cache.addChunkToCache("hash2", 200, 20, null); + cache.addChunkToCache("hash3", 300, 30, null); + + expect(cache.index).toBe(0); // wrapped around (3 % 3 = 0) + expect(cache.map.size).toBe(3); + + // All chunks should be accessible + expect(cache.getChunk("hash1", null)).toBeDefined(); + expect(cache.getChunk("hash2", null)).toBeDefined(); + expect(cache.getChunk("hash3", null)).toBeDefined(); + + // Add one more chunk - should evict the oldest (hash1) + cache.addChunkToCache("hash4", 400, 40, null); + + expect(cache.index).toBe(1); // wrapped around (4 % 3 = 1) + expect(cache.map.size).toBe(3); // size should remain the same + + // hash1 should be evicted, others should remain + expect(cache.getChunk("hash1", null)).toBeUndefined(); + expect(cache.getChunk("hash2", null)).toEqual({ xorbIndex: 200, chunkIndex: 20 }); + expect(cache.getChunk("hash3", null)).toEqual({ xorbIndex: 300, chunkIndex: 30 }); + expect(cache.getChunk("hash4", null)).toEqual({ xorbIndex: 400, chunkIndex: 40 }); + }); + + it("should continue evicting oldest entries as new ones are added", () => { + const cache = new ChunkCache(3); + + // Fill cache + cache.addChunkToCache("hash1", 100, 10, null); + cache.addChunkToCache("hash2", 200, 20, null); + cache.addChunkToCache("hash3", 300, 30, null); + + // Add more chunks to test multiple evictions + cache.addChunkToCache("hash4", 400, 40, null); // evicts hash1 + cache.addChunkToCache("hash5", 500, 50, null); // evicts hash2 + cache.addChunkToCache("hash6", 600, 60, null); // evicts hash3 + + expect(cache.map.size).toBe(3); + + // Only the last 3 should remain + expect(cache.getChunk("hash1", null)).toBeUndefined(); + expect(cache.getChunk("hash2", null)).toBeUndefined(); + expect(cache.getChunk("hash3", null)).toBeUndefined(); + expect(cache.getChunk("hash4", null)).toEqual({ xorbIndex: 400, chunkIndex: 40 }); + expect(cache.getChunk("hash5", null)).toEqual({ xorbIndex: 500, chunkIndex: 50 }); + expect(cache.getChunk("hash6", null)).toEqual({ xorbIndex: 600, chunkIndex: 60 }); + }); + + it("should handle removals during overflow correctly", () => { + const cache = new ChunkCache(3); + + // Fill cache + cache.addChunkToCache("hash1", 100, 10, null); + cache.addChunkToCache("hash2", 200, 20, null); + cache.addChunkToCache("hash3", 300, 30, null); + + // Remove middle element + cache.removeChunkFromCache("hash2"); + expect(cache.map.size).toBe(2); + + // Add new elements + cache.addChunkToCache("hash4", 400, 40, null); + cache.addChunkToCache("hash5", 500, 50, null); + + // The removal should not affect the eviction logic + expect(cache.getChunk("hash1", null)).toBeUndefined(); // evicted + expect(cache.getChunk("hash2", null)).toBeUndefined(); // removed + expect(cache.getChunk("hash3", null)).toEqual({ xorbIndex: 300, chunkIndex: 30 }); + expect(cache.getChunk("hash4", null)).toEqual({ xorbIndex: 400, chunkIndex: 40 }); + expect(cache.getChunk("hash5", null)).toEqual({ xorbIndex: 500, chunkIndex: 50 }); + }); + }); + + describe("consistency after operations", () => { + it("should maintain consistent state after mixed operations", () => { + const cache = new ChunkCache(4); + + // Add initial chunks + cache.addChunkToCache("a", 1, 10, null); + cache.addChunkToCache("b", 2, 20, null); + cache.addChunkToCache("c", 3, 30, null); + + // Mix of operations + cache.addChunkToCache("a", 999, 999, null); // duplicate (ignored) + cache.removeChunkFromCache("b"); // removal + cache.addChunkToCache("d", 4, 40, null); // new addition + cache.addChunkToCache("e", 5, 50, null); // new addition - this triggers overflow + cache.addChunkToCache("c", 888, 888, null); // duplicate (ignored) + + // Verify final state + // With cache size 4: a(0), b(1, removed), c(2), d(3), e(4 -> 0, wraps and evicts a) + expect(cache.getChunk("a", null)).toBeUndefined(); // evicted by e + expect(cache.getChunk("b", null)).toBeUndefined(); // removed + expect(cache.getChunk("c", null)).toEqual({ xorbIndex: 3, chunkIndex: 30 }); + expect(cache.getChunk("d", null)).toEqual({ xorbIndex: 4, chunkIndex: 40 }); + expect(cache.getChunk("e", null)).toEqual({ xorbIndex: 5, chunkIndex: 50 }); + + // Map size should be 3 (a evicted, b removed) + expect(cache.map.size).toBe(3); + }); + + it("should maintain consistency after cache overflow with mixed operations", () => { + const cache = new ChunkCache(3); + + // Fill cache + cache.addChunkToCache("first", 1, 1, null); + cache.addChunkToCache("second", 2, 2, null); + cache.addChunkToCache("third", 3, 3, null); + + // Cause overflow with duplicates and removals mixed in + cache.addChunkToCache("fourth", 4, 4, null); // evicts "first" + cache.addChunkToCache("second", 999, 999, null); // duplicate (ignored) + cache.removeChunkFromCache("third"); // removal + cache.addChunkToCache("fifth", 5, 5, null); // evicts "second" + + // Final state verification + expect(cache.getChunk("first", null)).toBeUndefined(); // evicted + expect(cache.getChunk("second", null)).toBeUndefined(); // evicted + expect(cache.getChunk("third", null)).toBeUndefined(); // removed + expect(cache.getChunk("fourth", null)).toEqual({ xorbIndex: 4, chunkIndex: 4 }); + expect(cache.getChunk("fifth", null)).toEqual({ xorbIndex: 5, chunkIndex: 5 }); + + cache.addChunkToCache("sixth", 6, 6, null); // new, takes "third" place + expect(cache.getChunk("sixth", null)).toEqual({ xorbIndex: 6, chunkIndex: 6 }); + expect(cache.getChunk("fourth", null)).toEqual({ xorbIndex: 4, chunkIndex: 4 }); + expect(cache.getChunk("fifth", null)).toEqual({ xorbIndex: 5, chunkIndex: 5 }); + + cache.addChunkToCache("seventh", 7, 7, null); // new, takes "fourth" place + expect(cache.getChunk("seventh", null)).toEqual({ xorbIndex: 7, chunkIndex: 7 }); + expect(cache.getChunk("fourth", null)).toBeUndefined(); // evicted + expect(cache.getChunk("fifth", null)).toEqual({ xorbIndex: 5, chunkIndex: 5 }); + + expect(cache.map.size).toBe(3); + }); + }); + + describe("negative xorbIndex handling", () => { + it("should handle negative xorbIndex values (remote xorbs)", () => { + const cache = new ChunkCache(5); + + cache.addChunkToCache("remote1", -1, 10, null); + cache.addChunkToCache("local1", 1, 20, null); + cache.addChunkToCache("remote2", -100, 30, null); + + expect(cache.getChunk("remote1", null)).toEqual({ xorbIndex: -1, chunkIndex: 10 }); + expect(cache.getChunk("local1", null)).toEqual({ xorbIndex: 1, chunkIndex: 20 }); + expect(cache.getChunk("remote2", null)).toEqual({ xorbIndex: -100, chunkIndex: 30 }); + }); + }); + + describe("edge cases", () => { + it("should handle cache with max size of 1", () => { + const cache = new ChunkCache(1); + + cache.addChunkToCache("hash1", 1, 1, null); + expect(cache.getChunk("hash1", null)).toBeDefined(); + + cache.addChunkToCache("hash2", 2, 2, null); + expect(cache.getChunk("hash1", null)).toBeUndefined(); // evicted + expect(cache.getChunk("hash2", null)).toEqual({ xorbIndex: 2, chunkIndex: 2 }); + }); + + it("should handle empty cache operations", () => { + const cache = new ChunkCache(5); + + expect(cache.getChunk("nonexistent", null)).toBeUndefined(); + cache.removeChunkFromCache("nonexistent"); // should not throw + expect(cache.map.size).toBe(0); + }); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/ChunkCache.ts b/node_modules/@huggingface/hub/src/utils/ChunkCache.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb64defb06f77e1a9938c8215a91ac190858aeb2 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/ChunkCache.ts @@ -0,0 +1,99 @@ +const CHUNK_CACHE_INITIAL_SIZE = 10_000; +const CHUNK_CACHE_GROW_FACTOR = 1.5; +const CHUNK_CACHE_MAX_SIZE = 1_000_000; + +export class ChunkCache { + index = 0; + // Index >= 0 means local xorb, < 0 means remote xorb + xorbIndices: Int32Array; + // Max 8K chunks per xorb, less than 64K uint16_t + chunkIndices: Uint16Array; + map = new Map(); // hash -> chunkCacheIndex. Less overhead that way, empty object is 60+B and empty array is 40+B + hmacs = new Set(); // todo : remove old hmacs + maxSize: number; + + constructor(maxSize: number = CHUNK_CACHE_MAX_SIZE) { + if (maxSize < 1) { + throw new Error("maxSize must be at least 1"); + } + this.maxSize = maxSize; + this.xorbIndices = new Int32Array(Math.min(CHUNK_CACHE_INITIAL_SIZE, maxSize)); + this.chunkIndices = new Uint16Array(Math.min(CHUNK_CACHE_INITIAL_SIZE, maxSize)); + } + + addChunkToCache(hash: string, xorbIndex: number, chunkIndex: number, hmac: string | null): void { + if (this.map.has(hash)) { + // Happens when we receive an existing chunk from remote dedup info (eg duplicate chunk in shard? Or shards with same hmac key + // sharing chunks/xorbs) + + // processing this chunk again would desync the cache, as `this.map.size` would not increase, as opposed to `this.index` + + // We could readd/remove it to "refresh it" + return; + } + if (this.map.values().next().value === this.index) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.map.delete(this.map.keys().next().value!); + } + this.map.set(hash, this.index); + if (hmac !== null) { + this.hmacs.add(hmac); + } + + if (this.index >= this.xorbIndices.length) { + // todo: switch to resize() with modern browsers + const oldXorbIndices = this.xorbIndices; + const oldChunkIndices = this.chunkIndices; + this.xorbIndices = new Int32Array(Math.min(this.xorbIndices.length * CHUNK_CACHE_GROW_FACTOR, this.maxSize)); + this.chunkIndices = new Uint16Array(Math.min(this.chunkIndices.length * CHUNK_CACHE_GROW_FACTOR, this.maxSize)); + this.xorbIndices.set(oldXorbIndices); + this.chunkIndices.set(oldChunkIndices); + } + + this.xorbIndices[this.index] = xorbIndex; + this.chunkIndices[this.index] = chunkIndex; + this.index = (this.index + 1) % this.maxSize; + } + + getChunk( + hash: string, + /** + * Set to null if you only want to check against locally created chunks, or the hash is already a hmac + */ + hmacFunction: ((hash: string, key: string) => string) | null, + ): + | { + xorbIndex: number; + chunkIndex: number; + } + | undefined { + let index = this.map.get(hash); + if (index === undefined && hmacFunction !== null) { + for (const hmac of this.hmacs) { + index = this.map.get(hmacFunction(hash, hmac)); + if (index !== undefined) { + break; + } + } + } + if (index === undefined) { + return undefined; + } + return { + xorbIndex: this.xorbIndices[index], + chunkIndex: this.chunkIndices[index], + }; + } + + updateChunkIndex(hash: string, chunkIndex: number): void { + const index = this.map.get(hash); + if (index === undefined) { + throw new Error(`Chunk not found in cache: ${hash}`); + } + this.chunkIndices[index] = chunkIndex; + } + + removeChunkFromCache(hash: string): void { + this.map.delete(hash); + } +} diff --git a/node_modules/@huggingface/hub/src/utils/FileBlob.spec.ts b/node_modules/@huggingface/hub/src/utils/FileBlob.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..2ed51d8e38e817bc69d0924e3f4b47885e85c5d9 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/FileBlob.spec.ts @@ -0,0 +1,45 @@ +import { open, stat } from "node:fs/promises"; +import { TextDecoder } from "node:util"; +import { describe, expect, it } from "vitest"; +import { FileBlob } from "./FileBlob"; + +describe("FileBlob", () => { + it("should create a FileBlob with a slice on the entire file", async () => { + const file = await open("package.json", "r"); + const { size } = await stat("package.json"); + + const fileBlob = await FileBlob.create("package.json"); + + expect(fileBlob).toMatchObject({ + path: "package.json", + start: 0, + end: size, + }); + expect(fileBlob.size).toBe(size); + expect(fileBlob.type).toBe(""); + const text = await fileBlob.text(); + const expectedText = (await file.read(Buffer.alloc(size), 0, size)).buffer.toString("utf8"); + expect(text).toBe(expectedText); + const result = await fileBlob.stream().getReader().read(); + expect(new TextDecoder().decode(result.value)).toBe(expectedText); + }); + + it("should create a slice on the file", async () => { + const file = await open("package.json", "r"); + const fileBlob = await FileBlob.create("package.json"); + + const slice = fileBlob.slice(10, 20); + + expect(slice).toMatchObject({ + path: "package.json", + start: 10, + end: 20, + }); + expect(slice.size).toBe(10); + const sliceText = await slice.text(); + const expectedText = (await file.read(Buffer.alloc(10), 0, 10, 10)).buffer.toString("utf8"); + expect(sliceText).toBe(expectedText); + const result = await slice.stream().getReader().read(); + expect(new TextDecoder().decode(result.value)).toBe(expectedText); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/FileBlob.ts b/node_modules/@huggingface/hub/src/utils/FileBlob.ts new file mode 100644 index 0000000000000000000000000000000000000000..504efcf6ed7ae89a5b4ef957072377ebb8a10045 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/FileBlob.ts @@ -0,0 +1,122 @@ +import { createReadStream } from "node:fs"; +import { open, stat } from "node:fs/promises"; +import { Readable } from "node:stream"; +import type { FileHandle } from "node:fs/promises"; +import { fileURLToPath } from "node:url"; + +/** + * @internal + * + * A FileBlob is a replacement for the Blob class that allows to lazy read files + * in order to preserve memory. + * + * It is a drop-in replacement for the Blob class, so you can use it as a Blob. + * + * The main difference is the instantiation, which is done asynchronously using the `FileBlob.create` method. + * + * @example + * const fileBlob = await FileBlob.create("path/to/package.json"); + * + * await fetch("https://aschen.tech", { method: "POST", body: fileBlob }); + */ +export class FileBlob extends Blob { + /** + * Creates a new FileBlob on the provided file. + * + * @param path Path to the file to be lazy readed + */ + static async create(path: string | URL): Promise { + path = path instanceof URL ? fileURLToPath(path) : path; + + const { size } = await stat(path); + + const fileBlob = new FileBlob(path, 0, size); + + return fileBlob; + } + + private path: string; + private start: number; + private end: number; + + private constructor(path: string, start: number, end: number) { + super(); + + this.path = path; + this.start = start; + this.end = end; + } + + /** + * Returns the size of the blob. + */ + override get size(): number { + return this.end - this.start; + } + + /** + * Returns a new instance of FileBlob that is a slice of the current one. + * + * The slice is inclusive of the start and exclusive of the end. + * + * The slice method does not supports negative start/end. + * + * @param start beginning of the slice + * @param end end of the slice + */ + override slice(start = 0, end = this.size): FileBlob { + if (start < 0 || end < 0) { + new TypeError("Unsupported negative start/end on FileBlob.slice"); + } + + const slice = new FileBlob(this.path, this.start + start, Math.min(this.start + end, this.end)); + + return slice; + } + + /** + * Read the part of the file delimited by the FileBlob and returns it as an ArrayBuffer. + */ + override async arrayBuffer(): Promise { + const slice = await this.execute((file) => file.read(Buffer.alloc(this.size), 0, this.size, this.start)); + + return slice.buffer; + } + + /** + * Read the part of the file delimited by the FileBlob and returns it as a string. + */ + override async text(): Promise { + const buffer = (await this.arrayBuffer()) as Buffer; + + return buffer.toString("utf8"); + } + + /** + * Returns a stream around the part of the file delimited by the FileBlob. + */ + override stream(): ReturnType { + if (this.start === this.end) { + return new Blob([]).stream(); + } + + return Readable.toWeb(createReadStream(this.path, { start: this.start, end: this.end - 1 })) as ReturnType< + Blob["stream"] + >; + } + + /** + * We are opening and closing the file for each action to prevent file descriptor leaks. + * + * It is an intended choice of developer experience over performances. + */ + private async execute(action: (file: FileHandle) => Promise) { + const file = await open(this.path, "r"); + + try { + return await action(file); + } finally { + await file.close(); + } + } +} diff --git a/node_modules/@huggingface/hub/src/utils/RangeList.spec.ts b/node_modules/@huggingface/hub/src/utils/RangeList.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..e05f85a8fa14b41b2c4549738dd9b8d67e5b30f1 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/RangeList.spec.ts @@ -0,0 +1,96 @@ +import { describe, it, expect } from "vitest"; +import { RangeList } from "./RangeList"; + +describe("RangeList", () => { + it("should add a single range", () => { + const rangeList = new RangeList(); + rangeList.add(1, 100); + + const ranges = rangeList.getAllRanges(); + expect(ranges).toHaveLength(1); + expect(ranges[0]).toEqual({ + start: 1, + end: 100, + refCount: 1, + data: null, + }); + }); + + it("should handle overlapping ranges", () => { + const rangeList = new RangeList(); + rangeList.add(1, 100); + rangeList.add(30, 50); + + const ranges = rangeList.getAllRanges(); + expect(ranges).toHaveLength(3); + expect(ranges).toEqual([ + { start: 1, end: 30, refCount: 1, data: null }, + { start: 30, end: 50, refCount: 2, data: null }, + { start: 50, end: 100, refCount: 1, data: null }, + ]); + }); + + it("should remove a range at existing boundaries", () => { + const rangeList = new RangeList(); + rangeList.add(1, 100); + rangeList.add(30, 50); + rangeList.remove(30, 50); + + const ranges = rangeList.getAllRanges(); + expect(ranges).toHaveLength(3); + expect(ranges).toEqual([ + { start: 1, end: 30, refCount: 1, data: null }, + { start: 30, end: 50, refCount: 1, data: null }, + { start: 50, end: 100, refCount: 1, data: null }, + ]); + }); + + it("should throw error when removing range at non-existing boundaries", () => { + const rangeList = new RangeList(); + rangeList.add(1, 100); + rangeList.add(30, 50); + + expect(() => rangeList.remove(2, 50)).toThrow("Range boundaries must match existing boundaries"); + }); + + it("should get ranges within boundaries", () => { + const rangeList = new RangeList(); + rangeList.add(1, 100); + rangeList.add(30, 50); + + const ranges = rangeList.getRanges(30, 100); + expect(ranges).toHaveLength(2); + expect(ranges).toEqual([ + { start: 30, end: 50, refCount: 2, data: null }, + { start: 50, end: 100, refCount: 1, data: null }, + ]); + }); + + it("should throw error when end is less than or equal to start", () => { + const rangeList = new RangeList(); + + expect(() => rangeList.add(100, 1)).toThrow("End must be greater than start"); + expect(() => rangeList.add(1, 1)).toThrow("End must be greater than start"); + expect(() => rangeList.remove(100, 1)).toThrow("End must be greater than start"); + expect(() => rangeList.remove(1, 1)).toThrow("End must be greater than start"); + expect(() => rangeList.getRanges(100, 1)).toThrow("End must be greater than start"); + expect(() => rangeList.getRanges(1, 1)).toThrow("End must be greater than start"); + }); + + it("should handle multiple overlapping ranges", () => { + const rangeList = new RangeList(); + rangeList.add(1, 100); + rangeList.add(30, 50); + rangeList.add(40, 60); + + const ranges = rangeList.getAllRanges(); + expect(ranges).toHaveLength(5); + expect(ranges).toEqual([ + { start: 1, end: 30, refCount: 1, data: null }, + { start: 30, end: 40, refCount: 2, data: null }, + { start: 40, end: 50, refCount: 3, data: null }, + { start: 50, end: 60, refCount: 2, data: null }, + { start: 60, end: 100, refCount: 1, data: null }, + ]); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/RangeList.ts b/node_modules/@huggingface/hub/src/utils/RangeList.ts new file mode 100644 index 0000000000000000000000000000000000000000..9665500890ee1c34806168707a64e42af7ed8074 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/RangeList.ts @@ -0,0 +1,179 @@ +/** + * Code generated with this prompt by Cursor: + * + * I want to build a class to manage ranges + * + * I can add ranges to it with a start& an end (both integer, end > start). It should store those ranges efficiently. + * + * When several ranges overlap, eg [1, 100] and [30, 50], I want the class to split the range into non-overlapping ranges, and add a "ref counter" to the ranges. For example, [1, 30], [30, 50] * 2, [50, 100] + * + * I also want to be able to remove ranges, it will decrease the ref counter or remove the range altogether. I can only remove ranges at existing boundaries. For example, with the [1, 30], [30, 50] * 2, [50, 100] configuration + * + * - removing [1, 100] => the only range remaning is [30, 50] + * - removing [2, 50] => error, because "2' is not a boundary + * - removing [30, 50] => [1, 30], [30, 50], [50, 100] (do not "merge" the ranges back together) + * + * I want to be able to associate data to each range. And I want to be able to get the ranges inside boundaries. For example , with [1, 30], [30, 50] * 2, [50, 100] configuration + * + * - getting [30, 100] => I receive [30, 50] * 2, [50, 100], and I can get / modify the data associated to each range by accessing their data prop. Note the "*2" is just the ref counter, there is onlly one range object for the interval returned + * - getting [2, 50] => I get [30, 50] * 2 + * + * ---- + * + * Could optimize with binary search, but the ranges we want to handle are not that many. + */ +interface Range { + start: number; + end: number; + refCount: number; + data: T | null; +} + +export class RangeList { + private ranges: Range[] = []; + + /** + * Add a range to the list. If it overlaps with existing ranges, + * it will split them and increment reference counts accordingly. + */ + add(start: number, end: number): void { + if (end <= start) { + throw new TypeError("End must be greater than start"); + } + + // Find all ranges that overlap with the new range + const overlappingRanges: { index: number; range: Range }[] = []; + for (let i = 0; i < this.ranges.length; i++) { + const range = this.ranges[i]; + if (start < range.end && end > range.start) { + overlappingRanges.push({ index: i, range }); + } + if (range.data !== null) { + throw new Error("Overlapping range already has data"); + } + } + + if (overlappingRanges.length === 0) { + // No overlaps, just add the new range + this.ranges.push({ start, end, refCount: 1, data: null }); + this.ranges.sort((a, b) => a.start - b.start); + return; + } + + // Handle overlaps by splitting ranges + const newRanges: Range[] = []; + let currentPos = start; + + for (let i = 0; i < overlappingRanges.length; i++) { + const { range } = overlappingRanges[i]; + + // Add range before overlap if exists + if (currentPos < range.start) { + newRanges.push({ + start: currentPos, + end: range.start, + refCount: 1, + data: null, + }); + } else if (range.start < currentPos) { + newRanges.push({ + start: range.start, + end: currentPos, + refCount: range.refCount, + data: null, + }); + } + + // Add overlapping part with increased ref count + newRanges.push({ + start: Math.max(currentPos, range.start), + end: Math.min(end, range.end), + refCount: range.refCount + 1, + data: null, + }); + + // Add remaining part of existing range if exists + if (range.end > end) { + newRanges.push({ + start: end, + end: range.end, + refCount: range.refCount, + data: null, + }); + } + + currentPos = Math.max(currentPos, range.end); + } + + // Add remaining part after last overlap if exists + if (currentPos < end) { + newRanges.push({ + start: currentPos, + end, + refCount: 1, + data: null, + }); + } + + // Remove old overlapping ranges and insert new ones + const firstIndex = overlappingRanges[0].index; + const lastIndex = overlappingRanges[overlappingRanges.length - 1].index; + this.ranges.splice(firstIndex, lastIndex - firstIndex + 1, ...newRanges); + this.ranges.sort((a, b) => a.start - b.start); + } + + /** + * Remove a range from the list. The range must start and end at existing boundaries. + */ + remove(start: number, end: number): void { + if (end <= start) { + throw new TypeError("End must be greater than start"); + } + + // Find ranges that need to be modified + const affectedRanges: { index: number; range: Range }[] = []; + for (let i = 0; i < this.ranges.length; i++) { + const range = this.ranges[i]; + if (start < range.end && end > range.start) { + affectedRanges.push({ index: i, range }); + } + } + + if (affectedRanges.length === 0) { + throw new Error("No ranges found to remove"); + } + + // Verify boundaries match + if (start !== affectedRanges[0].range.start || end !== affectedRanges[affectedRanges.length - 1].range.end) { + throw new Error("Range boundaries must match existing boundaries"); + } + + // Todo: also check if there's a gap in the middle but it should not happen with our usage + + for (let i = 0; i < affectedRanges.length; i++) { + const { range } = affectedRanges[i]; + + range.refCount--; + } + + this.ranges = this.ranges.filter((range) => range.refCount > 0); + } + + /** + * Get all ranges within the specified boundaries. + */ + getRanges(start: number, end: number): Range[] { + if (end <= start) { + throw new TypeError("End must be greater than start"); + } + + return this.ranges.filter((range) => start < range.end && end > range.start); + } + + /** + * Get all ranges in the list + */ + getAllRanges(): Range[] { + return [...this.ranges]; + } +} diff --git a/node_modules/@huggingface/hub/src/utils/SplicedBlob.spec.ts b/node_modules/@huggingface/hub/src/utils/SplicedBlob.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..cf8520f15f2d9c7ae37a5df208b31c286da3b622 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/SplicedBlob.spec.ts @@ -0,0 +1,454 @@ +import { describe, expect, it, beforeEach } from "vitest"; +import { SplicedBlob } from "./SplicedBlob"; + +describe("SplicedBlob", () => { + let originalBlob: Blob; + let insertBlob: Blob; + let replaceBlob: Blob; + + beforeEach(() => { + // originalBlob: "0123456789" (10 chars) + originalBlob = new Blob(["0123456789"]); + // insertBlob: "ABC" (3 chars) - used in tests where we insert something into the blob + insertBlob = new Blob(["ABC"]); + // replaceBlob: "XY" (2 chars) - used in tests where part of the blob is replaced + replaceBlob = new Blob(["XY"]); + }); + + describe("create", () => { + it("should create a SplicedBlob with valid parameters", () => { + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + expect(splicedBlob).toBeInstanceOf(SplicedBlob); + }); + + it("should throw error for negative start", () => { + expect(() => SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: -1, end: 5 }])).toThrow( + "Invalid start/end positions for SplicedBlob", + ); + }); + + it("should throw error for negative end", () => { + expect(() => SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: -1 }])).toThrow( + "Invalid start/end positions for SplicedBlob", + ); + }); + + it("should throw error for start > original.size", () => { + expect(() => SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 15, end: 5 }])).toThrow( + "Invalid start/end positions for SplicedBlob", + ); + }); + + it("should throw error for end > original.size", () => { + expect(() => SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 15 }])).toThrow( + "Invalid start/end positions for SplicedBlob", + ); + }); + + it("should throw error for start > end", () => { + expect(() => SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 7, end: 5 }])).toThrow( + "Invalid start/end positions for SplicedBlob", + ); + }); + }); + + describe("size and type", () => { + it("should calculate size correctly for insertion", () => { + // Insert "ABC" at position 5: "01234ABC56789" = 13 chars + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + expect(splicedBlob.size).toBe(13); + }); + + it("should calculate size correctly for replacement", () => { + // Replace "345" with "XY": "012XY6789" = 9 chars + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + expect(splicedBlob.size).toBe(9); + }); + + it("should return original blob type", () => { + const typedBlob = new Blob(["test"], { type: "text/plain" }); + const splicedBlob = SplicedBlob.create(typedBlob, [{ insert: insertBlob, start: 2, end: 2 }]); + expect(splicedBlob.type).toBe("text/plain"); + }); + }); + + describe("text method", () => { + it("should insert at beginning", async () => { + // Insert "ABC" at start: "ABC0123456789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 0, end: 0 }]); + const text = await splicedBlob.text(); + expect(text).toBe("ABC0123456789"); + }); + + it("should insert at end", async () => { + // Insert "ABC" at end: "0123456789ABC" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 10, end: 10 }]); + const text = await splicedBlob.text(); + expect(text).toBe("0123456789ABC"); + }); + + it("should insert in middle", async () => { + // Insert "ABC" at position 5: "01234ABC56789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const text = await splicedBlob.text(); + expect(text).toBe("01234ABC56789"); + }); + + it("should replace content", async () => { + // Replace "345" with "XY": "012XY6789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const text = await splicedBlob.text(); + expect(text).toBe("012XY6789"); + }); + + it("should replace everything", async () => { + // Replace entire content with "ABC": "ABC" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 0, end: 10 }]); + const text = await splicedBlob.text(); + expect(text).toBe("ABC"); + }); + }); + + describe("slice method - basic cases", () => { + it("should return empty blob for start >= end", async () => { + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(5, 5); + expect(slice.size).toBe(0); + expect(await slice.text()).toBe(""); + }); + + it("should handle slice beyond size", async () => { + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(10, 20); + const text = await slice.text(); + expect(text).toBe("789"); // Only gets what's available + }); + + it("should throw error for negative start/end", () => { + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + expect(() => splicedBlob.slice(-1, 5)).toThrow("Unsupported negative start/end on SplicedBlob.slice"); + expect(() => splicedBlob.slice(0, -1)).toThrow("Unsupported negative start/end on SplicedBlob.slice"); + }); + }); + + describe("slice method - before segment only", () => { + it("should slice entirely in before segment", async () => { + // SplicedBlob: "01234ABC56789", slice(1, 4) = "123" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(1, 4); + const text = await slice.text(); + expect(text).toBe("123"); + }); + + it("should slice from start of before segment", async () => { + // SplicedBlob: "01234ABC56789", slice(0, 3) = "012" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(0, 3); + const text = await slice.text(); + expect(text).toBe("012"); + }); + + it("should slice to end of before segment", async () => { + // SplicedBlob: "01234ABC56789", slice(2, 5) = "234" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(2, 5); + const text = await slice.text(); + expect(text).toBe("234"); + }); + }); + + describe("slice method - insert segment only", () => { + it("should slice entirely in insert segment", async () => { + // SplicedBlob: "01234ABC56789", slice(6, 7) = "B" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(6, 7); + const text = await slice.text(); + expect(text).toBe("B"); + }); + + it("should slice entire insert segment", async () => { + // SplicedBlob: "01234ABC56789", slice(5, 8) = "ABC" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(5, 8); + const text = await slice.text(); + expect(text).toBe("ABC"); + }); + + it("should slice from start of insert segment", async () => { + // SplicedBlob: "01234ABC56789", slice(5, 7) = "AB" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(5, 7); + const text = await slice.text(); + expect(text).toBe("AB"); + }); + + it("should slice to end of insert segment", async () => { + // SplicedBlob: "01234ABC56789", slice(6, 8) = "BC" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(6, 8); + const text = await slice.text(); + expect(text).toBe("BC"); + }); + }); + + describe("slice method - after segment only", () => { + it("should slice entirely in after segment", async () => { + // SplicedBlob: "01234ABC56789", slice(9, 12) = "678" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(9, 12); + const text = await slice.text(); + expect(text).toBe("678"); + }); + + it("should slice from start of after segment", async () => { + // SplicedBlob: "01234ABC56789", slice(8, 11) = "567" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(8, 11); + const text = await slice.text(); + expect(text).toBe("567"); + }); + + it("should slice to end of after segment", async () => { + // SplicedBlob: "01234ABC56789", slice(10, 13) = "789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(10, 13); + const text = await slice.text(); + expect(text).toBe("789"); + }); + }); + + describe("slice method - spanning before and insert", () => { + it("should slice spanning before and insert segments", async () => { + // SplicedBlob: "01234ABC56789", slice(3, 7) = "34AB" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(3, 7); + const text = await slice.text(); + expect(text).toBe("34AB"); + }); + + it("should slice from start spanning before and insert", async () => { + // SplicedBlob: "01234ABC56789", slice(0, 6) = "01234A" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(0, 6); + const text = await slice.text(); + expect(text).toBe("01234A"); + }); + + it("should slice to end of insert spanning before and insert", async () => { + // SplicedBlob: "01234ABC56789", slice(4, 8) = "4ABC" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(4, 8); + const text = await slice.text(); + expect(text).toBe("4ABC"); + }); + }); + + describe("slice method - spanning insert and after", () => { + it("should slice spanning insert and after segments", async () => { + // SplicedBlob: "01234ABC56789", slice(6, 10) = "BC56" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(6, 10); + const text = await slice.text(); + expect(text).toBe("BC56"); + }); + + it("should slice from start of insert to end", async () => { + // SplicedBlob: "01234ABC56789", slice(5, 13) = "ABC56789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(5, 13); + const text = await slice.text(); + expect(text).toBe("ABC56789"); + }); + + it("should slice from middle of insert spanning to after", async () => { + // SplicedBlob: "01234ABC56789", slice(7, 11) = "C567" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(7, 11); + const text = await slice.text(); + expect(text).toBe("C567"); + }); + }); + + describe("slice method - spanning all three segments", () => { + it("should slice spanning all three segments", async () => { + // SplicedBlob: "01234ABC56789", slice(3, 10) = "34ABC56" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(3, 10); + const text = await slice.text(); + expect(text).toBe("34ABC56"); + }); + + it("should slice entire spliced blob", async () => { + // SplicedBlob: "01234ABC56789", slice(0, 13) = "01234ABC56789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(0, 13); + const text = await slice.text(); + expect(text).toBe("01234ABC56789"); + }); + + it("should slice most of spliced blob", async () => { + // SplicedBlob: "01234ABC56789", slice(1, 12) = "1234ABC5678" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice = splicedBlob.slice(1, 12); + const text = await slice.text(); + expect(text).toBe("1234ABC5678"); + }); + }); + + describe("slice method - with replacement", () => { + it("should slice before replacement", async () => { + // Replace "345" with "XY": "012XY6789", slice(0, 3) = "012" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const slice = splicedBlob.slice(0, 3); + const text = await slice.text(); + expect(text).toBe("012"); + }); + + it("should slice replacement only", async () => { + // Replace "345" with "XY": "012XY6789", slice(3, 5) = "XY" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const slice = splicedBlob.slice(3, 5); + const text = await slice.text(); + expect(text).toBe("XY"); + }); + + it("should slice after replacement", async () => { + // Replace "345" with "XY": "012XY6789", slice(5, 9) = "6789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const slice = splicedBlob.slice(5, 9); + const text = await slice.text(); + expect(text).toBe("6789"); + }); + + it("should slice spanning before and replacement", async () => { + // Replace "345" with "XY": "012XY6789", slice(1, 4) = "12X" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const slice = splicedBlob.slice(1, 4); + const text = await slice.text(); + expect(text).toBe("12X"); + }); + + it("should slice spanning replacement and after", async () => { + // Replace "345" with "XY": "012XY6789", slice(4, 7) = "Y67" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const slice = splicedBlob.slice(4, 7); + const text = await slice.text(); + expect(text).toBe("Y67"); + }); + + it("should slice spanning all segments with replacement", async () => { + // Replace "345" with "XY": "012XY6789", slice(1, 8) = "12XY678" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const slice = splicedBlob.slice(1, 8); + const text = await slice.text(); + expect(text).toBe("12XY678"); + }); + }); + + describe("slice method - edge cases", () => { + it("should handle empty insert blob", async () => { + const emptyBlob = new Blob([""]); + // Replace "345" with "": "0126789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: emptyBlob, start: 3, end: 6 }]); + const text = await splicedBlob.text(); + expect(text).toBe("0126789"); + + const slice = splicedBlob.slice(2, 5); + expect(await slice.text()).toBe("267"); + }); + + it("should handle slice at segment boundaries", async () => { + // SplicedBlob: "01234ABC56789", exact boundary slices + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + + // End of before segment + expect(await splicedBlob.slice(4, 5).text()).toBe("4"); + // Start of insert segment + expect(await splicedBlob.slice(5, 6).text()).toBe("A"); + // End of insert segment + expect(await splicedBlob.slice(7, 8).text()).toBe("C"); + // Start of after segment + expect(await splicedBlob.slice(8, 9).text()).toBe("5"); + }); + + it("should handle insert at beginning with slice", async () => { + // Insert "ABC" at start: "ABC0123456789" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 0, end: 0 }]); + const slice = splicedBlob.slice(1, 5); + expect(await slice.text()).toBe("BC01"); + }); + + it("should handle insert at end with slice", async () => { + // Insert "ABC" at end: "0123456789ABC" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 10, end: 10 }]); + const slice = splicedBlob.slice(8, 12); + expect(await slice.text()).toBe("89AB"); + }); + }); + + describe("arrayBuffer method", () => { + it("should return correct ArrayBuffer for insertion", async () => { + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const buffer = await splicedBlob.arrayBuffer(); + const text = new TextDecoder().decode(buffer); + expect(text).toBe("01234ABC56789"); + expect(buffer.byteLength).toBe(13); + }); + + it("should return correct ArrayBuffer for replacement", async () => { + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const buffer = await splicedBlob.arrayBuffer(); + const text = new TextDecoder().decode(buffer); + expect(text).toBe("012XY6789"); + expect(buffer.byteLength).toBe(9); + }); + }); + + describe("stream method", () => { + it("should return correct stream for insertion", async () => { + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const stream = splicedBlob.stream(); + const response = new Response(stream); + const text = await response.text(); + expect(text).toBe("01234ABC56789"); + }); + + it("should return correct stream for replacement", async () => { + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: replaceBlob, start: 3, end: 6 }]); + const stream = splicedBlob.stream(); + const response = new Response(stream); + const text = await response.text(); + expect(text).toBe("012XY6789"); + }); + + it("should handle empty segments in stream", async () => { + const emptyBlob = new Blob([""]); + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: emptyBlob, start: 5, end: 5 }]); + const stream = splicedBlob.stream(); + const response = new Response(stream); + const text = await response.text(); + expect(text).toBe("0123456789"); + }); + }); + + describe("nested slicing", () => { + it("should allow slicing of sliced blob", async () => { + // SplicedBlob: "01234ABC56789", slice(3, 10) = "34ABC56", then slice(2, 5) = "ABC" + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const firstSlice = splicedBlob.slice(3, 10); + const secondSlice = firstSlice.slice(2, 5); + const text = await secondSlice.text(); + expect(text).toBe("ABC"); + }); + + it("should handle multiple levels of slicing", async () => { + // Complex slicing chain + const splicedBlob = SplicedBlob.create(originalBlob, [{ insert: insertBlob, start: 5, end: 5 }]); + const slice1 = splicedBlob.slice(2, 11); // "234ABC567" + const slice2 = slice1.slice(1, 7); // "34ABC5" + const slice3 = slice2.slice(2, 5); // "ABC" + const text = await slice3.text(); + expect(text).toBe("ABC"); + }); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/SplicedBlob.ts b/node_modules/@huggingface/hub/src/utils/SplicedBlob.ts new file mode 100644 index 0000000000000000000000000000000000000000..28877bcc47b7efb17024371d13ee1e04dd2e9e23 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/SplicedBlob.ts @@ -0,0 +1,246 @@ +import { sum } from "./sum"; + +/** + * Represents a single splice operation + */ +interface SpliceOperation { + insert: Blob; + start: number; + end: number; +} + +/** + * @internal + * + * A SplicedBlob is a Blob that represents the result of splicing one or more insert blobs + * into an original blob at specified positions, replacing content between start and end. + * + * It is a drop-in replacement for the Blob class, so you can use it as a Blob. + * The splicing is done virtually without copying data until accessed. + * + * @example + * const originalBlob = new Blob(["Hello, World!"]); + * const insertBlob = new Blob(["Beautiful "]); + * const splicedBlob = SplicedBlob.create(originalBlob, insertBlob, 7, 7); + * // Result represents: "Hello, Beautiful World!" + */ +export class SplicedBlob extends Blob { + public originalBlob: Blob; + public spliceOperations: SpliceOperation[]; + + private constructor(originalBlob: Blob, spliceOperations: SpliceOperation[]) { + super(); + + this.originalBlob = originalBlob; + this.spliceOperations = spliceOperations; // Create a copy to prevent external mutation + } + + static create(originalBlob: Blob, operations: SpliceOperation[]): SplicedBlob { + // Validate all operations + for (const op of operations) { + if (op.start < 0 || op.end < 0) { + throw new Error("Invalid start/end positions for SplicedBlob"); + } + if (op.start > originalBlob.size || op.end > originalBlob.size) { + throw new Error("Invalid start/end positions for SplicedBlob"); + } + if (op.start > op.end) { + throw new Error("Invalid start/end positions for SplicedBlob"); + } + } + + // Sort operations by start position and validate no overlaps + const sortedOps = [...operations].sort((a, b) => a.start - b.start); + for (let i = 0; i < sortedOps.length - 1; i++) { + if (sortedOps[i].end > sortedOps[i + 1].start) { + throw new Error("Overlapping splice operations are not supported"); + } + } + + return new SplicedBlob(originalBlob, sortedOps); + } + + /** + * Returns the size of the spliced blob. + * Size = original size - total replaced size + total insert size + */ + override get size(): number { + let totalReplacedSize = 0; + let totalInsertSize = 0; + + for (const op of this.spliceOperations) { + totalReplacedSize += op.end - op.start; + totalInsertSize += op.insert.size; + } + + return this.originalBlob.size - totalReplacedSize + totalInsertSize; + } + + /** + * Returns the MIME type of the original blob. + */ + override get type(): string { + return this.originalBlob.type; + } + + /** + * Returns a new instance of SplicedBlob that is a slice of the current one. + * + * The slice is inclusive of the start and exclusive of the end. + * The slice method does not support negative start/end. + * + * @param start beginning of the slice + * @param end end of the slice + */ + override slice(start = 0, end = this.size): Blob { + if (start < 0 || end < 0) { + throw new TypeError("Unsupported negative start/end on SplicedBlob.slice"); + } + + start = Math.min(start, this.size); + end = Math.min(end, this.size); + + if (start >= end) { + return new Blob([]); + } + + // Get all segments and calculate their cumulative positions + const segments = this.segments; + const segmentBoundaries: number[] = [0]; + let cumulativeSize = 0; + + for (const segment of segments) { + cumulativeSize += segment.size; + segmentBoundaries.push(cumulativeSize); + } + + // Find which segments the slice spans + const resultSegments: Blob[] = []; + + for (let i = 0; i < segments.length; i++) { + const segmentStart = segmentBoundaries[i]; + const segmentEnd = segmentBoundaries[i + 1]; + + // Skip segments that are entirely before the slice + if (segmentEnd <= start) { + continue; + } + + // Skip segments that are entirely after the slice + if (segmentStart >= end) { + break; + } + + // Calculate slice bounds within this segment + const sliceStart = Math.max(0, start - segmentStart); + const sliceEnd = Math.min(segments[i].size, end - segmentStart); + + if (sliceStart < sliceEnd) { + resultSegments.push(segments[i].slice(sliceStart, sliceEnd)); + } + } + + return new Blob(resultSegments); + } + + get firstSpliceIndex(): number { + return this.spliceOperations[0]?.start ?? Infinity; + } + + /** + * Read the spliced blob content and returns it as an ArrayBuffer. + */ + override async arrayBuffer(): Promise { + const segments = this.segments; + const buffers = await Promise.all(segments.map((segment) => segment.arrayBuffer())); + + // Concatenate all buffers + const totalSize = sum(buffers.map((buffer) => buffer.byteLength)); + const result = new Uint8Array(totalSize); + + let offset = 0; + for (const buffer of buffers) { + result.set(new Uint8Array(buffer), offset); + offset += buffer.byteLength; + } + + return result.buffer; + } + + /** + * Read the spliced blob content and returns it as a string. + */ + override async text(): Promise { + const buffer = await this.arrayBuffer(); + return new TextDecoder().decode(buffer); + } + + /** + * Returns a stream around the spliced blob content. + */ + override stream(): ReturnType { + const readable = new ReadableStream({ + start: async (controller) => { + try { + const segments = this.segments; + + for (const segment of segments) { + const reader = segment.stream().getReader(); + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + controller.enqueue(value); + } + } finally { + reader.releaseLock(); + } + } + + controller.close(); + } catch (error) { + controller.error(error); + } + }, + }); + + return readable; + } + + /** + * Get all segments that make up the spliced blob. + * This includes original blob segments between splice operations and insert blobs. + */ + private get segments(): Blob[] { + const segments: Blob[] = []; + let currentPosition = 0; + + // Sort operations by start position to ensure correct order + const sortedOps = [...this.spliceOperations].sort((a, b) => a.start - b.start); + + for (const op of sortedOps) { + // Add segment from current position to start of this operation + if (currentPosition < op.start) { + segments.push(this.originalBlob.slice(currentPosition, op.start)); + } + + // Add the insert blob (if it has content) + if (op.insert.size > 0) { + segments.push(op.insert); + } + + // Move current position to end of this operation + currentPosition = op.end; + } + + // Add remaining segment after last operation + if (currentPosition < this.originalBlob.size) { + segments.push(this.originalBlob.slice(currentPosition)); + } + + return segments; + } +} diff --git a/node_modules/@huggingface/hub/src/utils/WebBlob.spec.ts b/node_modules/@huggingface/hub/src/utils/WebBlob.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..242a51e08eddd94fbf49b6858cf5b0d9db081b41 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/WebBlob.spec.ts @@ -0,0 +1,95 @@ +import { describe, expect, it, beforeAll } from "vitest"; +import { WebBlob } from "./WebBlob"; + +describe("WebBlob", () => { + const resourceUrl = new URL("https://huggingface.co/spaces/aschen/push-model-from-web/raw/main/mobilenet/model.json"); + let fullText: string; + let size: number; + let contentType: string; + + beforeAll(async () => { + const response = await fetch(resourceUrl, { method: "HEAD" }); + size = Number(response.headers.get("content-length")); + contentType = response.headers.get("content-type") || ""; + fullText = await (await fetch(resourceUrl)).text(); + }); + + it("should create a WebBlob with a slice on the entire resource", async () => { + const webBlob = await WebBlob.create(resourceUrl, { cacheBelow: 0, accessToken: undefined }); + + expect(webBlob).toMatchObject({ + url: resourceUrl, + start: 0, + end: size, + contentType, + }); + expect(webBlob).toBeInstanceOf(WebBlob); + expect(webBlob.size).toBe(size); + expect(webBlob.type).toBe(contentType); + + const text = await webBlob.text(); + expect(text).toBe(fullText); + + const streamText = await new Response(webBlob.stream()).text(); + expect(streamText).toBe(fullText); + }); + + it("should create a WebBlob with a slice on the entire resource, cached", async () => { + const webBlob = await WebBlob.create(resourceUrl, { cacheBelow: 1_000_000, accessToken: undefined }); + + expect(webBlob).not.toBeInstanceOf(WebBlob); + expect(webBlob.size).toBe(size); + expect(webBlob.type.replace(/;\s*charset=utf-8/, "")).toBe(contentType.replace(/;\s*charset=utf-8/, "")); + + const text = await webBlob.text(); + expect(text).toBe(fullText); + + const streamText = await new Response(webBlob.stream()).text(); + expect(streamText).toBe(fullText); + }); + + it("should lazy load a LFS file hosted on Hugging Face", async () => { + const zephyrUrl = + "https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha/resolve/main/model-00001-of-00008.safetensors"; + const url = new URL(zephyrUrl); + const webBlob = await WebBlob.create(url); + + expect(webBlob.size).toBe(1_889_587_040); + expect(webBlob).toBeInstanceOf(WebBlob); + expect(webBlob).toMatchObject({ url }); + expect(await webBlob.slice(10, 22).text()).toBe("__metadata__"); + }); + + it("should lazy load a Xet file hosted on Hugging Face", async () => { + const stableDiffusionUrl = + "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/unet/diffusion_pytorch_model.fp16.safetensors"; + const url = new URL(stableDiffusionUrl); + const webBlob = await WebBlob.create(url); + + expect(webBlob.size).toBe(5_135_149_760); + expect(webBlob).toBeInstanceOf(WebBlob); + expect(webBlob).toMatchObject({ url }); + expect(await webBlob.slice(10, 22).text()).toBe("__metadata__"); + }); + + it("should create a slice on the file", async () => { + const expectedText = fullText.slice(10, 20); + + const slice = (await WebBlob.create(resourceUrl, { cacheBelow: 0, accessToken: undefined })).slice(10, 20); + + expect(slice).toMatchObject({ + url: resourceUrl, + start: 10, + end: 20, + contentType, + }); + expect(slice.size).toBe(10); + expect(slice.type).toBe(contentType); + + const sliceText = await slice.text(); + expect(sliceText).toBe(expectedText); + + const streamText = await new Response(slice.stream()).text(); + expect(streamText).toBe(expectedText); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/WebBlob.ts b/node_modules/@huggingface/hub/src/utils/WebBlob.ts new file mode 100644 index 0000000000000000000000000000000000000000..f46db177c7444db80c15225c923dd5d3e8f370e4 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/WebBlob.ts @@ -0,0 +1,139 @@ +/** + * WebBlob is a Blob implementation for web resources that supports range requests. + */ + +import { createApiError } from "../error"; + +interface WebBlobCreateOptions { + /** + * @default 1_000_000 + * + * Objects below that size will immediately be fetched and put in RAM, rather + * than streamed ad-hoc + */ + cacheBelow?: number; + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + accessToken: string | undefined; +} + +export class WebBlob extends Blob { + static async create(url: URL, opts?: WebBlobCreateOptions): Promise { + const customFetch = opts?.fetch ?? fetch; + const response = await customFetch(url, { + method: "HEAD", + ...(opts?.accessToken && { + headers: { + Authorization: `Bearer ${opts.accessToken}`, + }, + }), + }); + + const size = Number(response.headers.get("content-length")); + const contentType = response.headers.get("content-type") || ""; + const supportRange = response.headers.get("accept-ranges") === "bytes"; + + if (!supportRange || size < (opts?.cacheBelow ?? 1_000_000)) { + return await (await customFetch(url)).blob(); + } + + return new WebBlob(url, 0, size, contentType, true, customFetch, opts?.accessToken); + } + + private url: URL; + private start: number; + private end: number; + private contentType: string; + private full: boolean; + private fetch: typeof fetch; + private accessToken: string | undefined; + + constructor( + url: URL, + start: number, + end: number, + contentType: string, + full: boolean, + customFetch: typeof fetch, + accessToken: string | undefined, + ) { + super([]); + + this.url = url; + this.start = start; + this.end = end; + this.contentType = contentType; + this.full = full; + this.fetch = customFetch; + this.accessToken = accessToken; + } + + override get size(): number { + return this.end - this.start; + } + + override get type(): string { + return this.contentType; + } + + override slice(start = 0, end = this.size): WebBlob { + if (start < 0 || end < 0) { + new TypeError("Unsupported negative start/end on WebBlob.slice"); + } + + const slice = new WebBlob( + this.url, + this.start + start, + Math.min(this.start + end, this.end), + this.contentType, + start === 0 && end === this.size ? this.full : false, + this.fetch, + this.accessToken, + ); + + return slice; + } + + override async arrayBuffer(): Promise { + const result = await this.fetchRange(); + + return result.arrayBuffer(); + } + + override async text(): Promise { + const result = await this.fetchRange(); + + return result.text(); + } + + override stream(): ReturnType { + const stream = new TransformStream(); + + this.fetchRange() + .then((response) => response.body?.pipeThrough(stream)) + .catch((error) => stream.writable.abort(error.message)); + + return stream.readable; + } + + private fetchRange(): Promise { + const fetch = this.fetch; // to avoid this.fetch() which is bound to the instance instead of globalThis + if (this.full) { + return fetch(this.url, { + ...(this.accessToken && { + headers: { + Authorization: `Bearer ${this.accessToken}`, + }, + }), + }).then((resp) => (resp.ok ? resp : createApiError(resp))); + } + return fetch(this.url, { + headers: { + Range: `bytes=${this.start}-${this.end - 1}`, + ...(this.accessToken && { Authorization: `Bearer ${this.accessToken}` }), + }, + }).then((resp) => (resp.ok ? resp : createApiError(resp))); + } +} diff --git a/node_modules/@huggingface/hub/src/utils/XetBlob.spec.ts b/node_modules/@huggingface/hub/src/utils/XetBlob.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..7392c33b0eee36753e7f883865779cda10432f94 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/XetBlob.spec.ts @@ -0,0 +1,924 @@ +import { describe, expect, it } from "vitest"; +import type { ReconstructionInfo } from "./XetBlob"; +import { bg4_regroup_bytes, bg4_split_bytes, XetBlob } from "./XetBlob"; +import { sum } from "./sum"; + +describe("XetBlob", () => { + it("should lazy load the first 22 bytes", async () => { + const blob = new XetBlob({ + hash: "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b", + size: 5_234_139_343, + refreshUrl: "https://huggingface.co/api/models/celinah/xet-experiments/xet-read-token/main", + }); + + expect(await blob.slice(10, 22).text()).toBe("__metadata__"); + }); + + it("should load the first chunk correctly", async () => { + let xorbCount = 0; + const blob = new XetBlob({ + refreshUrl: "https://huggingface.co/api/models/celinah/xet-experiments/xet-read-token/main", + hash: "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b", + size: 5_234_139_343, + fetch: async (url, opts) => { + if (typeof url === "string" && url.includes("/xorbs/")) { + xorbCount++; + } + return fetch(url, opts); + }, + }); + + const xetDownload = await blob.slice(0, 29928).arrayBuffer(); + const bridgeDownload = await fetch( + "https://huggingface.co/celinah/xet-experiments/resolve/main/model5GB.safetensors", + { + headers: { + Range: "bytes=0-29927", + }, + }, + ).then((res) => res.arrayBuffer()); + + expect(new Uint8Array(xetDownload)).toEqual(new Uint8Array(bridgeDownload)); + expect(xorbCount).toBe(1); + }); + + it("should load just past the first chunk correctly", async () => { + let xorbCount = 0; + const blob = new XetBlob({ + refreshUrl: "https://huggingface.co/api/models/celinah/xet-experiments/xet-read-token/main", + hash: "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b", + size: 5_234_139_343, + fetch: async (url, opts) => { + if (typeof url === "string" && url.includes("/xorbs/")) { + xorbCount++; + } + return fetch(url, opts); + }, + }); + + const xetDownload = await blob.slice(0, 29929).arrayBuffer(); + const bridgeDownload = await fetch( + "https://huggingface.co/celinah/xet-experiments/resolve/main/model5GB.safetensors", + { + headers: { + Range: "bytes=0-29928", + }, + }, + ).then((res) => res.arrayBuffer()); + + expect(xetDownload.byteLength).toBe(29929); + expect(new Uint8Array(xetDownload)).toEqual(new Uint8Array(bridgeDownload)); + expect(xorbCount).toBe(2); + }); + + it("should load the first 200kB correctly", async () => { + let xorbCount = 0; + const blob = new XetBlob({ + refreshUrl: "https://huggingface.co/api/models/celinah/xet-experiments/xet-read-token/main", + hash: "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b", + size: 5_234_139_343, + fetch: async (url, opts) => { + if (typeof url === "string" && url.includes("/xorbs/")) { + xorbCount++; + } + return fetch(url, opts); + }, + // internalLogging: true, + }); + + const xetDownload = await blob.slice(0, 200_000).arrayBuffer(); + const bridgeDownload = await fetch( + "https://huggingface.co/celinah/xet-experiments/resolve/main/model5GB.safetensors", + { + headers: { + Range: "bytes=0-199999", + }, + }, + ).then((res) => res.arrayBuffer()); + + expect(xetDownload.byteLength).toBe(200_000); + expect(new Uint8Array(xetDownload)).toEqual(new Uint8Array(bridgeDownload)); + expect(xorbCount).toBe(2); + }, 60_000); + + it("should load correctly when loading far into a chunk range", async () => { + const blob = new XetBlob({ + refreshUrl: "https://huggingface.co/api/models/celinah/xet-experiments/xet-read-token/main", + hash: "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b", + size: 5_234_139_343, + // internalLogging: true, + }); + + const xetDownload = await blob.slice(10_000_000, 10_100_000).arrayBuffer(); + const bridgeDownload = await fetch( + "https://huggingface.co/celinah/xet-experiments/resolve/main/model5GB.safetensors", + { + headers: { + Range: "bytes=10000000-10099999", + }, + }, + ).then((res) => res.arrayBuffer()); + + console.log("xet", xetDownload.byteLength, "bridge", bridgeDownload.byteLength); + expect(new Uint8Array(xetDownload).length).toEqual(100_000); + expect(new Uint8Array(xetDownload)).toEqual(new Uint8Array(bridgeDownload)); + }); + + it("should load text correctly when offset_into_range starts in a chunk further than the first", async () => { + const blob = new XetBlob({ + refreshUrl: "https://huggingface.co/api/models/celinah/xet-experiments/xet-read-token/main", + hash: "794efea76d8cb372bbe1385d9e51c3384555f3281e629903ecb6abeff7d54eec", + size: 62_914_580, + }); + + // Reconstruction info + // { + // "offset_into_first_range": 600000, + // "terms": + // [ + // { + // "hash": "be748f77930d5929cabd510a15f2c30f2f460b639804ef79dea46affa04fd8b2", + // "unpacked_length": 655360, + // "range": { "start": 0, "end": 5 }, + // }, + // { + // "hash": "be748f77930d5929cabd510a15f2c30f2f460b639804ef79dea46affa04fd8b2", + // "unpacked_length": 655360, + // "range": { "start": 0, "end": 5 }, + // }, + // ], + // "fetch_info": + // { + // "be748f77930d5929cabd510a15f2c30f2f460b639804ef79dea46affa04fd8b2": + // [ + // { + // "range": { "start": 0, "end": 5 }, + // "url": "...", + // "url_range": { "start": 0, "end": 2839 }, + // }, + // ], + // }, + // } + + const text = await blob.slice(600_000, 700_000).text(); + const bridgeDownload = await fetch("https://huggingface.co/celinah/xet-experiments/resolve/main/large_text.txt", { + headers: { + Range: "bytes=600000-699999", + }, + }).then((res) => res.text()); + + console.log("xet", text.length, "bridge", bridgeDownload.length); + expect(text.length).toBe(bridgeDownload.length); + }); + + describe("bg4_regoup_bytes", () => { + it("should regroup bytes when the array is %4 length", () => { + expect(bg4_regroup_bytes(new Uint8Array([1, 5, 2, 6, 3, 7, 4, 8]))).toEqual( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]), + ); + }); + + it("should regroup bytes when the array is %4 + 1 length", () => { + expect(bg4_regroup_bytes(new Uint8Array([1, 5, 9, 2, 6, 3, 7, 4, 8]))).toEqual( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + ); + }); + + it("should regroup bytes when the array is %4 + 2 length", () => { + expect(bg4_regroup_bytes(new Uint8Array([1, 5, 9, 2, 6, 10, 3, 7, 4, 8]))).toEqual( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), + ); + }); + + it("should regroup bytes when the array is %4 + 3 length", () => { + expect(bg4_regroup_bytes(new Uint8Array([1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8]))).toEqual( + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]), + ); + }); + }); + + describe("bg4_split_bytes", () => { + it("should split bytes when the array is %4 length", () => { + expect(bg4_split_bytes(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]))).toEqual( + new Uint8Array([1, 5, 2, 6, 3, 7, 4, 8]), + ); + }); + + it("should split bytes when the array is %4 + 1 length", () => { + expect(bg4_split_bytes(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]))).toEqual( + new Uint8Array([1, 5, 9, 2, 6, 3, 7, 4, 8]), + ); + }); + + it("should split bytes when the array is %4 + 2 length", () => { + expect(bg4_split_bytes(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]))).toEqual( + new Uint8Array([1, 5, 9, 2, 6, 10, 3, 7, 4, 8]), + ); + }); + + it("should split bytes when the array is %4 + 3 length", () => { + expect(bg4_split_bytes(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]))).toEqual( + new Uint8Array([1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8]), + ); + }); + + it("should be the inverse of bg4_regroup_bytes", () => { + const testArrays = [ + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]), + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]), + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), + new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]), + new Uint8Array([42]), + new Uint8Array([1, 2]), + new Uint8Array([1, 2, 3]), + ]; + + testArrays.forEach((arr) => { + expect(bg4_regroup_bytes(bg4_split_bytes(arr))).toEqual(arr); + }); + }); + }); + + describe("when mocked", () => { + describe("loading many chunks every read", () => { + it("should load different slices", async () => { + const chunk1Content = "hello"; + const chunk2Content = "world!"; + const debugged: Array<{ event: "read" | string } & Record> = []; + + const chunks = Array(1000) + .fill(0) + .flatMap(() => [makeChunk(chunk1Content), makeChunk(chunk2Content)]); + + const mergedChunks = await new Blob(chunks).arrayBuffer(); + const wholeText = (chunk1Content + chunk2Content).repeat(1000); + + const totalSize = wholeText.length; + let fetchCount = 0; + + const blob = new XetBlob({ + hash: "test", + size: totalSize, + refreshUrl: "https://huggingface.co", + listener: (e) => debugged.push(e), + fetch: async function (_url, opts) { + const url = new URL(_url as string); + const headers = opts?.headers as Record | undefined; + + switch (url.hostname) { + case "huggingface.co": { + // This is a token + return new Response( + JSON.stringify({ + casUrl: "https://cas.co", + accessToken: "boo", + exp: 1_000_000, + }), + ); + } + case "cas.co": { + // This is the reconstruction info + const range = headers?.["Range"]?.slice("bytes=".length).split("-").map(Number); + + const start = range?.[0] ?? 0; + // const end = range?.[1] ?? (totalSize - 1); + + return new Response( + JSON.stringify({ + terms: Array(1000) + .fill(0) + .map(() => ({ + hash: "test", + range: { + start: 0, + end: 2, + }, + unpacked_length: chunk1Content.length + chunk2Content.length, + })), + fetch_info: { + test: [ + { + url: "https://fetch.co", + range: { start: 0, end: 2 }, + url_range: { + start: 0, + end: mergedChunks.byteLength / 1000 - 1, + }, + }, + ], + }, + offset_into_first_range: start, + } satisfies ReconstructionInfo), + ); + } + case "fetch.co": { + fetchCount++; + return new Response( + new ReadableStream({ + pull(controller) { + controller.enqueue(new Uint8Array(mergedChunks)); + controller.close(); + }, + }), + //mergedChunks + ); + } + default: + throw new Error("Unhandled URL"); + } + }, + }); + + const startIndexes = [0, 5, 11, 6, 12, 100, 2000, totalSize - 12, totalSize - 2]; + + for (const index of startIndexes) { + console.log("slice", index); + const content = await blob.slice(index).text(); + expect(content.length).toBe(wholeText.length - index); + expect(content.slice(0, 1000)).toEqual(wholeText.slice(index).slice(0, 1000)); + expect(debugged.filter((e) => e.event === "read").length).toBe(2); // 1 read + 1 undefined + expect(fetchCount).toEqual(1); + + fetchCount = 0; + debugged.length = 0; + } + }); + + it("should load different slices when working with different XORBS", async () => { + const chunk1Content = "hello"; + const chunk2Content = "world!"; + const debugged: Array<{ event: "read" | string } & Record> = []; + + const chunks = Array(1000) + .fill(0) + .flatMap(() => [makeChunk(chunk1Content), makeChunk(chunk2Content)]); + + const mergedChunks = await new Blob(chunks).arrayBuffer(); + const wholeText = (chunk1Content + chunk2Content).repeat(1000); + + const totalSize = wholeText.length; + let fetchCount = 0; + + const blob = new XetBlob({ + hash: "test", + size: totalSize, + refreshUrl: "https://huggingface.co", + listener: (e) => debugged.push(e), + fetch: async function (_url, opts) { + const url = new URL(_url as string); + const headers = opts?.headers as Record | undefined; + + switch (url.hostname) { + case "huggingface.co": { + // This is a token + return new Response( + JSON.stringify({ + casUrl: "https://cas.co", + accessToken: "boo", + exp: 1_000_000, + }), + ); + } + case "cas.co": { + // This is the reconstruction info + const range = headers?.["Range"]?.slice("bytes=".length).split("-").map(Number); + + const start = range?.[0] ?? 0; + // const end = range?.[1] ?? (totalSize - 1); + + return new Response( + JSON.stringify({ + terms: Array(1000) + .fill(0) + .map((_, i) => ({ + hash: "test" + (i % 2), + range: { + start: 0, + end: 2, + }, + unpacked_length: chunk1Content.length + chunk2Content.length, + })), + fetch_info: { + test0: [ + { + url: "https://fetch.co", + range: { start: 0, end: 2 }, + url_range: { + start: 0, + end: mergedChunks.byteLength - 1, + }, + }, + ], + test1: [ + { + url: "https://fetch.co", + range: { start: 0, end: 2 }, + url_range: { + start: 0, + end: mergedChunks.byteLength - 1, + }, + }, + ], + }, + offset_into_first_range: start, + } satisfies ReconstructionInfo), + ); + } + case "fetch.co": { + fetchCount++; + return new Response( + new ReadableStream({ + pull(controller) { + controller.enqueue(new Uint8Array(mergedChunks)); + controller.close(); + }, + }), + //mergedChunks + ); + } + default: + throw new Error("Unhandled URL"); + } + }, + }); + + const startIndexes = [0, 5, 11, 6, 12, 100, 2000, totalSize - 12, totalSize - 2]; + + for (const index of startIndexes) { + console.log("slice", index); + const content = await blob.slice(index).text(); + expect(content.length).toBe(wholeText.length - index); + expect(content.slice(0, 1000)).toEqual(wholeText.slice(index).slice(0, 1000)); + expect(debugged.filter((e) => e.event === "read").length).toBe(4); // 1 read + 1 undefined + expect(fetchCount).toEqual(2); + + fetchCount = 0; + debugged.length = 0; + } + }); + }); + + describe("loading one chunk at a time", () => { + it("should load different slices but not till the end", async () => { + const chunk1Content = "hello"; + const chunk2Content = "world!"; + const debugged: Array<{ event: "read" | string } & Record> = []; + + const chunks = Array(1000) + .fill(0) + .flatMap(() => [makeChunk(chunk1Content), makeChunk(chunk2Content)]); + + const totalChunkLength = sum(chunks.map((x) => x.byteLength)); + const wholeText = (chunk1Content + chunk2Content).repeat(1000); + + const totalSize = wholeText.length; + let fetchCount = 0; + + const blob = new XetBlob({ + hash: "test", + size: totalSize, + refreshUrl: "https://huggingface.co", + listener: (e) => debugged.push(e), + fetch: async function (_url, opts) { + const url = new URL(_url as string); + const headers = opts?.headers as Record | undefined; + + switch (url.hostname) { + case "huggingface.co": { + // This is a token + return new Response( + JSON.stringify({ + casUrl: "https://cas.co", + accessToken: "boo", + exp: 1_000_000, + }), + ); + } + case "cas.co": { + // This is the reconstruction info + const range = headers?.["Range"]?.slice("bytes=".length).split("-").map(Number); + + const start = range?.[0] ?? 0; + // const end = range?.[1] ?? (totalSize - 1); + + return new Response( + JSON.stringify({ + terms: [ + { + hash: "test", + range: { + start: 0, + end: 2000, + }, + unpacked_length: chunk1Content.length + chunk2Content.length, + }, + ], + fetch_info: { + test: [ + { + url: "https://fetch.co", + range: { start: 0, end: 2000 }, + url_range: { + start: 0, + end: totalChunkLength - 1, + }, + }, + ], + }, + offset_into_first_range: start, + } satisfies ReconstructionInfo), + ); + } + case "fetch.co": { + fetchCount++; + return new Response( + new ReadableStream({ + pull(controller) { + for (const chunk of chunks) { + controller.enqueue(chunk); + } + controller.close(); + }, + }), + { + headers: { + "Content-Range": `bytes 0-${totalChunkLength - 1}/${totalChunkLength}`, + ETag: `"test"`, + "Content-Length": `${totalChunkLength}`, + }, + }, + ); + } + default: + throw new Error("Unhandled URL"); + } + }, + }); + + const startIndexes = [0, 5, 11, 6, 12, 100, 2000]; + + for (const index of startIndexes) { + console.log("slice", index); + const content = await blob.slice(index, 4000).text(); + expect(content.length).toBe(4000 - index); + expect(content.slice(0, 1000)).toEqual(wholeText.slice(index).slice(0, 1000)); + expect(fetchCount).toEqual(1); + + fetchCount = 0; + debugged.length = 0; + } + }); + + it("should load different slices", async () => { + const chunk1Content = "hello"; + const chunk2Content = "world!"; + const debugged: Array<{ event: "read" | string } & Record> = []; + + const chunks = Array(1000) + .fill(0) + .flatMap(() => [makeChunk(chunk1Content), makeChunk(chunk2Content)]); + + const totalChunkLength = sum(chunks.map((x) => x.byteLength)); + const wholeText = (chunk1Content + chunk2Content).repeat(1000); + + const totalSize = wholeText.length; + let fetchCount = 0; + + const blob = new XetBlob({ + hash: "test", + size: totalSize, + refreshUrl: "https://huggingface.co", + listener: (e) => debugged.push(e), + fetch: async function (_url, opts) { + const url = new URL(_url as string); + const headers = opts?.headers as Record | undefined; + + switch (url.hostname) { + case "huggingface.co": { + // This is a token + return new Response( + JSON.stringify({ + casUrl: "https://cas.co", + accessToken: "boo", + exp: 1_000_000, + }), + ); + } + case "cas.co": { + // This is the reconstruction info + const range = headers?.["Range"]?.slice("bytes=".length).split("-").map(Number); + + const start = range?.[0] ?? 0; + // const end = range?.[1] ?? (totalSize - 1); + + return new Response( + JSON.stringify({ + terms: Array(1000) + .fill(0) + .map(() => ({ + hash: "test", + range: { + start: 0, + end: 2, + }, + unpacked_length: chunk1Content.length + chunk2Content.length, + })), + fetch_info: { + test: [ + { + url: "https://fetch.co", + range: { start: 0, end: 2 }, + url_range: { + start: 0, + end: totalChunkLength - 1, + }, + }, + ], + }, + offset_into_first_range: start, + } satisfies ReconstructionInfo), + ); + } + case "fetch.co": { + fetchCount++; + return new Response( + new ReadableStream({ + pull(controller) { + for (const chunk of chunks) { + controller.enqueue(chunk); + } + controller.close(); + }, + }), + ); + } + default: + throw new Error("Unhandled URL"); + } + }, + }); + + const startIndexes = [0, 5, 11, 6, 12, 100, 2000, totalSize - 12, totalSize - 2]; + + for (const index of startIndexes) { + console.log("slice", index); + const content = await blob.slice(index).text(); + expect(content.length).toBe(wholeText.length - index); + expect(content.slice(0, 1000)).toEqual(wholeText.slice(index).slice(0, 1000)); + expect(debugged.filter((e) => e.event === "read").length).toBe(2000 + 1); // 1 read for each chunk + 1 undefined + expect(fetchCount).toEqual(1); + + fetchCount = 0; + debugged.length = 0; + } + }); + }); + + describe("loading at 29 bytes intervals", () => { + it("should load different slices", async () => { + const chunk1Content = "hello"; + const chunk2Content = "world!"; + const debugged: Array<{ event: "read" | string } & Record> = []; + + const chunks = Array(1000) + .fill(0) + .flatMap(() => [makeChunk(chunk1Content), makeChunk(chunk2Content)]); + const mergedChunks = await new Blob(chunks).arrayBuffer(); + const splitChunks = splitChunk(new Uint8Array(mergedChunks), 29); + + const totalChunkLength = sum(chunks.map((x) => x.byteLength)); + const wholeText = (chunk1Content + chunk2Content).repeat(1000); + + const totalSize = wholeText.length; + let fetchCount = 0; + + const blob = new XetBlob({ + hash: "test", + size: totalSize, + refreshUrl: "https://huggingface.co", + listener: (e) => debugged.push(e), + fetch: async function (_url, opts) { + const url = new URL(_url as string); + const headers = opts?.headers as Record | undefined; + + switch (url.hostname) { + case "huggingface.co": { + // This is a token + return new Response( + JSON.stringify({ + casUrl: "https://cas.co", + accessToken: "boo", + exp: 1_000_000, + }), + ); + } + case "cas.co": { + // This is the reconstruction info + const range = headers?.["Range"]?.slice("bytes=".length).split("-").map(Number); + + const start = range?.[0] ?? 0; + // const end = range?.[1] ?? (totalSize - 1); + + return new Response( + JSON.stringify({ + terms: Array(1000) + .fill(0) + .map(() => ({ + hash: "test", + range: { + start: 0, + end: 2, + }, + unpacked_length: chunk1Content.length + chunk2Content.length, + })), + fetch_info: { + test: [ + { + url: "https://fetch.co", + range: { start: 0, end: 2 }, + url_range: { + start: 0, + end: totalChunkLength - 1, + }, + }, + ], + }, + offset_into_first_range: start, + } satisfies ReconstructionInfo), + ); + } + case "fetch.co": { + fetchCount++; + return new Response( + new ReadableStream({ + pull(controller) { + for (const chunk of splitChunks) { + controller.enqueue(chunk); + } + controller.close(); + }, + }), + ); + } + default: + throw new Error("Unhandled URL"); + } + }, + }); + + const startIndexes = [0, 5, 11, 6, 12, 100, 2000, totalSize - 12, totalSize - 2]; + + for (const index of startIndexes) { + console.log("slice", index); + const content = await blob.slice(index).text(); + expect(content.length).toBe(wholeText.length - index); + expect(content.slice(0, 1000)).toEqual(wholeText.slice(index).slice(0, 1000)); + expect(debugged.filter((e) => e.event === "read").length).toBe(Math.ceil(totalChunkLength / 29) + 1); // 1 read for each chunk + 1 undefined + expect(fetchCount).toEqual(1); + + fetchCount = 0; + debugged.length = 0; + } + }); + }); + + describe("loading one byte at a time", () => { + it("should load different slices", async () => { + const chunk1Content = "hello"; + const chunk2Content = "world!"; + const debugged: Array<{ event: "read" | string } & Record> = []; + + const chunks = Array(100) + .fill(0) + .flatMap(() => [makeChunk(chunk1Content), makeChunk(chunk2Content)]) + .flatMap((x) => splitChunk(x, 1)); + + const totalChunkLength = sum(chunks.map((x) => x.byteLength)); + const wholeText = (chunk1Content + chunk2Content).repeat(100); + + const totalSize = wholeText.length; + let fetchCount = 0; + + const blob = new XetBlob({ + hash: "test", + size: totalSize, + refreshUrl: "https://huggingface.co", + listener: (e) => debugged.push(e), + fetch: async function (_url, opts) { + const url = new URL(_url as string); + const headers = opts?.headers as Record | undefined; + + switch (url.hostname) { + case "huggingface.co": { + // This is a token + return new Response( + JSON.stringify({ + casUrl: "https://cas.co", + accessToken: "boo", + exp: 1_000_000, + }), + ); + } + case "cas.co": { + // This is the reconstruction info + const range = headers?.["Range"]?.slice("bytes=".length).split("-").map(Number); + + const start = range?.[0] ?? 0; + // const end = range?.[1] ?? (totalSize - 1); + + return new Response( + JSON.stringify({ + terms: Array(100) + .fill(0) + .map(() => ({ + hash: "test", + range: { + start: 0, + end: 2, + }, + unpacked_length: chunk1Content.length + chunk2Content.length, + })), + fetch_info: { + test: [ + { + url: "https://fetch.co", + range: { start: 0, end: 2 }, + url_range: { + start: 0, + end: totalChunkLength - 1, + }, + }, + ], + }, + offset_into_first_range: start, + } satisfies ReconstructionInfo), + ); + } + case "fetch.co": { + fetchCount++; + return new Response( + new ReadableStream({ + pull(controller) { + for (const chunk of chunks) { + controller.enqueue(chunk); + } + controller.close(); + }, + }), + ); + } + default: + throw new Error("Unhandled URL"); + } + }, + }); + + const startIndexes = [0, 5, 11, 6, 12, 100, totalSize - 12, totalSize - 2]; + + for (const index of startIndexes) { + console.log("slice", index); + const content = await blob.slice(index).text(); + expect(content.length).toBe(wholeText.length - index); + expect(content.slice(0, 1000)).toEqual(wholeText.slice(index).slice(0, 1000)); + expect(debugged.filter((e) => e.event === "read").length).toBe(totalChunkLength + 1); // 1 read for each chunk + 1 undefined + expect(fetchCount).toEqual(1); + + fetchCount = 0; + debugged.length = 0; + } + }); + }); + }); +}); + +function makeChunk(content: string) { + const encoded = new TextEncoder().encode(content); + + const array = new Uint8Array(encoded.length + 8); + + const dataView = new DataView(array.buffer); + dataView.setUint8(0, 0); // version + dataView.setUint8(1, encoded.length % 256); // Compressed length + dataView.setUint8(2, (encoded.length >> 8) % 256); // Compressed length + dataView.setUint8(3, (encoded.length >> 16) % 256); // Compressed length + dataView.setUint8(4, 0); // Compression scheme + dataView.setUint8(5, encoded.length % 256); // Uncompressed length + dataView.setUint8(6, (encoded.length >> 8) % 256); // Uncompressed length + dataView.setUint8(7, (encoded.length >> 16) % 256); // Uncompressed length + + array.set(encoded, 8); + + return array; +} + +function splitChunk(chunk: Uint8Array, toLength: number): Uint8Array[] { + const dataView = new DataView(chunk.buffer); + return new Array(Math.ceil(chunk.byteLength / toLength)).fill(0).map((_, i) => { + const array = new Uint8Array(Math.min(toLength, chunk.byteLength - i * toLength)); + + for (let j = 0; j < array.byteLength; j++) { + array[j] = dataView.getUint8(i * toLength + j); + } + return array; + }); +} diff --git a/node_modules/@huggingface/hub/src/utils/XetBlob.ts b/node_modules/@huggingface/hub/src/utils/XetBlob.ts new file mode 100644 index 0000000000000000000000000000000000000000..fdfe1c11e3ef18d0311cef0362b46d896d4bd483 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/XetBlob.ts @@ -0,0 +1,713 @@ +import { createApiError } from "../error"; +import type { CredentialsParams } from "../types/public"; +import { checkCredentials } from "./checkCredentials"; +import { combineUint8Arrays } from "./combineUint8Arrays"; +import { decompress as lz4_decompress } from "../vendor/lz4js"; +import { RangeList } from "./RangeList"; + +const JWT_SAFETY_PERIOD = 60_000; +const JWT_CACHE_SIZE = 1_000; + +export interface XetReadToken { + accessToken: string; + casUrl: string; + exp: number; +} + +type XetBlobCreateOptions = { + /** + * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers. + */ + fetch?: typeof fetch; + // URL to get the access token from + refreshUrl: string; + size: number; + listener?: (arg: { event: "read" } | { event: "progress"; progress: { read: number; total: number } }) => void; + internalLogging?: boolean; + /** + * Pre-fetched read token to avoid the refresh URL roundtrip. + */ + readToken?: XetReadToken; +} & ({ hash: string; reconstructionUrl?: string } | { hash?: string; reconstructionUrl: string }) & + Partial; + +export interface ReconstructionInfo { + /** + * List of CAS blocks + */ + terms: Array<{ + /** Hash of the CAS block */ + hash: string; + /** Total uncompressed length of data of the chunks from range.start to range.end - 1 */ + unpacked_length: number; + /** Chunks. Eg start: 10, end: 100 = chunks 10-99 */ + range: { start: number; end: number }; + }>; + + /** + * Dictionnary of CAS block hash => list of ranges in the block + url to fetch it + */ + fetch_info: Record< + string, + Array<{ + url: string; + /** Chunk range */ + range: { start: number; end: number }; + /** + * Byte range, when making the call to the URL. + * + * We assume that we're given non-overlapping ranges for each hash + */ + url_range: { start: number; end: number }; + }> + >; + /** + * When doing a range request, the offset into the term's uncompressed data. Can be multiple chunks' worth of data. + */ + offset_into_first_range: number; +} + +export enum XetChunkCompressionScheme { + None = 0, + LZ4 = 1, + ByteGroupingLZ4 = 2, +} + +const compressionSchemeLabels: Record = { + [XetChunkCompressionScheme.None]: "None", + [XetChunkCompressionScheme.LZ4]: "LZ4", + [XetChunkCompressionScheme.ByteGroupingLZ4]: "ByteGroupingLZ4", +}; + +interface ChunkHeader { + version: number; // u8, 1 byte + compressed_length: number; // 3 * u8, 3 bytes + compression_scheme: XetChunkCompressionScheme; // u8, 1 byte + uncompressed_length: number; // 3 * u8, 3 bytes +} + +export const XET_CHUNK_HEADER_BYTES = 8; + +/** + * XetBlob is a blob implementation that fetches data directly from the Xet storage + */ +export class XetBlob extends Blob { + fetch: typeof fetch; + accessToken?: string; + refreshUrl: string; + reconstructionUrl?: string; + hash?: string; + start = 0; + end = 0; + internalLogging = false; + reconstructionInfo: ReconstructionInfo | undefined; + listener: XetBlobCreateOptions["listener"]; + + constructor(params: XetBlobCreateOptions) { + super([]); + + this.fetch = params.fetch ?? fetch.bind(globalThis); + this.accessToken = checkCredentials(params); + this.refreshUrl = params.refreshUrl; + this.end = params.size; + this.reconstructionUrl = params.reconstructionUrl; + this.hash = params.hash; + this.listener = params.listener; + this.internalLogging = params.internalLogging ?? false; + + if (params.readToken) { + const key = cacheKey({ refreshUrl: this.refreshUrl, initialAccessToken: this.accessToken }); + jwts.set(key, { + accessToken: params.readToken.accessToken, + expiresAt: new Date(params.readToken.exp * 1000), + casUrl: params.readToken.casUrl, + }); + } + } + + override get size(): number { + return this.end - this.start; + } + + #clone() { + const blob = new XetBlob({ + fetch: this.fetch, + hash: this.hash, + refreshUrl: this.refreshUrl, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + reconstructionUrl: this.reconstructionUrl!, + size: this.size, + }); + + blob.accessToken = this.accessToken; + blob.start = this.start; + blob.end = this.end; + blob.reconstructionInfo = this.reconstructionInfo; + blob.listener = this.listener; + blob.internalLogging = this.internalLogging; + + return blob; + } + + override slice(start = 0, end = this.size): XetBlob { + if (start < 0 || end < 0) { + new TypeError("Unsupported negative start/end on XetBlob.slice"); + } + + const slice = this.#clone(); + + slice.start = this.start + start; + slice.end = Math.min(this.start + end, this.end); + + if (slice.start !== this.start || slice.end !== this.end) { + slice.reconstructionInfo = undefined; + } + + return slice; + } + + #reconstructionInfoPromise?: Promise; + + #loadReconstructionInfo() { + if (this.#reconstructionInfoPromise) { + return this.#reconstructionInfoPromise; + } + + this.#reconstructionInfoPromise = (async () => { + const connParams = await getAccessToken(this.accessToken, this.fetch, this.refreshUrl); + + // debug( + // `curl '${connParams.casUrl}/v1/reconstructions/${this.hash}' -H 'Authorization: Bearer ${connParams.accessToken}'` + // ); + + const resp = await this.fetch(this.reconstructionUrl ?? `${connParams.casUrl}/v1/reconstructions/${this.hash}`, { + headers: { + Authorization: `Bearer ${connParams.accessToken}`, + Range: `bytes=${this.start}-${this.end - 1}`, + }, + }); + + if (!resp.ok) { + throw await createApiError(resp); + } + + this.reconstructionInfo = (await resp.json()) as ReconstructionInfo; + + return this.reconstructionInfo; + })().finally(() => (this.#reconstructionInfoPromise = undefined)); + + return this.#reconstructionInfoPromise; + } + + async #fetch(): Promise> { + if (!this.reconstructionInfo) { + await this.#loadReconstructionInfo(); + } + + const rangeLists = new Map>(); + + if (!this.reconstructionInfo) { + throw new Error("Failed to load reconstruction info"); + } + + for (const term of this.reconstructionInfo.terms) { + let rangeList = rangeLists.get(term.hash); + if (!rangeList) { + rangeList = new RangeList(); + rangeLists.set(term.hash, rangeList); + } + + rangeList.add(term.range.start, term.range.end); + } + const listener = this.listener; + const log = this.internalLogging ? (...args: unknown[]) => console.log(...args) : () => {}; + + async function* readData( + reconstructionInfo: ReconstructionInfo, + customFetch: typeof fetch, + maxBytes: number, + reloadReconstructionInfo: () => Promise, + ) { + let totalBytesRead = 0; + let readBytesToSkip = reconstructionInfo.offset_into_first_range; + + for (const term of reconstructionInfo.terms) { + if (totalBytesRead >= maxBytes) { + break; + } + + const rangeList = rangeLists.get(term.hash); + if (!rangeList) { + throw new Error(`Failed to find range list for term ${term.hash}`); + } + + { + const termRanges = rangeList.getRanges(term.range.start, term.range.end); + + if (termRanges.every((range) => range.data)) { + log("all data available for term", term.hash, readBytesToSkip); + rangeLoop: for (const range of termRanges) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + for (let chunk of range.data!) { + if (readBytesToSkip) { + const skipped = Math.min(readBytesToSkip, chunk.byteLength); + chunk = chunk.slice(skipped); + readBytesToSkip -= skipped; + if (!chunk.byteLength) { + continue; + } + } + if (chunk.byteLength > maxBytes - totalBytesRead) { + chunk = chunk.slice(0, maxBytes - totalBytesRead); + } + totalBytesRead += chunk.byteLength; + // The stream consumer can decide to transfer ownership of the chunk, so we need to return a clone + // if there's more than one range for the same term + yield range.refCount > 1 ? chunk.slice() : chunk; + listener?.({ event: "progress", progress: { read: totalBytesRead, total: maxBytes } }); + + if (totalBytesRead >= maxBytes) { + break rangeLoop; + } + } + } + rangeList.remove(term.range.start, term.range.end); + continue; + } + } + + const fetchInfo = reconstructionInfo.fetch_info[term.hash].find( + (info) => info.range.start <= term.range.start && info.range.end >= term.range.end, + ); + + if (!fetchInfo) { + throw new Error( + `Failed to find fetch info for term ${term.hash} and range ${term.range.start}-${term.range.end}`, + ); + } + + log("term", term); + log("fetchinfo", fetchInfo); + log("readBytesToSkip", readBytesToSkip); + + let resp = await customFetch(fetchInfo.url, { + headers: { + Range: `bytes=${fetchInfo.url_range.start}-${fetchInfo.url_range.end}`, + }, + }); + + if (resp.status === 403) { + // In case it's expired + reconstructionInfo = await reloadReconstructionInfo(); + resp = await customFetch(fetchInfo.url, { + headers: { + Range: `bytes=${fetchInfo.url_range.start}-${fetchInfo.url_range.end}`, + }, + }); + } + + if (!resp.ok) { + throw await createApiError(resp); + } + + log( + "expected content length", + resp.headers.get("content-length"), + "range", + fetchInfo.url_range, + resp.headers.get("content-range"), + ); + + const reader = resp.body?.getReader(); + if (!reader) { + throw new Error("Failed to get reader from response body"); + } + + let done = false; + let chunkIndex = fetchInfo.range.start; + const ranges = rangeList.getRanges(fetchInfo.range.start, fetchInfo.range.end); + + let leftoverBytes: Uint8Array | undefined = undefined; + let totalFetchBytes = 0; + + fetchData: while (!done && totalBytesRead < maxBytes) { + const result = await reader.read(); + listener?.({ event: "read" }); + + done = result.done; + + log("read", result.value?.byteLength, "bytes", "total read", totalBytesRead, "toSkip", readBytesToSkip); + + if (!result.value) { + log("no data in result, cancelled", result); + continue; + } + + totalFetchBytes += result.value.byteLength; + + if (leftoverBytes) { + result.value = combineUint8Arrays(leftoverBytes, result.value); + leftoverBytes = undefined; + } + + while (totalBytesRead < maxBytes && result.value?.byteLength) { + if (result.value.byteLength < 8) { + // We need 8 bytes to parse the chunk header + leftoverBytes = result.value; + continue fetchData; + } + + const header = new DataView(result.value.buffer, result.value.byteOffset, XET_CHUNK_HEADER_BYTES); + const chunkHeader: ChunkHeader = { + version: header.getUint8(0), + compressed_length: header.getUint8(1) | (header.getUint8(2) << 8) | (header.getUint8(3) << 16), + compression_scheme: header.getUint8(4), + uncompressed_length: header.getUint8(5) | (header.getUint8(6) << 8) | (header.getUint8(7) << 16), + }; + + log("chunk header", chunkHeader, "to skip", readBytesToSkip); + + if (chunkHeader.version !== 0) { + throw new Error(`Unsupported chunk version ${chunkHeader.version}`); + } + + if ( + chunkHeader.compression_scheme !== XetChunkCompressionScheme.None && + chunkHeader.compression_scheme !== XetChunkCompressionScheme.LZ4 && + chunkHeader.compression_scheme !== XetChunkCompressionScheme.ByteGroupingLZ4 + ) { + throw new Error( + `Unsupported compression scheme ${ + compressionSchemeLabels[chunkHeader.compression_scheme] ?? chunkHeader.compression_scheme + }`, + ); + } + + if (result.value.byteLength < chunkHeader.compressed_length + XET_CHUNK_HEADER_BYTES) { + // We need more data to read the full chunk + leftoverBytes = result.value; + continue fetchData; + } + + result.value = result.value.slice(XET_CHUNK_HEADER_BYTES); + + let uncompressed = + chunkHeader.compression_scheme === XetChunkCompressionScheme.LZ4 + ? lz4_decompress(result.value.slice(0, chunkHeader.compressed_length), chunkHeader.uncompressed_length) + : chunkHeader.compression_scheme === XetChunkCompressionScheme.ByteGroupingLZ4 + ? bg4_regroup_bytes( + lz4_decompress( + result.value.slice(0, chunkHeader.compressed_length), + chunkHeader.uncompressed_length, + ), + ) + : result.value.slice(0, chunkHeader.compressed_length); + + const range = ranges.find((range) => chunkIndex >= range.start && chunkIndex < range.end); + const shouldYield = chunkIndex >= term.range.start && chunkIndex < term.range.end; + const minRefCountToStore = shouldYield ? 2 : 1; + let stored = false; + + // Assuming non-overlapping fetch_info ranges for the same hash + if (range && range.refCount >= minRefCountToStore) { + range.data ??= []; + range.data.push(uncompressed); + stored = true; + } + + if (shouldYield) { + if (readBytesToSkip) { + const skipped = Math.min(readBytesToSkip, uncompressed.byteLength); + uncompressed = uncompressed.slice(readBytesToSkip); + readBytesToSkip -= skipped; + } + + if (uncompressed.byteLength > maxBytes - totalBytesRead) { + uncompressed = uncompressed.slice(0, maxBytes - totalBytesRead); + } + + if (uncompressed.byteLength) { + log( + "yield", + uncompressed.byteLength, + "bytes", + result.value.byteLength, + "total read", + totalBytesRead, + stored, + ); + totalBytesRead += uncompressed.byteLength; + yield stored ? uncompressed.slice() : uncompressed; + listener?.({ event: "progress", progress: { read: totalBytesRead, total: maxBytes } }); + } + } + + chunkIndex++; + result.value = result.value.slice(chunkHeader.compressed_length); + } + } + + if ( + done && + totalBytesRead < maxBytes && + totalFetchBytes < fetchInfo.url_range.end - fetchInfo.url_range.start + 1 + ) { + log("done", done, "total read", totalBytesRead, maxBytes, totalFetchBytes); + log("failed to fetch all data for term", term.hash); + throw new Error( + `Failed to fetch all data for term ${term.hash}, fetched ${totalFetchBytes} bytes out of ${ + fetchInfo.url_range.end - fetchInfo.url_range.start + 1 + }`, + ); + } + + log("done", done, "total read", totalBytesRead, maxBytes, totalFetchBytes); + + // Release the reader + log("cancel reader"); + await reader.cancel(); + } + } + + const iterator = readData( + this.reconstructionInfo, + this.fetch, + this.end - this.start, + this.#loadReconstructionInfo.bind(this), + ); + + // todo: when Chrome/Safari support it, use ReadableStream.from(readData) + return new ReadableStream( + { + // todo: when Safari supports it, type controller as ReadableByteStreamController + async pull(controller) { + const result = await iterator.next(); + + if (result.value) { + controller.enqueue(result.value); + } + + if (result.done) { + controller.close(); + } + }, + type: "bytes", + // todo: when Safari supports it, add autoAllocateChunkSize param + }, + // todo : use ByteLengthQueuingStrategy when there's good support for it, currently in Node.js it fails due to size being a function + { + highWaterMark: 1_000, // 1_000 chunks for ~1MB of RAM + }, + ); + } + + override async arrayBuffer(): Promise { + const result = await this.#fetch(); + + return new Response(result).arrayBuffer(); + } + + override async text(): Promise { + const result = await this.#fetch(); + + return new Response(result).text(); + } + + async response(): Promise { + const result = await this.#fetch(); + + return new Response(result); + } + + override stream(): ReturnType { + const stream = new TransformStream(); + + this.#fetch() + .then((response) => response.pipeThrough(stream)) + .catch((error) => stream.writable.abort(error.message)); + + return stream.readable; + } +} + +const jwtPromises: Map> = new Map(); +/** + * Cache to store JWTs, to avoid making many auth requests when downloading multiple files from the same repo + */ +const jwts: Map< + string, + { + accessToken: string; + expiresAt: Date; + casUrl: string; + } +> = new Map(); + +function cacheKey(params: { refreshUrl: string; initialAccessToken: string | undefined }): string { + return JSON.stringify([params.refreshUrl, params.initialAccessToken]); +} + +// exported for testing purposes +export function bg4_regroup_bytes(bytes: Uint8Array): Uint8Array { + // python code + + // split = len(x) // 4 + // rem = len(x) % 4 + // g1_pos = split + (1 if rem >= 1 else 0) + // g2_pos = g1_pos + split + (1 if rem >= 2 else 0) + // g3_pos = g2_pos + split + (1 if rem == 3 else 0) + // ret = bytearray(len(x)) + // ret[0::4] = x[:g1_pos] + // ret[1::4] = x[g1_pos:g2_pos] + // ret[2::4] = x[g2_pos:g3_pos] + // ret[3::4] = x[g3_pos:] + + // todo: optimize to do it in-place + + const split = Math.floor(bytes.byteLength / 4); + const rem = bytes.byteLength % 4; + const g1_pos = split + (rem >= 1 ? 1 : 0); + const g2_pos = g1_pos + split + (rem >= 2 ? 1 : 0); + const g3_pos = g2_pos + split + (rem == 3 ? 1 : 0); + + const ret = new Uint8Array(bytes.byteLength); + for (let i = 0, j = 0; i < bytes.byteLength; i += 4, j++) { + ret[i] = bytes[j]; + } + + for (let i = 1, j = g1_pos; i < bytes.byteLength; i += 4, j++) { + ret[i] = bytes[j]; + } + + for (let i = 2, j = g2_pos; i < bytes.byteLength; i += 4, j++) { + ret[i] = bytes[j]; + } + + for (let i = 3, j = g3_pos; i < bytes.byteLength; i += 4, j++) { + ret[i] = bytes[j]; + } + + return ret; + + // alternative implementation (to benchmark which one is faster) + // for (let i = 0; i < bytes.byteLength - 3; i += 4) { + // ret[i] = bytes[i / 4]; + // ret[i + 1] = bytes[g1_pos + i / 4]; + // ret[i + 2] = bytes[g2_pos + i / 4]; + // ret[i + 3] = bytes[g3_pos + i / 4]; + // } + + // if (rem === 1) { + // ret[bytes.byteLength - 1] = bytes[g1_pos - 1]; + // } else if (rem === 2) { + // ret[bytes.byteLength - 2] = bytes[g1_pos - 1]; + // ret[bytes.byteLength - 1] = bytes[g2_pos - 1]; + // } else if (rem === 3) { + // ret[bytes.byteLength - 3] = bytes[g1_pos - 1]; + // ret[bytes.byteLength - 2] = bytes[g2_pos - 1]; + // ret[bytes.byteLength - 1] = bytes[g3_pos - 1]; + // } +} + +export function bg4_split_bytes(bytes: Uint8Array): Uint8Array { + // This function does the opposite of bg4_regroup_bytes + // It takes interleaved bytes and groups them by 4 + + const ret = new Uint8Array(bytes.byteLength); + const split = Math.floor(bytes.byteLength / 4); + const rem = bytes.byteLength % 4; + + // Calculate group positions in the output array + const g1_pos = split + (rem >= 1 ? 1 : 0); + const g2_pos = g1_pos + split + (rem >= 2 ? 1 : 0); + const g3_pos = g2_pos + split + (rem == 3 ? 1 : 0); + + // Extract every 4th byte starting from position 0, 1, 2, 3 + // and place them in their respective groups + for (let i = 0, j = 0; i < bytes.byteLength; i += 4, j++) { + ret[j] = bytes[i]; + } + + for (let i = 1, j = g1_pos; i < bytes.byteLength; i += 4, j++) { + ret[j] = bytes[i]; + } + + for (let i = 2, j = g2_pos; i < bytes.byteLength; i += 4, j++) { + ret[j] = bytes[i]; + } + + for (let i = 3, j = g3_pos; i < bytes.byteLength; i += 4, j++) { + ret[j] = bytes[i]; + } + + return ret; +} + +async function getAccessToken( + initialAccessToken: string | undefined, + customFetch: typeof fetch, + refreshUrl: string, +): Promise<{ accessToken: string; casUrl: string }> { + const key = cacheKey({ refreshUrl, initialAccessToken }); + + const jwt = jwts.get(key); + + if (jwt && jwt.expiresAt > new Date(Date.now() + JWT_SAFETY_PERIOD)) { + return { accessToken: jwt.accessToken, casUrl: jwt.casUrl }; + } + + // If we already have a promise for this repo, return it + const existingPromise = jwtPromises.get(key); + if (existingPromise) { + return existingPromise; + } + + const promise = (async () => { + const resp = await customFetch(refreshUrl, { + headers: { + ...(initialAccessToken + ? { + Authorization: `Bearer ${initialAccessToken}`, + } + : {}), + }, + }); + + if (!resp.ok) { + throw new Error(`Failed to get JWT token: ${resp.status} ${await resp.text()}`); + } + + const json: { accessToken: string; casUrl: string; exp: number } = await resp.json(); + const jwt = { + accessToken: json.accessToken, + expiresAt: new Date(json.exp * 1000), + casUrl: json.casUrl, + }; + + jwtPromises.delete(key); + + for (const [key, value] of jwts.entries()) { + if (value.expiresAt < new Date(Date.now() + JWT_SAFETY_PERIOD)) { + jwts.delete(key); + } else { + break; + } + } + if (jwts.size >= JWT_CACHE_SIZE) { + const keyToDelete = jwts.keys().next().value; + if (keyToDelete) { + jwts.delete(keyToDelete); + } + } + jwts.set(key, jwt); + + return { + accessToken: json.accessToken, + casUrl: json.casUrl, + }; + })(); + + jwtPromises.set(key, promise); + + return promise; +} diff --git a/node_modules/@huggingface/hub/src/utils/base64FromBytes.ts b/node_modules/@huggingface/hub/src/utils/base64FromBytes.ts new file mode 100644 index 0000000000000000000000000000000000000000..5327bbfe25838372cc7e25123d1cc9beaf80ceda --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/base64FromBytes.ts @@ -0,0 +1,11 @@ +export function base64FromBytes(arr: Uint8Array): string { + if (globalThis.Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} diff --git a/node_modules/@huggingface/hub/src/utils/checkCredentials.ts b/node_modules/@huggingface/hub/src/utils/checkCredentials.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e1717054b5dd1d03f4bd0b9c8f986a2ea4560f7 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/checkCredentials.ts @@ -0,0 +1,18 @@ +import type { CredentialsParams } from "../types/public"; + +export function checkAccessToken(accessToken: string): void { + if (!accessToken.startsWith("hf_")) { + throw new TypeError("Your access token must start with 'hf_'"); + } +} + +export function checkCredentials(params: Partial): string | undefined { + if (params.accessToken) { + checkAccessToken(params.accessToken); + return params.accessToken; + } + if (params.credentials?.accessToken) { + checkAccessToken(params.credentials.accessToken); + return params.credentials.accessToken; + } +} diff --git a/node_modules/@huggingface/hub/src/utils/chunk.ts b/node_modules/@huggingface/hub/src/utils/chunk.ts new file mode 100644 index 0000000000000000000000000000000000000000..20718cc89e5e32fd99d99be93dead0e4e24949f4 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/chunk.ts @@ -0,0 +1,25 @@ +import { range } from "./range"; + +/** + * Chunk array into arrays of length at most `chunkSize` + * + * @param chunkSize must be greater than or equal to 1 + */ +export function chunk(arr: T, chunkSize: number): T[] { + if (isNaN(chunkSize) || chunkSize < 1) { + throw new RangeError("Invalid chunk size: " + chunkSize); + } + + if (!arr.length) { + return []; + } + + /// Small optimization to not chunk buffers unless needed + if (arr.length <= chunkSize) { + return [arr]; + } + + return range(Math.ceil(arr.length / chunkSize)).map((i) => { + return arr.slice(i * chunkSize, (i + 1) * chunkSize); + }) as T[]; +} diff --git a/node_modules/@huggingface/hub/src/utils/combineUint8Arrays.spec.ts b/node_modules/@huggingface/hub/src/utils/combineUint8Arrays.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..96c806a2882bd6b7cccefb3b338cf8f4818dbd2a --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/combineUint8Arrays.spec.ts @@ -0,0 +1,15 @@ +import { describe, it, expect } from "vitest"; +import { combineUint8Arrays } from "./combineUint8Arrays"; + +describe("combineUint8Arrays", () => { + it.each([ + { a: [], b: [], expected: [] }, + { a: [], b: [1, 2, 3], expected: [1, 2, 3] }, + { a: [4, 5, 6], b: [], expected: [4, 5, 6] }, + { a: [7, 8], b: [9, 10], expected: [7, 8, 9, 10] }, + { a: [1], b: [2, 3, 4], expected: [1, 2, 3, 4] }, + ])("combines $a and $b to $expected", ({ a, b, expected }) => { + const result = combineUint8Arrays(new Uint8Array(a), new Uint8Array(b)); + expect(result).toEqual(new Uint8Array(expected)); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/combineUint8Arrays.ts b/node_modules/@huggingface/hub/src/utils/combineUint8Arrays.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0be769b85e44e22963a6c6976707a0a1fc25902 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/combineUint8Arrays.ts @@ -0,0 +1,10 @@ +export function combineUint8Arrays( + a: Uint8Array, + b: Uint8Array, +): Uint8Array { + const aLength = a.length; + const combinedBytes = new Uint8Array(aLength + b.length); + combinedBytes.set(a); + combinedBytes.set(b, aLength); + return combinedBytes; +} diff --git a/node_modules/@huggingface/hub/src/utils/createBlob.ts b/node_modules/@huggingface/hub/src/utils/createBlob.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d5f200a66ec1946d2a770cfd7ccde1b9f724ec4 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/createBlob.ts @@ -0,0 +1,30 @@ +import { WebBlob } from "./WebBlob"; +import { isFrontend } from "./isFrontend"; + +/** + * This function allow to retrieve either a FileBlob or a WebBlob from a URL. + * + * From the backend: + * - support local files + * - support http resources with absolute URLs + * + * From the frontend: + * - support http resources with absolute or relative URLs + */ +export async function createBlob(url: URL, opts?: { fetch?: typeof fetch; accessToken?: string }): Promise { + if (url.protocol === "http:" || url.protocol === "https:") { + return WebBlob.create(url, { fetch: opts?.fetch, accessToken: opts?.accessToken }); + } + + if (isFrontend) { + throw new TypeError(`Unsupported URL protocol "${url.protocol}"`); + } + + if (url.protocol === "file:") { + const { FileBlob } = await import("./FileBlob"); + + return FileBlob.create(url); + } + + throw new TypeError(`Unsupported URL protocol "${url.protocol}"`); +} diff --git a/node_modules/@huggingface/hub/src/utils/createBlobs.ts b/node_modules/@huggingface/hub/src/utils/createBlobs.ts new file mode 100644 index 0000000000000000000000000000000000000000..93314ebf06232806279e0c90cfe532f7da1dbf68 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/createBlobs.ts @@ -0,0 +1,51 @@ +import { WebBlob } from "./WebBlob"; +import { isFrontend } from "./isFrontend"; + +/** + * This function allow to retrieve either a FileBlob or a WebBlob from a URL. + * + * From the backend: + * - support local files + * - support local folders + * - support http resources with absolute URLs + * + * From the frontend: + * - support http resources with absolute or relative URLs + */ +export async function createBlobs( + url: URL, + destPath: string, + opts?: { fetch?: typeof fetch; maxFolderDepth?: number; accessToken?: string }, +): Promise> { + if (url.protocol === "http:" || url.protocol === "https:") { + const blob = await WebBlob.create(url, { fetch: opts?.fetch, accessToken: opts?.accessToken }); + return [{ path: destPath, blob }]; + } + + if (isFrontend) { + throw new TypeError(`Unsupported URL protocol "${url.protocol}"`); + } + + if (url.protocol === "file:") { + const { FileBlob } = await import("./FileBlob"); + const { subPaths } = await import("./sub-paths"); + const paths = await subPaths(url, opts?.maxFolderDepth); + + if (paths.length === 1 && paths[0].relativePath === ".") { + const blob = await FileBlob.create(url); + return [{ path: destPath, blob }]; + } + + return Promise.all( + paths.map(async (path) => ({ + path: `${destPath}/${path.relativePath}` + .replace(/\/[.]$/, "") + .replaceAll("//", "/") + .replace(/^[.]?\//, ""), + blob: await FileBlob.create(new URL(path.path)), + })), + ); + } + + throw new TypeError(`Unsupported URL protocol "${url.protocol}"`); +} diff --git a/node_modules/@huggingface/hub/src/utils/createXorb.spec.ts b/node_modules/@huggingface/hub/src/utils/createXorb.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..80229554be14a9a64d8976fe66de13a5c90cc258 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/createXorb.spec.ts @@ -0,0 +1,93 @@ +import { describe, expect, it } from "vitest"; +import { backtrackDedup, CurrentXorbInfo } from "./createXorbs"; +import type { ShardData } from "./shardParser"; +import { ChunkCache } from "./ChunkCache"; + +describe("createXorb", () => { + describe("backtrackDedup", () => { + it("should update cache info for chunks that go back due to previous chunks being erased", () => { + const xorb = new CurrentXorbInfo(); + + const chunkMetadata = [ + { + xorbId: xorb.id, + chunkIndex: 0, + length: 101, + }, + { + xorbId: xorb.id, + chunkIndex: 1, + length: 101, + }, + ]; + xorb.chunks = [ + { + hash: "chunk1", + length: 101, + offset: 0, + }, + { + hash: "chunk2", + length: 101, + offset: 101, + }, + ]; + const shardData: ShardData = { + hmacKey: "shard1", + xorbs: [ + { + hash: "remoteXorb1", + chunks: [ + { + hash: "chunk0:shard1", + startOffset: 0, + unpackedLength: 100, + }, + { + hash: "chunk1:shard1", + startOffset: 100, + unpackedLength: 101, + }, + ], + }, + ], + }; + + const computeHmac = (hash: string, key: string) => { + return hash + ":" + key; + }; + + const chunkCache = new ChunkCache(); + let chunkIndex = 0; + for (const chunk of xorb.chunks) { + chunkCache.addChunkToCache(chunk.hash, xorb.id, chunkIndex++, shardData.hmacKey); + } + let xorbIndex = 0; + for (const xorb of shardData.xorbs) { + xorbIndex--; + for (let i = 0; i < xorb.chunks.length; i++) { + chunkCache.addChunkToCache(xorb.chunks[i].hash, xorbIndex, i, shardData.hmacKey); + } + } + const dedup = backtrackDedup(xorb, computeHmac, shardData, chunkCache, chunkMetadata, 0); + expect(dedup).toBe(101); + expect(xorb.chunks).toEqual([{ hash: "chunk2", length: 101, offset: 0 }]); + expect(chunkMetadata).toEqual([ + { + xorbId: -1, + chunkIndex: 1, + length: 101, + }, + { + xorbId: 0, + chunkIndex: 0, + length: 101, + }, + ]); + // chunk1 should use remote hash now + expect(chunkCache.getChunk("chunk1", computeHmac)).toEqual({ xorbIndex: -1, chunkIndex: 1 }); + // The xorb index for chunk2 should be 0 now that the previous chunk was erased from the xorb + expect(chunkCache.getChunk("chunk2", computeHmac)).toEqual({ xorbIndex: 0, chunkIndex: 0 }); + }); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/createXorbs.ts b/node_modules/@huggingface/hub/src/utils/createXorbs.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a6113091c931804173f1e485aad1fe6e1119863 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/createXorbs.ts @@ -0,0 +1,760 @@ +import { bg4_split_bytes, XET_CHUNK_HEADER_BYTES, XetChunkCompressionScheme } from "./XetBlob"; +import { compress as lz4_compress } from "../vendor/lz4js"; +import { ChunkCache } from "./ChunkCache"; +import { xetWriteToken, type XetWriteTokenParams } from "./xetWriteToken"; +import type { ShardData } from "./shardParser"; +import { parseShardData } from "./shardParser"; +import { SplicedBlob } from "./SplicedBlob"; + +const TARGET_CHUNK_SIZE = 64 * 1024; +/* eslint-disable @typescript-eslint/no-unused-vars */ +const MAX_CHUNK_SIZE = 2 * TARGET_CHUNK_SIZE; +const XORB_SIZE = 64 * 1024 * 1024; +const MAX_XORB_CHUNKS = 8 * 1024; +const INTERVAL_BETWEEN_REMOTE_DEDUP = 4_000_000; // 4MB +/** + * 0 = only show progress when uploading the xorb + * 1 = only show progress when processing the file + * 0.5 = show progress when uploading the xorb and when processing the file + */ +const PROCESSING_PROGRESS_RATIO = 0.1; +const UPLOADING_PROGRESS_RATIO = 1 - PROCESSING_PROGRESS_RATIO; + +interface XorbEvent { + event: "xorb"; + xorb: Uint8Array; + hash: string; + id: number; + chunks: Array<{ hash: string; length: number }>; + files: Array<{ + path: string; + progress: number; + lastSentProgress: number; + }>; +} + +export class CurrentXorbInfo { + id: number; + offset: number; + chunks: Array<{ hash: string; length: number; offset: number }>; + + fileProcessedBytes: Record; + fileUploadedBytes: Record; + fileSize: Record; + data: Uint8Array; + immutableData: { + chunkIndex: number; + offset: number; + } | null; + + constructor() { + this.id = 0; + this.offset = 0; + this.chunks = []; + this.fileProcessedBytes = {}; + this.fileUploadedBytes = {}; + this.fileSize = {}; + this.data = new Uint8Array(XORB_SIZE); + this.immutableData = null; + } + + event(computeXorbHash: (chunks: { hash: string; length: number }[]) => string): XorbEvent { + const xorbChunksCleaned = this.chunks.map((chunk) => ({ + hash: chunk.hash, + length: chunk.length, + })); + + return { + event: "xorb" as const, + xorb: this.data.subarray(0, this.offset), + hash: computeXorbHash(xorbChunksCleaned), + chunks: xorbChunksCleaned, + id: this.id, + files: Object.entries(this.fileProcessedBytes).map(([path, processedBytes]) => ({ + path, + progress: processedBytes / this.fileSize[path], + lastSentProgress: + ((this.fileUploadedBytes[path] ?? 0) + + (processedBytes - (this.fileUploadedBytes[path] ?? 0)) * PROCESSING_PROGRESS_RATIO) / + this.fileSize[path], + })), + }; + } +} + +export async function* createXorbs( + fileSources: AsyncGenerator<{ content: Blob; path: string; sha256?: string }>, + params: XetWriteTokenParams & { + yieldCallback?: (event: { event: "fileProgress"; path: string; progress: number }) => void; + }, +): AsyncGenerator< + | XorbEvent + | { + event: "file"; + path: string; + hash: string; + sha256?: string; + /** Percentage of file bytes that were deduplicated (0-1) */ + dedupRatio: number; + representation: Array<{ + xorbId: number | string; // either xorb id (for local xorbs) or xorb hash (for remote xorbs) + indexStart: number; + indexEnd: number; + /** Unpacked length */ + length: number; + rangeHash: string; + }>; + }, + void, + undefined +> { + const alreadyDoneFileSha256s: Set = new Set(); + const chunkModule = await import("../vendor/xet-chunk/chunker_wasm"); + let xorbId = 0; + + await chunkModule.init(); + const chunkCache = new ChunkCache(); + let xorb = new CurrentXorbInfo(); + + const nextXorb = (currentFile: { path: string; uploadedBytes: number; size: number }): XorbEvent => { + const event = xorb.event(chunkModule.compute_xorb_hash.bind(chunkModule)); + + xorbId++; + xorb = new CurrentXorbInfo(); + xorb.id = xorbId; + xorb.fileUploadedBytes = { + [currentFile.path]: currentFile.uploadedBytes, + }; + xorb.fileSize[currentFile.path] = currentFile.size; + + return event; + }; + + const pendingFileEvents: Array<{ + event: "file"; + path: string; + hash: string; + dedupRatio: number; + sha256?: string; + representation: Array<{ + xorbId: number | string; + indexStart: number; + indexEnd: number; + length: number; + rangeHash: string; + }>; + }> = []; + + const remoteXorbHashes: string[] = [""]; // starts at index 1 (to simplify implem a bit) + + for await (const fileSource of fileSources) { + params.yieldCallback?.({ + event: "fileProgress", + path: fileSource.path, + progress: 0, + }); + if (fileSource.sha256 && alreadyDoneFileSha256s.has(fileSource.sha256)) { + params.yieldCallback?.({ + event: "fileProgress", + path: fileSource.path, + progress: 1, + }); + continue; + } + if (fileSource.sha256) { + alreadyDoneFileSha256s.add(fileSource.sha256); + } + + const chunker = new chunkModule.Chunker(TARGET_CHUNK_SIZE); + try { + xorb.fileSize[fileSource.path] = fileSource.content.size; + + // Load dedup info for the first chunk of the file, if it's potentially modified by the splice + if (fileSource.content instanceof SplicedBlob && fileSource.content.firstSpliceIndex < MAX_CHUNK_SIZE) { + await loadDedupInfoToCache( + fileSource.content.originalBlob.slice(0, MAX_CHUNK_SIZE), + remoteXorbHashes, + params, + chunkCache, + chunkModule, + { + maxChunks: 1, + isAtBeginning: true, + }, + ); + } + let bytesSinceRemoteDedup = Infinity; + let bytesSinceLastProgressEvent = 0; + let isFirstFileChunk = true; + const sourceChunks: Array = []; + + const reader = fileSource.content.stream().getReader(); + let processedBytes = 0; + let dedupedBytes = 0; // Track bytes that were deduplicated + // Needed to compute the final file hash + // todo: have the wasm function to compute file hash be able to take data chunk by chunk instead of all at once + const fileChunks: Array<{ hash: string; length: number }> = []; + // Collect chunk metadata to build representation at the end + // todo: build partial representation at the end of each xorb, to avoid having to store all chunks in memory + const chunkMetadata: Array<{ + xorbId: number | string; + chunkIndex: number; + length: number; + }> = []; + + const addChunks = async function* (chunks: Array<{ hash: string; length: number; dedup: boolean }>) { + for (const chunk of chunks) { + if (isFirstFileChunk) { + chunk.dedup = true; + isFirstFileChunk = false; + } + let chunkIndex = xorb.chunks.length; + let chunkXorbId = xorbId; + + // Remove chunks from source data + const chunkToCopy = removeChunkFromSourceData(sourceChunks, chunk.length); + + let cacheData = chunkCache.getChunk(chunk.hash, chunkModule.compute_hmac); + if (cacheData === undefined && chunk.dedup && bytesSinceRemoteDedup >= INTERVAL_BETWEEN_REMOTE_DEDUP) { + const token = await xetWriteToken(params); + bytesSinceRemoteDedup = 0; + + const shardResp = await (params.fetch ?? fetch)(token.casUrl + "/v1/chunks/default/" + chunk.hash, { + headers: { + Authorization: `Bearer ${token.accessToken}`, + }, + }); + + // todo: handle non-404 non-429 errors, eg throw error + if (shardResp.ok) { + const shard = await shardResp.blob(); + const shardData = await parseShardData(shard); + + for (const xorb of shardData.xorbs) { + const remoteXorbId = -remoteXorbHashes.length; + remoteXorbHashes.push(xorb.hash); + let i = 0; + for (const chunk of xorb.chunks) { + chunkCache.addChunkToCache(chunk.hash, remoteXorbId, i++, shardData.hmacKey); + } + } + cacheData = chunkCache.getChunk(chunk.hash, chunkModule.compute_hmac); + + // We backtrack a bit to check if new dedup info contains older chunks + const oldDedupedBytes = dedupedBytes; + dedupedBytes = backtrackDedup( + xorb, + chunkModule.compute_hmac.bind(chunkModule), + shardData, + chunkCache, + chunkMetadata, + dedupedBytes, + ); + + if (dedupedBytes > oldDedupedBytes) { + xorb.fileUploadedBytes[fileSource.path] ??= 0; + xorb.fileUploadedBytes[fileSource.path] += dedupedBytes - oldDedupedBytes; + } + } + } + if (cacheData === undefined) { + if (!writeChunk(xorb, chunkToCopy, chunk.hash)) { + // Failure to write chunk, maybe because it went over xorb size limit + yield nextXorb({ path: fileSource.path, uploadedBytes: processedBytes, size: fileSource.content.size }); + + chunkIndex = 0; + chunkXorbId = xorbId; + + for (const event of pendingFileEvents) { + event.representation = event.representation.map((rep) => ({ + ...rep, + xorbId: (rep.xorbId as number) >= 0 ? rep.xorbId : remoteXorbHashes[-rep.xorbId], + })); + yield event; + } + pendingFileEvents.length = 0; + + if (!writeChunk(xorb, chunkToCopy, chunk.hash)) { + throw new Error("Failed to write chunk into xorb"); + } + } + + chunkCache.addChunkToCache(chunk.hash, xorbId, chunkIndex, null); + } else { + chunkXorbId = cacheData.xorbIndex; + chunkIndex = cacheData.chunkIndex; + dedupedBytes += chunk.length; // Track deduplicated bytes + xorb.fileUploadedBytes[fileSource.path] ??= 0; + xorb.fileUploadedBytes[fileSource.path] += chunk.length; + } + + bytesSinceRemoteDedup += chunk.length; + bytesSinceLastProgressEvent += chunk.length; + + // Collect metadata for building representation at the end + fileChunks.push({ hash: chunk.hash, length: chunk.length }); + chunkMetadata.push({ + xorbId: chunkXorbId, + chunkIndex: chunkIndex, + length: chunk.length, + }); + + xorb.fileProcessedBytes[fileSource.path] = processedBytes; + + if (bytesSinceLastProgressEvent >= 1_000_000) { + // Emit half of the progress when processed locally, other half when uploading the xorb + bytesSinceLastProgressEvent = 0; + params.yieldCallback?.({ + event: "fileProgress", + path: fileSource.path, + progress: + ((xorb.fileUploadedBytes[fileSource.path] ?? 0) + + (xorb.fileProcessedBytes[fileSource.path] - (xorb.fileUploadedBytes[fileSource.path] ?? 0)) * + PROCESSING_PROGRESS_RATIO) / + fileSource.content.size, + }); + } + + if (xorb.chunks.length >= MAX_XORB_CHUNKS) { + yield nextXorb({ path: fileSource.path, uploadedBytes: processedBytes, size: fileSource.content.size }); + + for (const event of pendingFileEvents) { + event.representation = event.representation.map((rep) => ({ + ...rep, + xorbId: (rep.xorbId as number) >= 0 ? rep.xorbId : remoteXorbHashes[-rep.xorbId], + })); + yield event; + } + pendingFileEvents.length = 0; + } + } + }; + + while (true) { + const { done, value } = await reader.read(); + if (done) { + yield* addChunks(chunker.finish()); + break; + } + processedBytes += value.length; + sourceChunks.push(value); + yield* addChunks(chunker.add_data(value)); + } + + const fileRepresentation = buildFileRepresentation( + chunkMetadata, + fileChunks, + chunkModule.compute_verification_hash.bind(chunkModule), + ); + xorb.immutableData = { + chunkIndex: xorb.chunks.length, + offset: xorb.offset, + }; + const dedupRatio = fileSource.content.size > 0 ? dedupedBytes / fileSource.content.size : 0; + + pendingFileEvents.push({ + event: "file" as const, + path: fileSource.path, + hash: chunkModule.compute_file_hash(fileChunks), + sha256: fileSource.sha256, + dedupRatio, + representation: fileRepresentation, + }); + } finally { + chunker.free(); + // ^ is this really needed ? + } + } + + if (xorb.offset > 0) { + yield xorb.event(chunkModule.compute_xorb_hash.bind(chunkModule)); + } + + for (const event of pendingFileEvents) { + event.representation = event.representation.map((rep) => ({ + ...rep, + xorbId: (rep.xorbId as number) >= 0 ? rep.xorbId : remoteXorbHashes[-rep.xorbId], + })); + yield event; + } +} + +export function backtrackDedup( + xorb: CurrentXorbInfo, + computeHmac: (hash: string, key: string) => string, + shardData: ShardData, + chunkCache: ChunkCache, + chunkMetadata: { xorbId: number | string; chunkIndex: number; length: number }[], + dedupedBytes: number, +): number { + const chunkIndexesToBacktrackFor = new Map(); + for ( + let chunkToRecheckIndex = xorb.immutableData?.chunkIndex ?? 0; + chunkToRecheckIndex < xorb.chunks.length; + chunkToRecheckIndex++ + ) { + const chunk = xorb.chunks[chunkToRecheckIndex]; + const hmacHash = computeHmac(chunk.hash, shardData.hmacKey); + const cacheData = chunkCache.getChunk(hmacHash, null); + if (cacheData !== undefined) { + chunkIndexesToBacktrackFor.set(chunkToRecheckIndex, { + xorbId: cacheData.xorbIndex, + chunkIndex: cacheData.chunkIndex, + }); + chunkCache.removeChunkFromCache(chunk.hash); + } + } + + // Use remote dedup info to update chunk metadata for file representation + for (const metadata of chunkMetadata) { + if (metadata.xorbId === xorb.id && chunkIndexesToBacktrackFor.has(metadata.chunkIndex)) { + const backtrackData = chunkIndexesToBacktrackFor.get(metadata.chunkIndex); + if (backtrackData !== undefined) { + metadata.xorbId = backtrackData.xorbId; + metadata.chunkIndex = backtrackData.chunkIndex; + dedupedBytes += metadata.length; + } + } + } + + // Remove chunks that were backtracked from xorbChunks + const xorbRangesToErase: Array<{ start: number; end: number }> = []; + for (let i = 0; i < xorb.chunks.length; i++) { + const chunk = xorb.chunks[i]; + if (chunkIndexesToBacktrackFor.has(i)) { + xorbRangesToErase.push({ + start: chunk.offset, + end: i < xorb.chunks.length - 1 ? xorb.chunks[i + 1].offset : xorb.offset, + }); + } + } + const xorbRangesToKeep: Array<{ start: number; end: number }> = []; + let currentStart = 0; + for (let i = 0; i < xorbRangesToErase.length; i++) { + const range = xorbRangesToErase[i]; + if (currentStart !== range.start) { + xorbRangesToKeep.push({ start: currentStart, end: range.start }); + } + currentStart = range.end; + } + if (currentStart !== xorb.offset) { + xorbRangesToKeep.push({ start: currentStart, end: xorb.offset }); + } + + let currentOffset = 0; + for (const range of xorbRangesToKeep) { + if (range.start !== currentOffset) { + xorb.data.set(xorb.data.subarray(range.start, range.end), currentOffset); + } + currentOffset += range.end - range.start; + } + const newXorbChunks: Array<{ hash: string; length: number; offset: number }> = []; + const oldIndexToNewIndex = new Map(); + let erasedOffset = 0; + for (let i = 0; i < xorb.chunks.length; i++) { + const chunk = xorb.chunks[i]; + if (chunkIndexesToBacktrackFor.has(i)) { + if (i < xorb.chunks.length - 1) { + erasedOffset += xorb.chunks[i + 1].offset - chunk.offset; + } + } else { + newXorbChunks.push({ + hash: chunk.hash, + length: chunk.length, + offset: chunk.offset - erasedOffset, + }); + // Only need a mapping if index changed (at least one previous chunk was erased) + if (erasedOffset > 0) { + oldIndexToNewIndex.set(i, newXorbChunks.length - 1); + } + } + } + xorb.chunks = newXorbChunks; + xorb.offset = currentOffset; + // Update chunkMetadata and chunkCache with new chunk indexes for the current xorb chunks + for (const chunk of chunkMetadata) { + if (chunk.xorbId === xorb.id) { + const newIndex = oldIndexToNewIndex.get(chunk.chunkIndex); + if (newIndex !== undefined) { + const cached = chunkCache.getChunk(xorb.chunks[newIndex].hash, null); + if (cached !== undefined && cached.xorbIndex === chunk.xorbId && cached.chunkIndex === chunk.chunkIndex) { + chunkCache.updateChunkIndex(xorb.chunks[newIndex].hash, newIndex); + } + chunk.chunkIndex = newIndex; + } + } + } + return dedupedBytes; +} + +/** + * Removes and returns a chunk of the specified length from the sourceChunks array. + */ +function removeChunkFromSourceData(sourceChunks: Array, chunkLength: number): Uint8Array { + if (chunkLength === sourceChunks[0].length) { + const chunkToCopy = sourceChunks[0]; + sourceChunks.shift(); + return chunkToCopy; + } else if (chunkLength < sourceChunks[0].length) { + const chunkToCopy = sourceChunks[0].subarray(0, chunkLength); + sourceChunks[0] = sourceChunks[0].subarray(chunkLength); + return chunkToCopy; + } else { + const chunkToCopy = new Uint8Array(chunkLength); + let copyOffset = 0; + let index = 0; + let toSlice = -1; + while (copyOffset < chunkLength) { + const nToCopy = Math.min(sourceChunks[index].length, chunkLength - copyOffset); + chunkToCopy.set(sourceChunks[index].subarray(0, nToCopy), copyOffset); + copyOffset += nToCopy; + + if (nToCopy === sourceChunks[index].length) { + index++; + } else { + toSlice = nToCopy; + } + } + sourceChunks.splice(0, index); + if (toSlice !== -1) { + sourceChunks[0] = sourceChunks[0].subarray(toSlice); + } + return chunkToCopy; + } +} + +/** + * Write a chunk header to the xorb and return the offset of where to write the next chunk + * + * If it returns 0, it means there wasn't enough space in the xorb + */ +function writeChunk(xorb: CurrentXorbInfo, chunk: Uint8Array, hash: string): boolean { + const regularCompressedChunk = lz4_compress(chunk); + const bgCompressedChunk = lz4_compress(bg4_split_bytes(chunk)); + const compressedChunk = + bgCompressedChunk.length < regularCompressedChunk.length ? bgCompressedChunk : regularCompressedChunk; + const chunkToWrite = compressedChunk.length < chunk.length ? compressedChunk : chunk; + + if (xorb.offset + XET_CHUNK_HEADER_BYTES + chunkToWrite.length > XORB_SIZE) { + return false; + } + + xorb.data[xorb.offset] = 0; + xorb.data[xorb.offset + 1] = chunkToWrite.length & 0xff; + xorb.data[xorb.offset + 2] = (chunkToWrite.length >> 8) & 0xff; + xorb.data[xorb.offset + 3] = (chunkToWrite.length >> 16) & 0xff; + xorb.data[xorb.offset + 4] = + chunkToWrite.length < chunk.length + ? bgCompressedChunk.length < regularCompressedChunk.length + ? XetChunkCompressionScheme.ByteGroupingLZ4 + : XetChunkCompressionScheme.LZ4 + : XetChunkCompressionScheme.None; + xorb.data[xorb.offset + 5] = chunk.length & 0xff; + xorb.data[xorb.offset + 6] = (chunk.length >> 8) & 0xff; + xorb.data[xorb.offset + 7] = (chunk.length >> 16) & 0xff; + + xorb.data.set(chunkToWrite, xorb.offset + XET_CHUNK_HEADER_BYTES); + + xorb.chunks.push({ hash, length: chunk.length, offset: xorb.offset }); + xorb.offset += XET_CHUNK_HEADER_BYTES + chunkToWrite.length; + return true; +} + +// Build file representation from collected metadata +const buildFileRepresentation = ( + metadata: Array<{ xorbId: number | string; chunkIndex: number; length: number }>, + chunks: Array<{ hash: string; length: number }>, + computeVerificationHash: (hashes: string[]) => string, +): Array<{ + xorbId: number | string; + indexStart: number; + indexEnd: number; + length: number; + rangeHash: string; +}> => { + if (metadata.length === 0) { + return []; + } + + const representation: Array<{ + xorbId: number | string; + indexStart: number; + indexEnd: number; + length: number; + rangeHash: string; + }> = []; + + let currentRange = { + xorbId: metadata[0].xorbId, + indexStart: metadata[0].chunkIndex, + indexEnd: metadata[0].chunkIndex + 1, + length: metadata[0].length, + chunkHashStart: 0, + }; + + for (let i = 1; i < metadata.length; i++) { + const chunk = metadata[i]; + + // Check if this chunk continues the current range + if (currentRange.xorbId === chunk.xorbId && currentRange.indexEnd === chunk.chunkIndex) { + // Extend current range + currentRange.indexEnd = chunk.chunkIndex + 1; + currentRange.length += chunk.length; + } else { + // Finalize current range and start a new one + const rangeHash = computeVerificationHash(chunks.slice(currentRange.chunkHashStart, i).map((x) => x.hash)); + representation.push({ + xorbId: currentRange.xorbId, + indexStart: currentRange.indexStart, + indexEnd: currentRange.indexEnd, + length: currentRange.length, + rangeHash, + }); + + currentRange = { + xorbId: chunk.xorbId, + indexStart: chunk.chunkIndex, + indexEnd: chunk.chunkIndex + 1, + length: chunk.length, + chunkHashStart: i, + }; + } + } + + // Finalize the last range + const rangeHash = computeVerificationHash(chunks.slice(currentRange.chunkHashStart).map((x) => x.hash)); + representation.push({ + xorbId: currentRange.xorbId, + indexStart: currentRange.indexStart, + indexEnd: currentRange.indexEnd, + length: currentRange.length, + rangeHash, + }); + + return representation; +}; + +/** + * Helper to load dedup info for blob contents into cache. + * Processes the blob's contents, chunks it, and loads dedup info into cache without writing to xorb. + * + * For now this is optimized for when the replacement data is at the very beginning of the file + * + * todo: handle when it's not at the beginning of the file by backingtracking xorb contents + * todo: handle when it's not at the beginning of the file by using previous content to chunk at the same boundaries as it would have in the original file + */ +async function loadDedupInfoToCache( + content: Blob, + /** Will be mutated */ + remoteXorbHashes: string[], + params: XetWriteTokenParams, + chunkCache: ChunkCache, + // eslint-disable-next-line @typescript-eslint/consistent-type-imports + chunkModule: typeof import("../vendor/xet-chunk/chunker_wasm"), + + opts?: { + isAtBeginning?: boolean; + /** + * The end position of the content to process + * + * Will process content up to the end of the chunk after this position + */ + end?: number; + /** + * The maximum number of chunks to process + * + * Will process content up to the end of the chunk after this position + */ + maxChunks?: number; + }, +): Promise { + const chunker = new chunkModule.Chunker(TARGET_CHUNK_SIZE); + const cache = chunkCache; + + let dedupedBytes = 0; + let chunksProcessed = 0; + let totalBytes = 0; + let bytesSinceRemoteDedup = Infinity; + const sourceChunks: Array = []; + + try { + const reader = content.stream().getReader(); + + const processChunks = async (chunkData: Array<{ hash: string; length: number; dedup: boolean }>) => { + for (const chunk of chunkData) { + chunksProcessed++; + if (opts?.isAtBeginning && chunksProcessed === 1) { + chunk.dedup = true; + } + totalBytes += chunk.length; + + // Remove chunks from source data + removeChunkFromSourceData(sourceChunks, chunk.length); + + // Check if chunk is already in cache + let cacheData = cache.getChunk(chunk.hash, chunkModule.compute_hmac); + + // Early return if already cached - no need for remote lookup + if (cacheData !== undefined) { + dedupedBytes += chunk.length; + bytesSinceRemoteDedup += chunk.length; + continue; + } + + // Try remote dedup lookup if conditions are met + if (chunk.dedup && bytesSinceRemoteDedup >= INTERVAL_BETWEEN_REMOTE_DEDUP) { + const token = await xetWriteToken(params); + bytesSinceRemoteDedup = 0; + + const shardResp = await (params.fetch ?? fetch)(token.casUrl + "/v1/chunks/default/" + chunk.hash, { + headers: { + Authorization: `Bearer ${token.accessToken}`, + }, + }); + + if (shardResp.ok) { + const shard = await shardResp.blob(); + const shardData = await parseShardData(shard); + + // Load remote dedup info into cache + for (const xorb of shardData.xorbs) { + const remoteXorbId = -remoteXorbHashes.length; + remoteXorbHashes.push(xorb.hash); + let i = 0; + for (const xorbChunk of xorb.chunks) { + cache.addChunkToCache(xorbChunk.hash, remoteXorbId, i++, shardData.hmacKey); + } + } + cacheData = cache.getChunk(chunk.hash, chunkModule.compute_hmac); + } + } + + if (cacheData !== undefined) { + // Chunk found in cache after remote lookup - it's deduplicated + dedupedBytes += chunk.length; + } + + bytesSinceRemoteDedup += chunk.length; + } + }; + + // Read and process blob content + while (true) { + if (opts?.end !== undefined && totalBytes >= opts.end) { + break; + } + if (opts?.maxChunks !== undefined && chunksProcessed >= opts.maxChunks) { + break; + } + const { done, value } = await reader.read(); + if (done) { + await processChunks(chunker.finish()); + break; + } + sourceChunks.push(value); + await processChunks(chunker.add_data(value)); + } + } finally { + chunker.free(); + } +} diff --git a/node_modules/@huggingface/hub/src/utils/eventToGenerator.spec.ts b/node_modules/@huggingface/hub/src/utils/eventToGenerator.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..59ed182a4a2394f6662afeee1d4f42fe4692e0b5 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/eventToGenerator.spec.ts @@ -0,0 +1,44 @@ +import { describe, expect, it } from "vitest"; +import { eventToGenerator } from "./eventToGenerator"; + +describe("eventToGenerator", () => { + it("should handle synchronous events", async () => { + const it = eventToGenerator((yieldCallback, returnCallback) => { + yieldCallback(1); + yieldCallback(2); + returnCallback(3); + }); + + const results = []; + let res: IteratorResult; + do { + res = await it.next(); + if (!res.done) { + results.push(res.value); + } + } while (!res.done); + + expect(results).toEqual([1, 2]); + expect(res.value).toBe(3); + }); + + it("should handle asynchronous events", async () => { + const it = eventToGenerator((yieldCallback, returnCallback) => { + setTimeout(() => yieldCallback(1), 100); + setTimeout(() => yieldCallback(2), 200); + setTimeout(() => returnCallback(3), 300); + }); + + const results = []; + let res: IteratorResult; + do { + res = await it.next(); + if (!res.done) { + results.push(res.value); + } + } while (!res.done); + + expect(results).toEqual([1, 2]); + expect(res.value).toBe(3); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/eventToGenerator.ts b/node_modules/@huggingface/hub/src/utils/eventToGenerator.ts new file mode 100644 index 0000000000000000000000000000000000000000..1bbc84f997fe142cf2b22a80ba0927d3d11bbfc0 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/eventToGenerator.ts @@ -0,0 +1,64 @@ +export async function* eventToGenerator( + cb: ( + yieldCallback: (y: YieldType) => void, + returnCallback: (r: ReturnType) => void, + rejectCallack: (reason: unknown) => void, + ) => unknown, +): AsyncGenerator { + const promises: Array<{ + p: Promise<{ done: true; value: ReturnType } | { done: false; value: YieldType }>; + resolve: (value: { done: true; value: ReturnType } | { done: false; value: YieldType }) => void; + reject: (reason?: unknown) => void; + }> = []; + + function addPromise() { + let resolve: (value: { done: true; value: ReturnType } | { done: false; value: YieldType }) => void; + let reject: (reason?: unknown) => void; + const p = new Promise<{ done: true; value: ReturnType } | { done: false; value: YieldType }>((res, rej) => { + resolve = res; + reject = rej; + }); + // @ts-expect-error TS doesn't know that promise callback is executed immediately + promises.push({ p, resolve, reject }); + } + + addPromise(); + + const callbackRes = Promise.resolve() + .then(() => + cb( + (y) => { + addPromise(); + promises.at(-2)?.resolve({ done: false, value: y }); + }, + (r) => { + addPromise(); + promises.at(-2)?.resolve({ done: true, value: r }); + }, + (err) => promises.shift()?.reject(err), + ), + ) + .catch((err) => promises.shift()?.reject(err)); + + while (1) { + const p = promises[0]; + if (!p) { + throw new Error("Logic error in eventGenerator, promises should never be empty"); + } + const result = await p.p; + promises.shift(); + if (result.done) { + await callbackRes; // Clean up, may be removed in the future + // // Cleanup promises - shouldn't be needed due to above await + // for (const promise of promises) { + // promise.resolve(result); + // await promise.p; + // } + return result.value; + } + yield result.value; + } + + // So TS doesn't complain + throw new Error("Unreachable"); +} diff --git a/node_modules/@huggingface/hub/src/utils/hexFromBytes.ts b/node_modules/@huggingface/hub/src/utils/hexFromBytes.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6c331c09525a0906333e7007e5724858795aa35 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/hexFromBytes.ts @@ -0,0 +1,11 @@ +export function hexFromBytes(arr: Uint8Array): string { + if (globalThis.Buffer) { + return globalThis.Buffer.from(arr).toString("hex"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(byte.toString(16).padStart(2, "0")); + }); + return bin.join(""); + } +} diff --git a/node_modules/@huggingface/hub/src/utils/insecureRandomString.ts b/node_modules/@huggingface/hub/src/utils/insecureRandomString.ts new file mode 100644 index 0000000000000000000000000000000000000000..f9954d431b26374eb47d4b81f10a5837990a6e90 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/insecureRandomString.ts @@ -0,0 +1,3 @@ +export function insecureRandomString(): string { + return Math.random().toString(36).slice(2); +} diff --git a/node_modules/@huggingface/hub/src/utils/isBackend.ts b/node_modules/@huggingface/hub/src/utils/isBackend.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e6f27998645f2971dcdd92503d78de521273a26 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/isBackend.ts @@ -0,0 +1,6 @@ +const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + +const isWebWorker = + typeof self === "object" && self.constructor && self.constructor.name === "DedicatedWorkerGlobalScope"; + +export const isBackend = !isBrowser && !isWebWorker; diff --git a/node_modules/@huggingface/hub/src/utils/isFrontend.ts b/node_modules/@huggingface/hub/src/utils/isFrontend.ts new file mode 100644 index 0000000000000000000000000000000000000000..0b9bab392e71f315704c210bc0e8ff210379703d --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/isFrontend.ts @@ -0,0 +1,3 @@ +import { isBackend } from "./isBackend"; + +export const isFrontend = !isBackend; diff --git a/node_modules/@huggingface/hub/src/utils/mergeAsyncGenerators.spec.ts b/node_modules/@huggingface/hub/src/utils/mergeAsyncGenerators.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc1bfdc6d87a1a4b4283fd13e24852cb132926c2 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/mergeAsyncGenerators.spec.ts @@ -0,0 +1,94 @@ +import { describe, expect, it } from "vitest"; +import { mergeAsyncGenerators } from "./mergeAsyncGenerators"; +import { splitAsyncGenerator } from "./splitAsyncGenerator"; + +describe("mergeAsyncGenerators", () => { + const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + it("should merge multiple async generators", async () => { + const generator1 = (async function* () { + yield 1; + yield 2; + await sleep(250); + yield 3; + })(); + const generator2 = (async function* () { + await sleep(100); + yield 4; + yield 5; + yield 6; + })(); + const generator3 = (async function* () { + await sleep(200); + yield 7; + yield 8; + yield 9; + })(); + + const results: number[] = []; + + for await (const result of mergeAsyncGenerators([generator1, generator2, generator3])) { + results.push(result); + } + expect(results).toEqual([1, 2, 4, 5, 6, 7, 8, 9, 3]); + }); + + it("should merge multiple async generators from a single source", async () => { + const source = (async function* () { + yield 1; + yield 2; + yield 3; + yield 4; + yield 5; + yield 6; + yield 7; + yield 8; + yield 9; + })(); + const sources = splitAsyncGenerator(source, 3); + + const generator1 = (async function* () { + for await (const result of sources[0]) { + yield { result, gen: 1 }; + await sleep(100); + } + })(); + + const generator2 = (async function* () { + await sleep(50); + for await (const result of sources[1]) { + yield { result, gen: 2 }; + await sleep(100); + } + })(); + + const generator3 = (async function* () { + await sleep(80); + let count = 0; + for await (const result of sources[2]) { + yield { result, gen: 3 }; + count++; + + if (count >= 2) { + return; + } + } + })(); + + const results: { result: number; gen: number }[] = []; + for await (const result of mergeAsyncGenerators([generator1, generator2, generator3])) { + results.push(result); + } + expect(results.length).toBe(9); + expect(results).toEqual([ + { result: 1, gen: 1 }, + { result: 2, gen: 2 }, + { result: 3, gen: 3 }, + { result: 4, gen: 3 }, + { result: 5, gen: 1 }, + { result: 6, gen: 2 }, + { result: 7, gen: 1 }, + { result: 8, gen: 2 }, + { result: 9, gen: 1 }, + ]); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/mergeAsyncGenerators.ts b/node_modules/@huggingface/hub/src/utils/mergeAsyncGenerators.ts new file mode 100644 index 0000000000000000000000000000000000000000..984549f26c87046474c510565b81436e128355a1 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/mergeAsyncGenerators.ts @@ -0,0 +1,34 @@ +/** + * Merge outputs of multiple async generators. + */ +export async function* mergeAsyncGenerators(generators: AsyncGenerator[]): AsyncGenerator { + const executing: Promise<{ result: IteratorResult; gen: AsyncGenerator }>[] = []; + + const generatorSymbol = Symbol("generator"); + + for (const gen of generators) { + const p = gen.next().then((result) => ({ result, gen })); + Object.defineProperty(p, generatorSymbol, { + value: gen, + }); + executing.push(p); + } + + while (executing.length > 0) { + const next = await Promise.race(executing); + const { result, gen } = next; + + const index = executing.findIndex((p) => Object.getOwnPropertyDescriptor(p, generatorSymbol)?.value === gen); + + if (result.done) { + executing.splice(index, 1); + continue; + } + + yield result.value; + executing[index] = gen.next().then((result) => ({ result, gen })); + Object.defineProperty(executing[index], generatorSymbol, { + value: gen, + }); + } +} diff --git a/node_modules/@huggingface/hub/src/utils/normalizeInferenceProviderMapping.ts b/node_modules/@huggingface/hub/src/utils/normalizeInferenceProviderMapping.ts new file mode 100644 index 0000000000000000000000000000000000000000..471997f2de0cce1b826a18c5df6b7713bfa6be95 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/normalizeInferenceProviderMapping.ts @@ -0,0 +1,36 @@ +import type { WidgetType } from "@huggingface/tasks"; +import type { ApiModelInferenceProviderMappingEntry } from "../types/api/api-model"; + +/** + * Normalize inferenceProviderMapping to always return an array format. + * + * Little hack to simplify Inference Providers logic and make it backward and forward compatible. + * Right now, API returns a dict on model-info and a list on list-models. Let's harmonize to list. + */ +export function normalizeInferenceProviderMapping( + hfModelId: string, + inferenceProviderMapping?: + | ApiModelInferenceProviderMappingEntry[] + | Record, +): ApiModelInferenceProviderMappingEntry[] { + if (!inferenceProviderMapping) { + return []; + } + + // If it's already an array, return it as is + if (Array.isArray(inferenceProviderMapping)) { + return inferenceProviderMapping.map((entry) => ({ + ...entry, + hfModelId, + })); + } + + // Convert mapping to array format + return Object.entries(inferenceProviderMapping).map(([provider, mapping]) => ({ + provider, + hfModelId, + providerId: mapping.providerId, + status: mapping.status, + task: mapping.task, + })); +} diff --git a/node_modules/@huggingface/hub/src/utils/omit.ts b/node_modules/@huggingface/hub/src/utils/omit.ts new file mode 100644 index 0000000000000000000000000000000000000000..e37f54b8844415b1d0573ae51117906c2e339ccc --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/omit.ts @@ -0,0 +1,14 @@ +import { pick } from "./pick"; +import { typedInclude } from "./typedInclude"; + +/** + * Return copy of object, omitting blacklisted array of props + */ +export function omit, K extends keyof T>( + o: T, + props: K[] | K, +): Pick> { + const propsArr = Array.isArray(props) ? props : [props]; + const letsKeep = (Object.keys(o) as (keyof T)[]).filter((prop) => !typedInclude(propsArr, prop)); + return pick(o, letsKeep); +} diff --git a/node_modules/@huggingface/hub/src/utils/parseLinkHeader.ts b/node_modules/@huggingface/hub/src/utils/parseLinkHeader.ts new file mode 100644 index 0000000000000000000000000000000000000000..6939a89be6701240097f8b2f7f6c581b4ab6c739 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/parseLinkHeader.ts @@ -0,0 +1,8 @@ +/** + * Parse Link HTTP header, eg `; rel="next"` + */ +export function parseLinkHeader(header: string): Record { + const regex = /<(https?:[/][/][^>]+)>;\s+rel="([^"]+)"/g; + + return Object.fromEntries([...header.matchAll(regex)].map(([, url, rel]) => [rel, url])); +} diff --git a/node_modules/@huggingface/hub/src/utils/pick.ts b/node_modules/@huggingface/hub/src/utils/pick.ts new file mode 100644 index 0000000000000000000000000000000000000000..a47a57f861c00d3917d2065c49d09016a14b25e7 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/pick.ts @@ -0,0 +1,13 @@ +/** + * Return copy of object, only keeping whitelisted properties. + */ +export function pick(o: T, props: K[] | ReadonlyArray): Pick { + return Object.assign( + {}, + ...props.map((prop) => { + if (o[prop] !== undefined) { + return { [prop]: o[prop] }; + } + }), + ); +} diff --git a/node_modules/@huggingface/hub/src/utils/promisesQueue.spec.ts b/node_modules/@huggingface/hub/src/utils/promisesQueue.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e9ea6d124ff5cc290eb6aefffa4ce8148b3c46a --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/promisesQueue.spec.ts @@ -0,0 +1,48 @@ +import { describe, expect, it } from "vitest"; +import { promisesQueue } from "./promisesQueue"; + +describe("promisesQueue", () => { + it("should handle multiple errors without triggering an uncaughtException", async () => { + const factories = [ + () => Promise.reject(new Error("error 1")), + () => Promise.reject(new Error("error 2")), + () => Promise.reject(new Error("error 3")), + ]; + + try { + await promisesQueue(factories, 10); + } catch (err) { + if (!(err instanceof Error)) { + throw err; + } + } + + try { + await promisesQueue(factories, 1); + } catch (err) { + if (!(err instanceof Error)) { + throw err; + } + expect(err.message).toBe("error 1"); + } + }); + + it("should return ordered results", async () => { + const factories = [ + () => Promise.resolve(1), + () => Promise.resolve(2), + () => Promise.resolve(3), + () => Promise.resolve(4), + () => Promise.resolve(5), + () => Promise.resolve(6), + () => Promise.resolve(7), + () => Promise.resolve(8), + () => Promise.resolve(9), + () => Promise.resolve(10), + ]; + + const results = await promisesQueue(factories, 3); + + expect(results).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/promisesQueue.ts b/node_modules/@huggingface/hub/src/utils/promisesQueue.ts new file mode 100644 index 0000000000000000000000000000000000000000..35d2d06907e3aad537e96f99509297f79d5ee547 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/promisesQueue.ts @@ -0,0 +1,23 @@ +/** + * Execute queue of promises. + * + * Inspired by github.com/rxaviers/async-pool + */ +export async function promisesQueue(factories: (() => Promise)[], concurrency: number): Promise { + const results: T[] = []; + const executing: Set> = new Set(); + let index = 0; + for (const factory of factories) { + const closureIndex = index++; + const e = factory().then((r) => { + results[closureIndex] = r; + executing.delete(e); + }); + executing.add(e); + if (executing.size >= concurrency) { + await Promise.race(executing); + } + } + await Promise.all(executing); + return results; +} diff --git a/node_modules/@huggingface/hub/src/utils/promisesQueueStreaming.ts b/node_modules/@huggingface/hub/src/utils/promisesQueueStreaming.ts new file mode 100644 index 0000000000000000000000000000000000000000..72f441afbce2538c22b77a5a9d9e89f0d8e0ba22 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/promisesQueueStreaming.ts @@ -0,0 +1,25 @@ +/** + * Execute queue of promises in a streaming fashion. + * + * Optimized for streaming: + * - Expects an iterable as input + * - Does not return a list of all results + * + * Inspired by github.com/rxaviers/async-pool + */ +export async function promisesQueueStreaming( + factories: AsyncIterable<() => Promise> | Iterable<() => Promise>, + concurrency: number, +): Promise { + const executing: Promise[] = []; + for await (const factory of factories) { + const e = factory().then(() => { + executing.splice(executing.indexOf(e), 1); + }); + executing.push(e); + if (executing.length >= concurrency) { + await Promise.race(executing); + } + } + await Promise.all(executing); +} diff --git a/node_modules/@huggingface/hub/src/utils/range.ts b/node_modules/@huggingface/hub/src/utils/range.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7ebababf2ba06366899f5d192b08e849b708f9a --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/range.ts @@ -0,0 +1,13 @@ +/** + * One param: create list of integers from 0 (inclusive) to n (exclusive) + * Two params: create list of integers from a (inclusive) to b (exclusive) + */ +export function range(n: number, b?: number): number[] { + return b + ? Array(b - n) + .fill(0) + .map((_, i) => n + i) + : Array(n) + .fill(0) + .map((_, i) => i); +} diff --git a/node_modules/@huggingface/hub/src/utils/sha256-node.ts b/node_modules/@huggingface/hub/src/utils/sha256-node.ts new file mode 100644 index 0000000000000000000000000000000000000000..a7c75ad7765db2246c327de8fcc2d7096b68033f --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/sha256-node.ts @@ -0,0 +1,26 @@ +import { Readable } from "node:stream"; +import type { ReadableStream } from "node:stream/web"; +import { createHash } from "node:crypto"; + +export async function* sha256Node( + buffer: ArrayBuffer | Blob, + opts?: { + abortSignal?: AbortSignal; + }, +): AsyncGenerator { + const sha256Stream = createHash("sha256"); + const size = buffer instanceof Blob ? buffer.size : buffer.byteLength; + let done = 0; + const readable = + buffer instanceof Blob ? Readable.fromWeb(buffer.stream() as ReadableStream) : Readable.from(Buffer.from(buffer)); + + for await (const buffer of readable) { + sha256Stream.update(buffer); + done += buffer.length; + yield done / size; + + opts?.abortSignal?.throwIfAborted(); + } + + return sha256Stream.digest("hex"); +} diff --git a/node_modules/@huggingface/hub/src/utils/sha256.spec.ts b/node_modules/@huggingface/hub/src/utils/sha256.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e62b936b60d94debe9b91103f30eeedc1826712 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/sha256.spec.ts @@ -0,0 +1,50 @@ +import { describe, it, expect } from "vitest"; +import { sha256 } from "./sha256"; + +const smallContent = "hello world"; +const smallContentSHA256 = "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; +const bigContent = "O123456789".repeat(100_000); +const bigContentSHA256 = "a3bbce7ee1df7233d85b5f4d60faa3755f93f537804f8b540c72b0739239ddf8"; +const biggerContent = "0123456789".repeat(1_000_000); +const biggerContentSHA256 = "d52fcc26b48dbd4d79b125eb0a29b803ade07613c67ac7c6f2751aefef008486"; + +describe("sha256", () => { + async function calcSHA256(content: string, useWebWorker: boolean) { + const iterator = sha256(new Blob([content]), { useWebWorker }); + let res: IteratorResult; + do { + res = await iterator.next(); + } while (!res.done); + return res.value; + } + + it("Calculate hash of a small file", async () => { + const sha = await calcSHA256(smallContent, false); + expect(sha).toBe(smallContentSHA256); + }); + + it("Calculate hash of a big file", async () => { + const sha = await calcSHA256(bigContent, false); + expect(sha).toBe(bigContentSHA256); + }); + + it("Calculate hash of a bigger file", async () => { + const sha = await calcSHA256(biggerContent, false); + expect(sha).toBe(biggerContentSHA256); + }); + + it("Calculate hash of a small file (+ web worker)", async () => { + const sha = await calcSHA256(smallContent, true); + expect(sha).toBe(smallContentSHA256); + }); + + it("Calculate hash of a big file (+ web worker)", async () => { + const sha = await calcSHA256(bigContent, true); + expect(sha).toBe(bigContentSHA256); + }); + + it("Calculate hash of a bigger file (+ web worker)", async () => { + const sha = await calcSHA256(biggerContent, true); + expect(sha).toBe(biggerContentSHA256); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/sha256.ts b/node_modules/@huggingface/hub/src/utils/sha256.ts new file mode 100644 index 0000000000000000000000000000000000000000..0458d0495c3489e5f1bebf706282404b128c65dd --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/sha256.ts @@ -0,0 +1,206 @@ +import { eventToGenerator } from "./eventToGenerator"; +import { hexFromBytes } from "./hexFromBytes"; +import { isFrontend } from "./isFrontend"; + +async function getWebWorkerCode() { + const sha256Module = await import("../vendor/hash-wasm/sha256-wrapper"); + return URL.createObjectURL(new Blob([sha256Module.createSHA256WorkerCode()])); +} + +const pendingWorkers: Worker[] = []; +const runningWorkers: Set = new Set(); + +let resolve: () => void; +let waitPromise: Promise = new Promise((r) => { + resolve = r; +}); + +async function getWorker(poolSize?: number): Promise { + { + const worker = pendingWorkers.pop(); + if (worker) { + runningWorkers.add(worker); + return worker; + } + } + if (!poolSize) { + const worker = new Worker(await getWebWorkerCode()); + runningWorkers.add(worker); + return worker; + } + + if (poolSize <= 0) { + throw new TypeError("Invalid webworker pool size: " + poolSize); + } + + while (runningWorkers.size >= poolSize) { + await waitPromise; + } + + const worker = new Worker(await getWebWorkerCode()); + runningWorkers.add(worker); + return worker; +} + +async function freeWorker(worker: Worker, poolSize: number | undefined): Promise { + if (!poolSize) { + return destroyWorker(worker); + } + runningWorkers.delete(worker); + pendingWorkers.push(worker); + const r = resolve; + waitPromise = new Promise((r) => { + resolve = r; + }); + r(); +} + +function destroyWorker(worker: Worker): void { + runningWorkers.delete(worker); + worker.terminate(); + const r = resolve; + waitPromise = new Promise((r) => { + resolve = r; + }); + r(); +} + +/** + * @returns hex-encoded sha + * @yields progress (0-1) + */ +export async function* sha256( + buffer: Blob, + opts?: { useWebWorker?: boolean | { minSize?: number; poolSize?: number }; abortSignal?: AbortSignal }, +): AsyncGenerator { + yield 0; + + const maxCryptoSize = + typeof opts?.useWebWorker === "object" && opts?.useWebWorker.minSize !== undefined + ? opts.useWebWorker.minSize + : 10_000_000; + if (buffer.size < maxCryptoSize && globalThis.crypto?.subtle) { + const res = hexFromBytes( + new Uint8Array( + await globalThis.crypto.subtle.digest("SHA-256", buffer instanceof Blob ? await buffer.arrayBuffer() : buffer), + ), + ); + + yield 1; + + return res; + } + + if (isFrontend) { + if (opts?.useWebWorker) { + try { + const poolSize = typeof opts?.useWebWorker === "object" ? opts.useWebWorker.poolSize : undefined; + const worker = await getWorker(poolSize); + + // Define handlers to allow removal + let messageHandler: (event: MessageEvent) => void; + let errorHandler: (event: ErrorEvent) => void; + + const cleanup = () => { + worker.removeEventListener("message", messageHandler); + worker.removeEventListener("error", errorHandler); + }; + + return yield* eventToGenerator((yieldCallback, returnCallback, rejectCallback) => { + messageHandler = (event: MessageEvent) => { + if (event.data.sha256) { + cleanup(); + freeWorker(worker, poolSize); + returnCallback(event.data.sha256); + } else if (event.data.progress) { + yieldCallback(event.data.progress); + + try { + opts.abortSignal?.throwIfAborted(); + } catch (err) { + cleanup(); + destroyWorker(worker); + rejectCallback(err); + } + } else { + cleanup(); + destroyWorker(worker); + rejectCallback(event); + } + }; + + errorHandler = (event: ErrorEvent) => { + cleanup(); + destroyWorker(worker); + rejectCallback(event.error); + }; + + // Handle external abort signal if it aborts before any worker message + if (opts?.abortSignal) { + try { + opts.abortSignal?.throwIfAborted(); + } catch (err) { + cleanup(); + destroyWorker(worker); + rejectCallback(opts.abortSignal.reason ?? new DOMException("Aborted", "AbortError")); + return; + } + + const abortListener = () => { + cleanup(); + destroyWorker(worker); + + rejectCallback(opts.abortSignal?.reason ?? new DOMException("Aborted", "AbortError")); + opts.abortSignal?.removeEventListener("abort", abortListener); + }; + + opts.abortSignal.addEventListener("abort", abortListener); + } + + worker.addEventListener("message", messageHandler); + worker.addEventListener("error", errorHandler); + worker.postMessage({ file: buffer }); + }); + } catch (err) { + console.warn("Failed to use web worker for sha256", err); + } + } + if (!wasmModule) { + wasmModule = await import("../vendor/hash-wasm/sha256-wrapper"); + } + + const sha256 = await wasmModule.createSHA256(); + sha256.init(); + + const reader = buffer.stream().getReader(); + const total = buffer.size; + let bytesDone = 0; + + while (true) { + const { done, value } = await reader.read(); + + if (done) { + break; + } + + sha256.update(value); + bytesDone += value.length; + yield bytesDone / total; + + opts?.abortSignal?.throwIfAborted(); + } + + return sha256.digest("hex"); + } + + if (!cryptoModule) { + cryptoModule = await import("./sha256-node"); + } + + return yield* cryptoModule.sha256Node(buffer, { abortSignal: opts?.abortSignal }); +} + +// eslint-disable-next-line @typescript-eslint/consistent-type-imports +let cryptoModule: typeof import("./sha256-node"); +// eslint-disable-next-line @typescript-eslint/consistent-type-imports +let wasmModule: typeof import("../vendor/hash-wasm/sha256-wrapper"); diff --git a/node_modules/@huggingface/hub/src/utils/shardParser.spec.ts b/node_modules/@huggingface/hub/src/utils/shardParser.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8ace91439f295eaab5a73636e3cb84656dedb11 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/shardParser.spec.ts @@ -0,0 +1,27 @@ +import { parseShardData } from "./shardParser"; +import { readFile } from "fs/promises"; +import { expect, describe, it } from "vitest"; +import { init, compute_hmac } from "../vendor/xet-chunk/chunker_wasm"; + +describe("shardParser", () => { + it("should parse a shard", async () => { + const buffer = await readFile("tests/gpt2-64-8bits.tflite.shard"); + const shard = await parseShardData(new Blob([buffer])); + const expectedJson = JSON.parse(await readFile("tests/gpt2-64-8bits.tflite.shard.json", "utf-8")); + + expect(shard.hmacKey).toBe(expectedJson.hmac_key); + expect(shard.xorbs.length).toEqual(expectedJson.xorbs.length); + for (let i = 0; i < shard.xorbs.length; i++) { + expect(shard.xorbs[i].hash).toEqual(expectedJson.xorbs[i].hash); + expect(shard.xorbs[i].chunks.length).toEqual(expectedJson.xorbs[i].chunk_hashes.length); + for (let j = 0; j < shard.xorbs[i].chunks.length; j++) { + expect(shard.xorbs[i].chunks[j].hash).toEqual(expectedJson.xorbs[i].chunk_hashes[j]); + } + } + + await init(); + + const chunkHash = "9502eec19d4b0c9f7b389228fa801f68ecdf15d69ccd1da2f9ddbd0219898335"; + expect(compute_hmac(chunkHash, shard.hmacKey)).toEqual(shard.xorbs[1].chunks[0].hash); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/shardParser.ts b/node_modules/@huggingface/hub/src/utils/shardParser.ts new file mode 100644 index 0000000000000000000000000000000000000000..e1a45d40c9a4474db3b7758b72bf37aa6da67d21 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/shardParser.ts @@ -0,0 +1,149 @@ +import { SHARD_FOOTER_VERSION, SHARD_HEADER_VERSION, SHARD_MAGIC_TAG } from "./uploadShards"; + +const HASH_LENGTH = 32; +const XORB_HASH_BOOKEND = "ff".repeat(HASH_LENGTH); + +// Read 4 uint64 in little endian and convert to hex +function readHashFromArray(array: Uint8Array, offset: number): string { + let hash = ""; + for (let i = 0; i < HASH_LENGTH; i += 8) { + hash += `${array[offset + i + 7].toString(16).padStart(2, "0")}${array[offset + i + 6] + .toString(16) + .padStart(2, "0")}${array[offset + i + 5].toString(16).padStart(2, "0")}${array[offset + i + 4] + .toString(16) + .padStart(2, "0")}${array[offset + i + 3].toString(16).padStart(2, "0")}${array[offset + i + 2] + .toString(16) + .padStart(2, "0")}${array[offset + i + 1].toString(16).padStart(2, "0")}${array[offset + i] + .toString(16) + .padStart(2, "0")}`; + } + return hash; +} + +export interface ShardData { + hmacKey: string; + xorbs: Array<{ + hash: string; + chunks: Array<{ + hash: string; + startOffset: number; + unpackedLength: number; + }>; + }>; +} + +export async function parseShardData(shardBlob: Blob): Promise { + const shard = new Uint8Array(await shardBlob.arrayBuffer()); + const shardView = new DataView(shard.buffer); + + const magicTag = shard.slice(0, SHARD_MAGIC_TAG.length); + if (!magicTag.every((byte, i) => byte === SHARD_MAGIC_TAG[i])) { + throw new Error("Invalid shard magic tag"); + } + + const version = shardView.getBigUint64(SHARD_MAGIC_TAG.length, true); + if (version !== SHARD_HEADER_VERSION) { + throw new Error(`Invalid shard version: ${version}`); + } + + const footerSize = Number(shardView.getBigUint64(SHARD_MAGIC_TAG.length + 8, true)); + + // Read footer to get section offsets + const footerStart = shard.length - footerSize; + const footerVersion = shardView.getBigUint64(footerStart, true); + if (footerVersion !== SHARD_FOOTER_VERSION) { + throw new Error(`Invalid shard footer version: ${footerVersion}`); + } + + // version: u64, // Footer version (must be 1) + // file_info_offset: u64, // Offset to file info section + // cas_info_offset: u64, // Offset to CAS info section + // file_lookup_offset: u64, // Offset to file lookup table + // file_lookup_num_entry: u64, // Number of file lookup entries + // cas_lookup_offset: u64, // Offset to CAS lookup table + // cas_lookup_num_entry: u64, // Number of CAS lookup entries + // chunk_lookup_offset: u64, // Offset to chunk lookup table + // chunk_lookup_num_entry: u64, // Number of chunk lookup entries + // chunk_hash_hmac_key: [u64; 4], // HMAC key for chunk hashes (32 bytes) + // shard_creation_timestamp: u64, // Creation time (seconds since epoch) + // shard_key_expiry: u64, // Expiry time (seconds since epoch) + // _buffer: [u64; 6], // Reserved space (48 bytes) + // stored_bytes_on_disk: u64, // Total bytes stored on disk + // materialized_bytes: u64, // Total materialized bytes + // stored_bytes: u64, // Total stored bytes + // footer_offset: u64, + + // const fileInfoStart = Number(shardView.getBigUint64(footerStart + 8, true)); + const xorbInfoStart = Number(shardView.getBigUint64(footerStart + 16, true)); + const fileLookupStart = Number(shardView.getBigUint64(footerStart + 24, true)); + // const numFileLookups = Number(shardView.getBigUint64(footerStart + 32, true)); + // const xorbLookupStart = Number(shardView.getBigUint64(footerStart + 40, true)); + // const numXorbLookups = Number(shardView.getBigUint64(footerStart + 48, true)); + // const chunkLookupStart = Number(shardView.getBigUint64(footerStart + 56, true)); + // const numChunkLookups = Number(shardView.getBigUint64(footerStart + 64, true)); + const hmacKey = readHashFromArray(shard, footerStart + 72); + // const shardCreationTimestamp = Number(shardView.getBigUint64(footerStart + 104, true)); + // const shardKeyExpiry = Number(shardView.getBigUint64(footerStart + 112, true)); + // const storedBytesOnDisk = Number(shardView.getBigUint64(footerStart + 168, true)); + // const materializedBytes = Number(shardView.getBigUint64(footerStart + 176, true)); + // const storedBytes = Number(shardView.getBigUint64(footerStart + 184, true)); + // const footerOffset = Number(shardView.getBigUint64(footerStart + 192, true)); + + // Parse XORB Info Section + const xorbs: ShardData["xorbs"] = []; + let offset = xorbInfoStart; + + while (offset < fileLookupStart) { + // Read xorb entry + const xorbHash = readHashFromArray(shard, offset); + offset += HASH_LENGTH; + + if (xorbHash === XORB_HASH_BOOKEND) { + break; + } + + // const flags = shardView.getUint32(offset, true); + offset += 4; + + const chunkCount = shardView.getUint32(offset, true); + offset += 4; + + // const numBytesInXorb = shardView.getUint32(offset, true); + offset += 4; + + // const numBytesUnpacked = shardView.getUint32(offset, true); + offset += 4; + + // Read chunks for this xorb + const chunks: ShardData["xorbs"][number]["chunks"] = []; + for (let i = 0; i < chunkCount; i++) { + const chunkHash = readHashFromArray(shard, offset); + offset += HASH_LENGTH; + + const startOffset = shardView.getUint32(offset, true); + offset += 4; + + const length = shardView.getUint32(offset, true); + offset += 4; + + // Skip reserved 8 bytes + offset += 8; + + chunks.push({ + hash: chunkHash, + startOffset, + unpackedLength: length, + }); + } + + xorbs.push({ + hash: xorbHash, + chunks, + }); + } + + return { + hmacKey, + xorbs, + }; +} diff --git a/node_modules/@huggingface/hub/src/utils/splitAsyncGenerator.ts b/node_modules/@huggingface/hub/src/utils/splitAsyncGenerator.ts new file mode 100644 index 0000000000000000000000000000000000000000..b077e9abfcb476a5a5785a113fcf7e1098194daa --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/splitAsyncGenerator.ts @@ -0,0 +1,43 @@ +/** + * Split an async generator into multiple async generators, all drawing from the same source. + */ +export function splitAsyncGenerator(source: AsyncGenerator, n: number): Array> { + if (n <= 0) { + return []; + } + + const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + + let takenIndex: number | null = null; + const generators: AsyncGenerator[] = []; + let remaining = n; + for (let i = 0; i < n; i++) { + generators.push({ + next: async () => { + while (takenIndex !== null) { + await sleep(1); + } + takenIndex = i; + return source.next().then((r) => { + takenIndex = null; + return r; + }); + }, + return: async () => { + remaining--; + if (remaining === 0) { + return source.return(undefined); + } + return { + done: true, + value: undefined, + }; + }, + throw: async (error) => { + return source.throw(error); + }, + [Symbol.asyncIterator]: () => generators[i], + }); + } + return generators; +} diff --git a/node_modules/@huggingface/hub/src/utils/sub-paths.spec.ts b/node_modules/@huggingface/hub/src/utils/sub-paths.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..6dcb773ab7f106e8bcf1d09751ff01b1e0daceba --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/sub-paths.spec.ts @@ -0,0 +1,39 @@ +import { mkdir, writeFile } from "fs/promises"; +import { tmpdir } from "os"; +import { describe, expect, it } from "vitest"; +import { subPaths } from "./sub-paths"; +import { pathToFileURL } from "url"; + +describe("sub-paths", () => { + it("should retrieve all sub-paths of a directory", async () => { + const tmpDir = tmpdir(); + + await mkdir(`${tmpDir}/test-dir/sub`, { recursive: true }); + + await writeFile(`${tmpDir}/test-dir/sub/file1.txt`, "file1"); + await writeFile(`${tmpDir}/test-dir/sub/file2.txt`, "file2"); + await writeFile(`${tmpDir}/test-dir/file3.txt`, "file3"); + await writeFile(`${tmpDir}/test-dir/file4.txt`, "file4"); + const result = await subPaths(pathToFileURL(`${tmpDir}/test-dir`)); + + expect(result).toEqual([ + { + path: pathToFileURL(`${tmpDir}/test-dir/file3.txt`), + relativePath: "file3.txt", + }, + { + path: pathToFileURL(`${tmpDir}/test-dir/file4.txt`), + relativePath: "file4.txt", + }, + + { + path: pathToFileURL(`${tmpDir}/test-dir/sub/file1.txt`), + relativePath: "sub/file1.txt", + }, + { + path: pathToFileURL(`${tmpDir}/test-dir/sub/file2.txt`), + relativePath: "sub/file2.txt", + }, + ]); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/sub-paths.ts b/node_modules/@huggingface/hub/src/utils/sub-paths.ts new file mode 100644 index 0000000000000000000000000000000000000000..c15e73393ad2a78e782e5f6b5eb0d1e37d6e9a6f --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/sub-paths.ts @@ -0,0 +1,38 @@ +import { readdir, stat } from "node:fs/promises"; +import { fileURLToPath, pathToFileURL } from "node:url"; + +/** + * Recursively retrieves all sub-paths of a given directory up to a specified depth. + */ +export async function subPaths( + path: URL, + maxDepth = 10, +): Promise< + Array<{ + path: URL; + relativePath: string; + }> +> { + const state = await stat(path); + if (!state.isDirectory()) { + return [{ path, relativePath: "." }]; + } + + const files = await readdir(path, { withFileTypes: true }); + const ret: Array<{ path: URL; relativePath: string }> = []; + for (const file of files) { + const filePath = pathToFileURL(fileURLToPath(path) + "/" + file.name); + if (file.isDirectory()) { + ret.push( + ...(await subPaths(filePath, maxDepth - 1)).map((subPath) => ({ + ...subPath, + relativePath: `${file.name}/${subPath.relativePath}`, + })), + ); + } else { + ret.push({ path: filePath, relativePath: file.name }); + } + } + + return ret; +} diff --git a/node_modules/@huggingface/hub/src/utils/sum.ts b/node_modules/@huggingface/hub/src/utils/sum.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d3fe6f15960f0f373a4b8669cace09c41c4b02f --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/sum.ts @@ -0,0 +1,6 @@ +/** + * Sum of elements in array + */ +export function sum(arr: number[]): number { + return arr.reduce((a, b) => a + b, 0); +} diff --git a/node_modules/@huggingface/hub/src/utils/symlink.spec.ts b/node_modules/@huggingface/hub/src/utils/symlink.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..56edaf4f33c170389d4799cdec7b9c59686f1a63 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/symlink.spec.ts @@ -0,0 +1,89 @@ +/* eslint-disable @typescript-eslint/consistent-type-imports */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { describe, expect, it, vi } from "vitest"; +import { createSymlink } from "./symlink"; +import { readFileSync, writeFileSync } from "node:fs"; +import { lstat, rm } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; + +let failSymlink = false; +vi.mock("node:fs/promises", async (importOriginal) => ({ + ...(await importOriginal()), + symlink: async (...args: any[]) => { + if (failSymlink) { + failSymlink = false; + throw new Error("Symlink not supported"); + } + + // @ts-expect-error - ignore + return (await importOriginal()).symlink(...args); + }, +})); + +describe("utils/symlink", () => { + it("should create a symlink", async () => { + writeFileSync(join(tmpdir(), "test.txt"), "hello world"); + await createSymlink({ + sourcePath: join(tmpdir(), "test.txt"), + finalPath: join(tmpdir(), "test-symlink.txt"), + }); + + const stats = await lstat(join(tmpdir(), "test-symlink.txt")); + expect(stats.isSymbolicLink()).toBe(process.platform !== "win32"); + + // Test file content + const content = readFileSync(join(tmpdir(), "test-symlink.txt"), "utf8"); + expect(content).toBe("hello world"); + + // Cleanup + await rm(join(tmpdir(), "test-symlink.txt")); + await rm(join(tmpdir(), "test.txt")); + }); + + it("should work when symlinking twice", async () => { + writeFileSync(join(tmpdir(), "test.txt"), "hello world"); + writeFileSync(join(tmpdir(), "test2.txt"), "hello world2"); + await createSymlink({ + sourcePath: join(tmpdir(), "test.txt"), + finalPath: join(tmpdir(), "test-symlink.txt"), + }); + await createSymlink({ + sourcePath: join(tmpdir(), "test2.txt"), + finalPath: join(tmpdir(), "test-symlink.txt"), + }); + + const stats = await lstat(join(tmpdir(), "test-symlink.txt")); + expect(stats.isSymbolicLink()).toBe(process.platform !== "win32"); + + // Test file content + const content = readFileSync(join(tmpdir(), "test-symlink.txt"), "utf8"); + expect(content).toBe("hello world2"); + + // Cleanup + await rm(join(tmpdir(), "test-symlink.txt")); + await rm(join(tmpdir(), "test.txt")); + await rm(join(tmpdir(), "test2.txt")); + }); + + it("should work when symlink doesn't work (windows)", async () => { + writeFileSync(join(tmpdir(), "test.txt"), "hello world"); + + failSymlink = true; + await createSymlink({ + sourcePath: join(tmpdir(), "test.txt"), + finalPath: join(tmpdir(), "test-symlink.txt"), + }); + + const stats = await lstat(join(tmpdir(), "test-symlink.txt")); + expect(stats.isSymbolicLink()).toBe(false); + + // Test file content + const content = readFileSync(join(tmpdir(), "test-symlink.txt"), "utf8"); + expect(content).toBe("hello world"); + + // Cleanup + await rm(join(tmpdir(), "test-symlink.txt")); + await rm(join(tmpdir(), "test.txt")); + }); +}); diff --git a/node_modules/@huggingface/hub/src/utils/symlink.ts b/node_modules/@huggingface/hub/src/utils/symlink.ts new file mode 100644 index 0000000000000000000000000000000000000000..17cedf66ad17629435dcd492238fc9a258068961 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/symlink.ts @@ -0,0 +1,65 @@ +/** + * Heavily inspired by https://github.com/huggingface/huggingface_hub/blob/fcfd14361bd03f23f82efced1aa65a7cbfa4b922/src/huggingface_hub/file_download.py#L517 + */ + +import * as fs from "node:fs/promises"; +import * as path from "node:path"; +import * as os from "node:os"; + +function expandUser(path: string): string { + if (path.startsWith("~")) { + return path.replace("~", os.homedir()); + } + return path; +} + +/** + * Create a symbolic link named dst pointing to src. + * + * By default, it will try to create a symlink using a relative path. Relative paths have 2 advantages: + * - If the cache_folder is moved (example: back-up on a shared drive), relative paths within the cache folder will + * not break. + * - Relative paths seems to be better handled on Windows. Issue was reported 3 times in less than a week when + * changing from relative to absolute paths. See https://github.com/huggingface/huggingface_hub/issues/1398, + * https://github.com/huggingface/diffusers/issues/2729 and https://github.com/huggingface/transformers/pull/22228. + * NOTE: The issue with absolute paths doesn't happen on admin mode. + * When creating a symlink from the cache to a local folder, it is possible that a relative path cannot be created. + * This happens when paths are not on the same volume. In that case, we use absolute paths. + * + * The result layout looks something like + * └── [ 128] snapshots + * ├── [ 128] 2439f60ef33a0d46d85da5001d52aeda5b00ce9f + * │ ├── [ 52] README.md -> ../../../blobs/d7edf6bd2a681fb0175f7735299831ee1b22b812 + * │ └── [ 76] pytorch_model.bin -> ../../../blobs/403450e234d65943a7dcf7e05a771ce3c92faa84dd07db4ac20f592037a1e4bd + * + * If symlinks cannot be created on this platform (most likely to be Windows), the workaround is to avoid symlinks by + * having the actual file in `dst`. If it is a new file (`new_blob=True`), we move it to `dst`. If it is not a new file + * (`new_blob=False`), we don't know if the blob file is already referenced elsewhere. To avoid breaking existing + * cache, the file is duplicated on the disk. + */ +export async function createSymlink(params: { + /** + * The path to the symlink. + */ + finalPath: string; + /** + * The path the symlink should point to. + */ + sourcePath: string; +}): Promise { + const abs_src = path.resolve(expandUser(params.sourcePath)); + const abs_dst = path.resolve(expandUser(params.finalPath)); + + try { + await fs.rm(abs_dst); + } catch { + // ignore + } + + try { + await fs.symlink(path.relative(path.dirname(abs_dst), abs_src), abs_dst); + } catch { + console.info(`Symlink not supported. Copying file from ${abs_src} to ${abs_dst}`); + await fs.copyFile(abs_src, abs_dst); + } +} diff --git a/node_modules/@huggingface/hub/src/utils/toRepoId.ts b/node_modules/@huggingface/hub/src/utils/toRepoId.ts new file mode 100644 index 0000000000000000000000000000000000000000..9b6934f8600520d269244af2017be0cf7a6ee1d1 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/toRepoId.ts @@ -0,0 +1,69 @@ +import type { RepoDesignation, RepoId } from "../types/public"; + +export function toRepoId(repo: RepoDesignation): RepoId { + if (typeof repo !== "string") { + return repo; + } + + if (repo.startsWith("model/") || repo.startsWith("models/")) { + throw new TypeError( + "A repo designation for a model should not start with 'models/', directly specify the model namespace / name", + ); + } + + if (repo.startsWith("space/")) { + throw new TypeError("Spaces should start with 'spaces/', plural, not 'space/'"); + } + + if (repo.startsWith("dataset/")) { + throw new TypeError("Datasets should start with 'datasets/', plural, not 'dataset/'"); + } + + if (repo.startsWith("bucket/")) { + throw new TypeError("Buckets should start with 'buckets/', plural, not 'bucket/'"); + } + + const slashes = repo.split("/").length - 1; + + if (repo.startsWith("spaces/")) { + if (slashes !== 2) { + throw new TypeError("Space Id must include namespace and name of the space"); + } + + return { + type: "space", + name: repo.slice("spaces/".length), + }; + } + + if (repo.startsWith("datasets/")) { + if (slashes > 2) { + throw new TypeError("Too many slashes in repo designation: " + repo); + } + + return { + type: "dataset", + name: repo.slice("datasets/".length), + }; + } + + if (repo.startsWith("buckets/")) { + if (slashes !== 2) { + throw new TypeError("Bucket Id must include namespace and name of the bucket"); + } + + return { + type: "bucket", + name: repo.slice("buckets/".length), + }; + } + + if (slashes > 1) { + throw new TypeError("Too many slashes in repo designation: " + repo); + } + + return { + type: "model", + name: repo, + }; +} diff --git a/node_modules/@huggingface/hub/src/utils/typedEntries.ts b/node_modules/@huggingface/hub/src/utils/typedEntries.ts new file mode 100644 index 0000000000000000000000000000000000000000..031ba7daa0cc381ce650224c040f67261fbd56c3 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/typedEntries.ts @@ -0,0 +1,5 @@ +import type { Entries } from "../vendor/type-fest/entries"; + +export function typedEntries>(obj: T): Entries { + return Object.entries(obj) as Entries; +} diff --git a/node_modules/@huggingface/hub/src/utils/typedInclude.ts b/node_modules/@huggingface/hub/src/utils/typedInclude.ts new file mode 100644 index 0000000000000000000000000000000000000000..71e2f7a7e111995a744589dd34cb090d9743ea16 --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/typedInclude.ts @@ -0,0 +1,3 @@ +export function typedInclude(arr: readonly T[], v: V): v is T { + return arr.includes(v as T); +} diff --git a/node_modules/@huggingface/hub/src/utils/uploadShards.ts b/node_modules/@huggingface/hub/src/utils/uploadShards.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d631a7c6f160935515d563e1d1ecc9ff757abde --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/uploadShards.ts @@ -0,0 +1,428 @@ +import { createApiError } from "../error"; +import type { RepoId } from "../types/public"; +import { createXorbs } from "./createXorbs"; +import { sum } from "./sum"; +import { xetWriteToken } from "./xetWriteToken"; + +const SHARD_MAX_SIZE = 64 * 1024 * 1024; +const SHARD_HEADER_SIZE = 48; +const SHARD_FOOTER_SIZE = 200; +const HASH_LENGTH = 32; +const XORB_FOOTER_LENGTH = 48; +const FILE_FOOTER_LENGTH = 48; +export const SHARD_HEADER_VERSION = 2n; +export const SHARD_FOOTER_VERSION = 1n; + +const MDB_FILE_FLAG_WITH_VERIFICATION = 0x80000000; // Cannot define as 1 << 31 because it becomes a negative number +const MDB_FILE_FLAG_WITH_METADATA_EXT = 0x40000000; + +const EMPTY_HEX_HASH = "0".repeat(HASH_LENGTH * 2); + +export const SHARD_MAGIC_TAG = new Uint8Array([ + "H".charCodeAt(0), + "F".charCodeAt(0), + "R".charCodeAt(0), + "e".charCodeAt(0), + "p".charCodeAt(0), + "o".charCodeAt(0), + "M".charCodeAt(0), + "e".charCodeAt(0), + "t".charCodeAt(0), + "a".charCodeAt(0), + "D".charCodeAt(0), + "a".charCodeAt(0), + "t".charCodeAt(0), + "a".charCodeAt(0), + 0, + 85, + 105, + 103, + 69, + 106, + 123, + 129, + 87, + 131, + 165, + 189, + 217, + 92, + 205, + 209, + 74, + 169, +]); + +export interface XetTokenParams { + sessionId?: string; + casUrl?: string; + accessToken?: string; + expiresAt?: Date; + refreshWriteTokenUrl: string; +} + +interface UploadShardsParams { + accessToken: string | undefined; + hubUrl: string; + xetParams: XetTokenParams; + fetch?: typeof fetch; + repo: RepoId; + rev: string; + isPullRequest?: boolean; + yieldCallback?: (event: { event: "fileProgress"; path: string; progress: number }) => void; +} + +/** + * Outputs the file sha256 after their xorbs/shards have been uploaded. + */ +export async function* uploadShards( + source: AsyncGenerator<{ content: Blob; path: string; sha256?: string }>, + params: UploadShardsParams, +): AsyncGenerator< + | { + event: "file"; + path: string; + xetHash: string; + sha256: string | undefined; + dedupRatio: number; + } + | { event: "fileProgress"; path: string; progress: number } +> { + const xorbHashes: Array = []; + + const fileInfoSection = new Uint8Array(Math.floor(SHARD_MAX_SIZE - SHARD_HEADER_SIZE - SHARD_FOOTER_SIZE) * 0.25); + const xorbInfoSection = new Uint8Array(Math.floor(SHARD_MAX_SIZE - SHARD_HEADER_SIZE - SHARD_FOOTER_SIZE) * 0.75); + + const xorbView = new DataView(xorbInfoSection.buffer); + let xorbViewOffset = 0; + const fileInfoView = new DataView(fileInfoSection.buffer); + let fileViewOffset = 0; + let xorbTotalSize = 0n; + let fileTotalSize = 0n; + let xorbTotalUnpackedSize = 0n; + + for await (const output of createXorbs(source, params)) { + switch (output.event) { + case "xorb": { + xorbHashes.push(output.hash); + + // Calculate space needed for this xorb entry + const xorbEntrySize = HASH_LENGTH + 4 + 4 + 4 + 4; // hash + flags + count + unpacked + packed + const chunksSize = output.chunks.length * (HASH_LENGTH + 4 + 4 + 8); // per chunk: hash + length + offset + reserved + const totalXorbSize = xorbEntrySize + chunksSize; + + // Check if adding this xorb would exceed buffer capacity + if (xorbViewOffset + totalXorbSize > xorbInfoSection.length) { + // Upload current shard and reset buffers + if (xorbViewOffset > 0 || fileViewOffset > 0) { + await uploadShard(createShard(), params); + } + } + + // todo: handle when going out of bounds + writeHashToArray(output.hash, xorbInfoSection, xorbViewOffset); + xorbViewOffset += HASH_LENGTH; + xorbView.setUint32(xorbViewOffset, 0, true); // flags + xorbViewOffset += 4; + xorbView.setUint32(xorbViewOffset, output.chunks.length, true); + xorbViewOffset += 4; + const xorbUnpackedSize = sum(output.chunks.map((x) => x.length)); + xorbView.setUint32(xorbViewOffset, xorbUnpackedSize, true); + xorbTotalUnpackedSize += BigInt(xorbUnpackedSize); + xorbTotalSize += BigInt(output.xorb.byteLength); + xorbViewOffset += 4; + xorbView.setUint32(xorbViewOffset, output.xorb.byteLength, true); + xorbViewOffset += 4; + + let chunkBytes = 0; + for (const chunk of output.chunks) { + writeHashToArray(chunk.hash, xorbInfoSection, xorbViewOffset); + xorbViewOffset += HASH_LENGTH; + // start offset + xorbView.setUint32(xorbViewOffset, chunkBytes, true); + xorbViewOffset += 4; + // chunk length + xorbView.setUint32(xorbViewOffset, chunk.length, true); + xorbViewOffset += 4; + xorbView.setBigUint64(xorbViewOffset, 0n, true); // reserved + xorbViewOffset += 8; + chunkBytes += chunk.length; + } + + for (const file of output.files) { + yield { + event: "fileProgress", + path: file.path, + progress: file.lastSentProgress, + }; + } + + await uploadXorb(output, params); + //^ Todo: queue it and do not await it + + for (const file of output.files) { + yield { event: "fileProgress", path: file.path, progress: file.progress }; + } + break; + } + case "file": { + yield { + event: "file", + path: output.path, + xetHash: output.hash, + sha256: output.sha256, + dedupRatio: output.dedupRatio, + }; // Maybe wait until shard is uploaded before yielding. + + // Calculate space needed for this file entry + const fileHeaderSize = HASH_LENGTH + 4 + 4 + 8; // hash + flags + rep length + reserved + const representationSize = output.representation.length * (HASH_LENGTH + 4 + 4 + 4 + 4); // per rep: xorb hash + flags + length + offset + endOffset + const verificationSize = output.representation.length * (HASH_LENGTH + 16); // per rep: range hash + reserved + const metadataSize = HASH_LENGTH + 16; // sha256 + reserved + const totalFileSize = fileHeaderSize + representationSize + verificationSize + metadataSize; + + // Check if adding this file would exceed buffer capacity + if (fileViewOffset + totalFileSize > fileInfoSection.length) { + // Upload current shard and reset buffers + if (xorbViewOffset > 0 || fileViewOffset > 0) { + await uploadShard(createShard(), params); + } + } + + writeHashToArray(output.hash, fileInfoSection, fileViewOffset); + fileViewOffset += HASH_LENGTH; + // Cannot use | binary operator since it works with int32 not uint32 and one of the flags is 1 << 31 + fileInfoView.setUint32(fileViewOffset, MDB_FILE_FLAG_WITH_METADATA_EXT + MDB_FILE_FLAG_WITH_VERIFICATION, true); + fileViewOffset += 4; + fileInfoView.setUint32(fileViewOffset, output.representation.length, true); + fileViewOffset += 4; + fileInfoView.setBigUint64(fileViewOffset, 0n, true); // reserved + fileViewOffset += 8; + + for (const repItem of output.representation) { + writeHashToArray( + typeof repItem.xorbId === "number" ? xorbHashes[repItem.xorbId] : repItem.xorbId, + fileInfoSection, + fileViewOffset, + ); + fileViewOffset += HASH_LENGTH; + fileInfoView.setUint32(fileViewOffset, 0, true); // Xorb flags + fileViewOffset += 4; + fileInfoView.setUint32(fileViewOffset, repItem.length, true); + fileViewOffset += 4; + fileInfoView.setUint32(fileViewOffset, repItem.indexStart, true); + fileViewOffset += 4; + fileInfoView.setUint32(fileViewOffset, repItem.indexEnd, true); + fileViewOffset += 4; + } + + // File verification data + for (const repItem of output.representation) { + writeHashToArray(repItem.rangeHash, fileInfoSection, fileViewOffset); + fileViewOffset += HASH_LENGTH; + // reserved in file verification data + for (let i = 0; i < 16; i++) { + fileInfoSection[fileViewOffset + i] = 0; + } + fileViewOffset += 16; + } + + // File metadata ext + writeHashToArray(output.sha256 ?? EMPTY_HEX_HASH, fileInfoSection, fileViewOffset); + fileViewOffset += HASH_LENGTH; + + // reserved in file metadata ext + for (let i = 0; i < 16; i++) { + fileInfoSection[fileViewOffset + i] = 0; + } + fileViewOffset += 16; + + break; + } + } + } + + function createShard(): Uint8Array { + const shard = new Uint8Array( + SHARD_HEADER_SIZE + SHARD_FOOTER_SIZE + xorbViewOffset + XORB_FOOTER_LENGTH + fileViewOffset + FILE_FOOTER_LENGTH, + ); + + const shardView = new DataView(shard.buffer); + let shardOffset = 0; + + // Header + shard.set(SHARD_MAGIC_TAG, shardOffset); + shardOffset += SHARD_MAGIC_TAG.length; + + shardView.setBigUint64(shardOffset, SHARD_HEADER_VERSION, true); + shardOffset += 8; + + shardView.setBigUint64(shardOffset, BigInt(SHARD_FOOTER_SIZE), true); + shardOffset += 8; + + // File Info Section + shard.set(fileInfoSection.slice(0, fileViewOffset), shardOffset); + shardOffset += fileViewOffset; + + // File info bookend + for (let i = 0; i < 32; i++) { + shard[shardOffset + i] = 0xff; + } + shardOffset += 32; + for (let i = 0; i < 16; i++) { + shard[shardOffset + i] = 0; + } + shardOffset += 16; + + // XORB Info Section + const xorbInfoOffset = shardOffset; + shard.set(xorbInfoSection.slice(0, xorbViewOffset), shardOffset); + shardOffset += xorbViewOffset; + + // Xorb info bookend + for (let i = 0; i < 32; i++) { + shard[shardOffset + i] = 0xff; + } + shardOffset += 32; + for (let i = 0; i < 16; i++) { + shard[shardOffset + i] = 0; + } + shardOffset += 16; + + // Footer + const footerOffset = shardOffset; + + // version: u64, // Footer version (must be 1) + // file_info_offset: u64, // Offset to file info section + // cas_info_offset: u64, // Offset to CAS info section + // reserved 48 bytes + // chunk_hash_hmac_key: [u64; 4], // HMAC key for chunk hashes (32 bytes) + // shard_creation_timestamp: u64, // Creation time (seconds since epoch) + // shard_key_expiry: u64, // Expiry time (seconds since epoch) + // _buffer: [u64; 6], // Reserved space (48 bytes) + // stored_bytes_on_disk: u64, // Total bytes stored on disk + // materialized_bytes: u64, // Total materialized bytes + // stored_bytes: u64, // Total stored bytes + // footer_offset: u64, + + shardView.setBigUint64(shardOffset, SHARD_FOOTER_VERSION, true); + shardOffset += 8; + shardView.setBigUint64(shardOffset, BigInt(SHARD_HEADER_SIZE), true); // beginning of fileinfo section + shardOffset += 8; + shardView.setBigUint64(shardOffset, BigInt(xorbInfoOffset), true); // beginning of xorbinfo section + shardOffset += 8; + + for (let i = 0; i < 48; i++) { + shardView.setUint8(shardOffset + i, 0); + } + shardOffset += 48; + + // Chunk HMAC + for (let i = 0; i < 32; i++) { + shardView.setUint8(shardOffset + i, 0); + } + shardOffset += 32; + + shardView.setBigUint64(shardOffset, BigInt(Math.floor(Date.now() / 1000)), true); + shardOffset += 8; + + // Shard key expiration + shardView.setBigUint64(shardOffset, 0n, true); + shardOffset += 8; + + // Reserved space (48 bytes) + for (let i = 0; i < 48; i++) { + shardView.setUint8(shardOffset + i, 0); + } + shardOffset += 48; + + shardView.setBigUint64(shardOffset, xorbTotalSize, true); + shardOffset += 8; + + shardView.setBigUint64(shardOffset, fileTotalSize, true); + shardOffset += 8; + + shardView.setBigUint64(shardOffset, xorbTotalUnpackedSize, true); + shardOffset += 8; + + shardView.setBigUint64(shardOffset, BigInt(footerOffset), true); + + xorbViewOffset = 0; + fileViewOffset = 0; + xorbTotalSize = 0n; + xorbTotalUnpackedSize = 0n; + fileTotalSize = 0n; + + return shard; + } + + // If un-uploaded data remains, upload it + if (xorbViewOffset || fileViewOffset) { + await uploadShard(createShard(), params); + } +} + +// Todo: switch from hex to non-hex when WASM switches. For now consider hash is hex +function writeHashToArray(hash: string, array: Uint8Array, offset: number) { + for (let i = 0; i < hash.length; i += 16) { + // Write a uint64 in little endian + array[offset + i / 2] = parseInt(hash.substring(i + 2 * 7, i + 2 * 8), 16); + array[offset + i / 2 + 1] = parseInt(hash.substring(i + 2 * 6, i + 2 * 7), 16); + array[offset + i / 2 + 2] = parseInt(hash.substring(i + 2 * 5, i + 2 * 6), 16); + array[offset + i / 2 + 3] = parseInt(hash.substring(i + 2 * 4, i + 2 * 5), 16); + array[offset + i / 2 + 4] = parseInt(hash.substring(i + 2 * 3, i + 2 * 4), 16); + array[offset + i / 2 + 5] = parseInt(hash.substring(i + 2 * 2, i + 2 * 3), 16); + array[offset + i / 2 + 6] = parseInt(hash.substring(i + 2 * 1, i + 2 * 2), 16); + array[offset + i / 2 + 7] = parseInt(hash.substring(i + 2 * 0, i + 2 * 1), 16); + } +} + +async function uploadXorb( + xorb: { hash: string; xorb: Uint8Array; files: Array<{ path: string; progress: number; lastSentProgress: number }> }, + params: UploadShardsParams, +) { + const token = await xetWriteToken(params); + + const resp = await (params.fetch ?? fetch)(`${token.casUrl}/v1/xorbs/default/${xorb.hash}`, { + method: "POST", + body: xorb.xorb, + headers: { + Authorization: `Bearer ${token.accessToken}`, + ...(params.xetParams.sessionId ? { "X-Xet-Session-Id": params.xetParams.sessionId } : {}), + }, + ...{ + progressHint: { + progressCallback: (progress: number) => { + for (const file of xorb.files) { + params.yieldCallback?.({ + event: "fileProgress", + path: file.path, + progress: file.lastSentProgress + (file.progress - file.lastSentProgress) * progress, + }); + } + }, + }, + }, + }); + + if (!resp.ok) { + throw await createApiError(resp); + } +} + +async function uploadShard(shard: Uint8Array, params: UploadShardsParams) { + const token = await xetWriteToken(params); + + const resp = await (params.fetch ?? fetch)(`${token.casUrl}/v1/shards`, { + method: "POST", + body: shard, + headers: { + Authorization: `Bearer ${token.accessToken}`, + ...(params.xetParams.sessionId ? { "X-Xet-Session-Id": params.xetParams.sessionId } : {}), + }, + }); + + if (!resp.ok) { + throw await createApiError(resp); + } +} diff --git a/node_modules/@huggingface/hub/src/utils/xetWriteToken.ts b/node_modules/@huggingface/hub/src/utils/xetWriteToken.ts new file mode 100644 index 0000000000000000000000000000000000000000..e877dc55ae288c930572fdbac9bfbaff6ae41ace --- /dev/null +++ b/node_modules/@huggingface/hub/src/utils/xetWriteToken.ts @@ -0,0 +1,98 @@ +import { createApiError } from "../error"; +import type { XetTokenParams } from "./uploadShards"; + +export interface XetWriteTokenParams { + accessToken: string | undefined; + fetch?: typeof fetch; + xetParams: XetTokenParams; +} + +const JWT_SAFETY_PERIOD = 60_000; +const JWT_CACHE_SIZE = 1_000; + +const jwtPromises: Map> = new Map(); +/** + * Cache to store JWTs, to avoid making many auth requests when downloading multiple files from the same repo + */ +const jwts: Map< + string, + { + accessToken: string; + expiresAt: Date; + casUrl: string; + } +> = new Map(); + +export async function xetWriteToken(params: XetWriteTokenParams): Promise<{ accessToken: string; casUrl: string }> { + if ( + params.xetParams.expiresAt && + params.xetParams.casUrl && + params.xetParams.accessToken && + params.xetParams.expiresAt > new Date(Date.now() + JWT_SAFETY_PERIOD) + ) { + return { accessToken: params.xetParams.accessToken, casUrl: params.xetParams.casUrl }; + } + const key = params.xetParams.refreshWriteTokenUrl; + + const jwt = jwts.get(key); + + if (jwt && jwt.expiresAt > new Date(Date.now() + JWT_SAFETY_PERIOD)) { + return { accessToken: jwt.accessToken, casUrl: jwt.casUrl }; + } + + // If we already have a promise for this repo, return it + const existingPromise = jwtPromises.get(key); + if (existingPromise) { + return existingPromise; + } + + const promise = (async () => { + const resp = await (params.fetch ?? fetch)(params.xetParams.refreshWriteTokenUrl, { + headers: { + ...(params.accessToken + ? { + Authorization: `Bearer ${params.accessToken}`, + } + : {}), + ...(params.xetParams.sessionId ? { "X-Xet-Session-Id": params.xetParams.sessionId } : {}), + }, + }); + + if (!resp.ok) { + throw await createApiError(resp); + } + + const json: { accessToken: string; casUrl: string; exp: number } = await resp.json(); + const jwt = { + accessToken: json.accessToken, + expiresAt: new Date(json.exp * 1000), + casUrl: json.casUrl, + }; + + jwtPromises.delete(key); + + for (const [key, value] of jwts.entries()) { + if (value.expiresAt < new Date(Date.now() + JWT_SAFETY_PERIOD)) { + jwts.delete(key); + } else { + break; + } + } + if (jwts.size >= JWT_CACHE_SIZE) { + const keyToDelete = jwts.keys().next().value; + if (keyToDelete) { + jwts.delete(keyToDelete); + } + } + jwts.set(key, jwt); + + return { + accessToken: json.accessToken, + casUrl: json.casUrl, + }; + })(); + + jwtPromises.set(key, promise); + + return promise; +} diff --git a/node_modules/@huggingface/hub/src/vendor/hash-wasm/LICENSE b/node_modules/@huggingface/hub/src/vendor/hash-wasm/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..689ccbe872a76ddfeb0196e0e4b9d60d67480220 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/hash-wasm/LICENSE @@ -0,0 +1,39 @@ +MIT License + +Copyright (c) 2020 Dani Biró + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Embedded C implementations might use other, similarly permissive licenses. +Check the beginning of the files from the /src directory. + +Special thank you to the authors of original C algorithms: + +- Alexander Peslyak +- Aleksey Kravchenko +- Colin Percival +- Stephan Brumme +- Steve Reid +- Samuel Neves +- Solar Designer +- Project Nayuki +- ARM Limited +- Yanbo Li dreamfly281@gmail.com, goldboar@163.comYanbo Li +- Mark Adler +- Yann Collet diff --git a/node_modules/@huggingface/hub/src/vendor/hash-wasm/build.sh b/node_modules/@huggingface/hub/src/vendor/hash-wasm/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..18424dfbc296bf3418e77fce35fbde5298a4a6a3 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/hash-wasm/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd $CURRENT_PATH + +# Clean up +docker kill hash-wasm-builder +docker rm hash-wasm-builder + +# Start container +docker run -it -d --name hash-wasm-builder emscripten/emsdk:3.1.55 bash + +# Copy & compile +docker exec hash-wasm-builder bash -c "mkdir /source" +docker cp ./sha256.c hash-wasm-builder:/source +docker exec hash-wasm-builder bash -c "\ + cd /source && \ + emcc sha256.c -o sha256.js -msimd128 -sSINGLE_FILE -sMODULARIZE=1 -sENVIRONMENT=web,worker -sEXPORTED_FUNCTIONS=_Hash_Init,_Hash_Update,_Hash_Final,_GetBufferPtr -sFILESYSTEM=0 -fno-rtti -fno-exceptions -O1 -sMODULARIZE=1 -sEXPORT_ES6=1 \ + " +# Patch "_scriptDir" variable +docker exec hash-wasm-builder bash -c "\ + cd /source && \ + sed -i 's\var _scriptDir\var _unused\g' ./sha256.js && \ + sed -i 's\_scriptDir\false\g' ./sha256.js \ + " + +# Copy back compiled file +docker cp hash-wasm-builder:/source/sha256.js . + + +# Clean up +docker kill hash-wasm-builder +docker rm hash-wasm-builder diff --git a/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256-wrapper.ts b/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256-wrapper.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a897696ed4af0dc0a03c9b3d968f9b10aab1f23 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256-wrapper.ts @@ -0,0 +1,62 @@ +import WasmModule from "./sha256"; + +export async function createSHA256(isInsideWorker = false): Promise<{ + init(): void; + update(data: Uint8Array): void; + digest(method: "hex"): string; +}> { + const BUFFER_MAX_SIZE = 8 * 1024 * 1024; + const wasm: Awaited> = isInsideWorker + ? // @ts-expect-error WasmModule will be populated inside self object + await self["SHA256WasmModule"]() + : await WasmModule(); + const heap = wasm.HEAPU8.subarray(wasm._GetBufferPtr()); + return { + init() { + wasm._Hash_Init(256); + }, + update(data: Uint8Array) { + let byteUsed = 0; + while (byteUsed < data.byteLength) { + const bytesLeft = data.byteLength - byteUsed; + const length = Math.min(bytesLeft, BUFFER_MAX_SIZE); + heap.set(data.subarray(byteUsed, byteUsed + length)); + wasm._Hash_Update(length); + byteUsed += length; + } + }, + digest(method: "hex") { + if (method !== "hex") { + throw new Error("Only digest hex is supported"); + } + wasm._Hash_Final(); + const result = Array.from(heap.slice(0, 32)); + return result.map((b) => b.toString(16).padStart(2, "0")).join(""); + }, + }; +} + +export function createSHA256WorkerCode(): string { + return ` + self.addEventListener('message', async (event) => { + const { file } = event.data; + const sha256 = await self.createSHA256(true); + sha256.init(); + const reader = file.stream().getReader(); + const total = file.size; + let bytesDone = 0; + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + sha256.update(value); + bytesDone += value.length; + postMessage({ progress: bytesDone / total }); + } + postMessage({ sha256: sha256.digest('hex') }); + }); + self.SHA256WasmModule = ${WasmModule.toString()}; + self.createSHA256 = ${createSHA256.toString()}; + `; +} diff --git a/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.c b/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.c new file mode 100644 index 0000000000000000000000000000000000000000..b8c0cb7eaf322cb4f74c42908f2d2542e5894233 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.c @@ -0,0 +1,432 @@ +/* sha256.c - an implementation of SHA-256/224 hash functions + * based on FIPS 180-3 (Federal Information Processing Standart). + * + * Copyright (c) 2010, Aleksey Kravchenko + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + + * Modified for hash-wasm by Dani Biró + */ + +#define WITH_BUFFER + + +////////////////////////////////////////////////////////////////////////// + +#include +#include + +#ifndef NULL +#define NULL 0 +#endif + +#ifdef _MSC_VER +#define WASM_EXPORT +#define __inline__ +#else +#define WASM_EXPORT __attribute__((visibility("default"))) +#endif + +#ifdef WITH_BUFFER + +#define MAIN_BUFFER_SIZE 8 * 1024 * 1024 +alignas(128) uint8_t main_buffer[MAIN_BUFFER_SIZE]; + +WASM_EXPORT +uint8_t *Hash_GetBuffer() { + return main_buffer; +} + +#endif + +// Sometimes LLVM emits these functions during the optimization step +// even with -nostdlib -fno-builtin flags +static __inline__ void* memcpy(void* dst, const void* src, uint32_t cnt) { + uint8_t *destination = dst; + const uint8_t *source = src; + while (cnt) { + *(destination++)= *(source++); + --cnt; + } + return dst; +} + +static __inline__ void* memset(void* dst, const uint8_t value, uint32_t cnt) { + uint8_t *p = dst; + while (cnt--) { + *p++ = value; + } + return dst; +} + +static __inline__ void* memcpy2(void* dst, const void* src, uint32_t cnt) { + uint64_t *destination64 = dst; + const uint64_t *source64 = src; + while (cnt >= 8) { + *(destination64++)= *(source64++); + cnt -= 8; + } + + uint8_t *destination = (uint8_t*)destination64; + const uint8_t *source = (uint8_t*)source64; + while (cnt) { + *(destination++)= *(source++); + --cnt; + } + return dst; +} + +static __inline__ void memcpy16(void* dst, const void* src) { + uint64_t* dst64 = (uint64_t*)dst; + uint64_t* src64 = (uint64_t*)src; + + dst64[0] = src64[0]; + dst64[1] = src64[1]; +} + +static __inline__ void memcpy32(void* dst, const void* src) { + uint64_t* dst64 = (uint64_t*)dst; + uint64_t* src64 = (uint64_t*)src; + + #pragma clang loop unroll(full) + for (int i = 0; i < 4; i++) { + dst64[i] = src64[i]; + } +} + +static __inline__ void memcpy64(void* dst, const void* src) { + uint64_t* dst64 = (uint64_t*)dst; + uint64_t* src64 = (uint64_t*)src; + + #pragma clang loop unroll(full) + for (int i = 0; i < 8; i++) { + dst64[i] = src64[i]; + } +} + +static __inline__ uint64_t widen8to64(const uint8_t value) { + return value | (value << 8) | (value << 16) | (value << 24); +} + +static __inline__ void memset16(void* dst, const uint8_t value) { + uint64_t val = widen8to64(value); + uint64_t* dst64 = (uint64_t*)dst; + + dst64[0] = val; + dst64[1] = val; +} + +static __inline__ void memset32(void* dst, const uint8_t value) { + uint64_t val = widen8to64(value); + uint64_t* dst64 = (uint64_t*)dst; + + #pragma clang loop unroll(full) + for (int i = 0; i < 4; i++) { + dst64[i] = val; + } +} + +static __inline__ void memset64(void* dst, const uint8_t value) { + uint64_t val = widen8to64(value); + uint64_t* dst64 = (uint64_t*)dst; + + #pragma clang loop unroll(full) + for (int i = 0; i < 8; i++) { + dst64[i] = val; + } +} + +static __inline__ void memset128(void* dst, const uint8_t value) { + uint64_t val = widen8to64(value); + uint64_t* dst64 = (uint64_t*)dst; + + #pragma clang loop unroll(full) + for (int i = 0; i < 16; i++) { + dst64[i] = val; + } +} + + +////////////////////////////////////////////////////////////////////////// + +#define sha256_block_size 64 +#define sha256_hash_size 32 +#define sha224_hash_size 28 +#define ROTR32(dword, n) ((dword) >> (n) ^ ((dword) << (32 - (n)))) +#define bswap_32(x) __builtin_bswap32(x) + +struct sha256_ctx { + uint32_t message[16]; /* 512-bit buffer for leftovers */ + uint64_t length; /* number of processed bytes */ + uint32_t hash[8]; /* 256-bit algorithm internal hashing state */ + uint32_t digest_length; /* length of the algorithm digest in bytes */ +}; + +struct sha256_ctx sctx; +struct sha256_ctx* ctx = &sctx; + +/* SHA-224 and SHA-256 constants for 64 rounds. These words represent + * the first 32 bits of the fractional parts of the cube + * roots of the first 64 prime numbers. */ +static const uint32_t rhash_k256[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, + 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, + 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, + 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, + 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, + 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + +/* The SHA256/224 functions defined by FIPS 180-3, 4.1.2 */ +/* Optimized version of Ch(x,y,z)=((x & y) | (~x & z)) */ +#define Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +/* Optimized version of Maj(x,y,z)=((x & y) ^ (x & z) ^ (y & z)) */ +#define Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) + +#define Sigma0(x) (ROTR32((x), 2) ^ ROTR32((x), 13) ^ ROTR32((x), 22)) +#define Sigma1(x) (ROTR32((x), 6) ^ ROTR32((x), 11) ^ ROTR32((x), 25)) +#define sigma0(x) (ROTR32((x), 7) ^ ROTR32((x), 18) ^ ((x) >> 3)) +#define sigma1(x) (ROTR32((x), 17) ^ ROTR32((x), 19) ^ ((x) >> 10)) + +/* Recalculate element n-th of circular buffer W using formula + * W[n] = sigma1(W[n - 2]) + W[n - 7] + sigma0(W[n - 15]) + W[n - 16]; */ +#define RECALCULATE_W(W, n) \ + (W[n] += \ + (sigma1(W[(n - 2) & 15]) + W[(n - 7) & 15] + sigma0(W[(n - 15) & 15]))) + +#define ROUND(a, b, c, d, e, f, g, h, k, data) \ + { \ + uint32_t T1 = h + Sigma1(e) + Ch(e, f, g) + k + (data); \ + d += T1, h = T1 + Sigma0(a) + Maj(a, b, c); \ + } +#define ROUND_1_16(a, b, c, d, e, f, g, h, n) \ + ROUND(a, b, c, d, e, f, g, h, rhash_k256[n], W[n] = bswap_32(block[n])) +#define ROUND_17_64(a, b, c, d, e, f, g, h, n) \ + ROUND(a, b, c, d, e, f, g, h, k[n], RECALCULATE_W(W, n)) + +/** + * Initialize context before calculaing hash. + * + */ +void sha256_init() { + /* Initial values. These words were obtained by taking the first 32 + * bits of the fractional parts of the square roots of the first + * eight prime numbers. */ + static const uint32_t SHA256_H0[8] = { + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 + }; + + ctx->length = 0; + ctx->digest_length = sha256_hash_size; + + /* initialize algorithm state */ + + #pragma clang loop vectorize(enable) + for (uint8_t i = 0; i < 8; i += 2) { + *(uint64_t*)&ctx->hash[i] = *(uint64_t*)&SHA256_H0[i]; + } +} + +/** + * Initialize context before calculaing hash. + * + */ +void sha224_init() { + /* Initial values from FIPS 180-3. These words were obtained by taking + * bits from 33th to 64th of the fractional parts of the square + * roots of ninth through sixteenth prime numbers. */ + static const uint32_t SHA224_H0[8] = { + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + }; + + ctx->length = 0; + ctx->digest_length = sha224_hash_size; + + #pragma clang loop vectorize(enable) + for (uint8_t i = 0; i < 8; i += 2) { + *(uint64_t*)&ctx->hash[i] = *(uint64_t*)&SHA224_H0[i]; + } +} + +/** + * The core transformation. Process a 512-bit block. + * + * @param hash algorithm state + * @param block the message block to process + */ +static void sha256_process_block(uint32_t hash[8], uint32_t block[16]) { + uint32_t A, B, C, D, E, F, G, H; + uint32_t W[16]; + const uint32_t* k; + int i; + + A = hash[0], B = hash[1], C = hash[2], D = hash[3]; + E = hash[4], F = hash[5], G = hash[6], H = hash[7]; + + /* Compute SHA using alternate Method: FIPS 180-3 6.1.3 */ + ROUND_1_16(A, B, C, D, E, F, G, H, 0); + ROUND_1_16(H, A, B, C, D, E, F, G, 1); + ROUND_1_16(G, H, A, B, C, D, E, F, 2); + ROUND_1_16(F, G, H, A, B, C, D, E, 3); + ROUND_1_16(E, F, G, H, A, B, C, D, 4); + ROUND_1_16(D, E, F, G, H, A, B, C, 5); + ROUND_1_16(C, D, E, F, G, H, A, B, 6); + ROUND_1_16(B, C, D, E, F, G, H, A, 7); + ROUND_1_16(A, B, C, D, E, F, G, H, 8); + ROUND_1_16(H, A, B, C, D, E, F, G, 9); + ROUND_1_16(G, H, A, B, C, D, E, F, 10); + ROUND_1_16(F, G, H, A, B, C, D, E, 11); + ROUND_1_16(E, F, G, H, A, B, C, D, 12); + ROUND_1_16(D, E, F, G, H, A, B, C, 13); + ROUND_1_16(C, D, E, F, G, H, A, B, 14); + ROUND_1_16(B, C, D, E, F, G, H, A, 15); + + #pragma clang loop vectorize(enable) + for (i = 16, k = &rhash_k256[16]; i < 64; i += 16, k += 16) { + ROUND_17_64(A, B, C, D, E, F, G, H, 0); + ROUND_17_64(H, A, B, C, D, E, F, G, 1); + ROUND_17_64(G, H, A, B, C, D, E, F, 2); + ROUND_17_64(F, G, H, A, B, C, D, E, 3); + ROUND_17_64(E, F, G, H, A, B, C, D, 4); + ROUND_17_64(D, E, F, G, H, A, B, C, 5); + ROUND_17_64(C, D, E, F, G, H, A, B, 6); + ROUND_17_64(B, C, D, E, F, G, H, A, 7); + ROUND_17_64(A, B, C, D, E, F, G, H, 8); + ROUND_17_64(H, A, B, C, D, E, F, G, 9); + ROUND_17_64(G, H, A, B, C, D, E, F, 10); + ROUND_17_64(F, G, H, A, B, C, D, E, 11); + ROUND_17_64(E, F, G, H, A, B, C, D, 12); + ROUND_17_64(D, E, F, G, H, A, B, C, 13); + ROUND_17_64(C, D, E, F, G, H, A, B, 14); + ROUND_17_64(B, C, D, E, F, G, H, A, 15); + } + + hash[0] += A, hash[1] += B, hash[2] += C, hash[3] += D; + hash[4] += E, hash[5] += F, hash[6] += G, hash[7] += H; +} + +/** + * Calculate message hash. + * Can be called repeatedly with chunks of the message to be hashed. + * + * @param size length of the message chunk + */ +WASM_EXPORT +void Hash_Update(uint32_t size) { + const uint8_t* msg = main_buffer; + uint32_t index = (uint32_t)ctx->length & 63; + ctx->length += size; + + /* fill partial block */ + if (index) { + uint32_t left = sha256_block_size - index; + uint32_t end = size < left ? size : left; + uint8_t* message8 = (uint8_t*)ctx->message; + for (uint8_t i = 0; i < end; i++) { + *(message8 + index + i) = msg[i]; + } + if (size < left) return; + + /* process partial block */ + sha256_process_block(ctx->hash, (uint32_t*)ctx->message); + msg += left; + size -= left; + } + + while (size >= sha256_block_size) { + uint32_t* aligned_message_block = (uint32_t*)msg; + + sha256_process_block(ctx->hash, aligned_message_block); + msg += sha256_block_size; + size -= sha256_block_size; + } + + if (size) { + /* save leftovers */ + for (uint8_t i = 0; i < size; i++) { + *(((uint8_t*)ctx->message) + i) = msg[i]; + } + } +} + +/** + * Store calculated hash into the given array. + * + */ +WASM_EXPORT +void Hash_Final() { + uint32_t index = ((uint32_t)ctx->length & 63) >> 2; + uint32_t shift = ((uint32_t)ctx->length & 3) * 8; + + /* pad message and run for last block */ + + /* append the byte 0x80 to the message */ + ctx->message[index] &= ~(0xFFFFFFFFu << shift); + ctx->message[index++] ^= 0x80u << shift; + + /* if no room left in the message to store 64-bit message length */ + if (index > 14) { + /* then fill the rest with zeros and process it */ + while (index < 16) { + ctx->message[index++] = 0; + } + sha256_process_block(ctx->hash, ctx->message); + index = 0; + } + + while (index < 14) { + ctx->message[index++] = 0; + } + + ctx->message[14] = bswap_32((uint32_t)(ctx->length >> 29)); + ctx->message[15] = bswap_32((uint32_t)(ctx->length << 3)); + sha256_process_block(ctx->hash, ctx->message); + + #pragma clang loop vectorize(enable) + for (int32_t i = 7; i >= 0; i--) { + ctx->hash[i] = bswap_32(ctx->hash[i]); + } + + for (uint8_t i = 0; i < ctx->digest_length; i++) { + main_buffer[i] = *(((uint8_t*)ctx->hash) + i); + } +} + +WASM_EXPORT +uint32_t Hash_Init(uint32_t bits) { + if (bits == 224) { + sha224_init(); + } else { + sha256_init(); + } + return 0; +} + +WASM_EXPORT +const uint32_t STATE_SIZE = sizeof(*ctx); + +WASM_EXPORT +uint8_t* Hash_GetState() { + return (uint8_t*) ctx; +} + +WASM_EXPORT +uint32_t GetBufferPtr() { + return (uint32_t) main_buffer; +} diff --git a/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.d.ts b/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b6d0f51481360ced2c39d6140091d7da6681f150 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.d.ts @@ -0,0 +1,8 @@ +declare function Module(): Promise<{ + HEAPU8: Uint8Array; + _Hash_Init(type: number): void; + _Hash_Update(length: number): void; + _Hash_Final(): void; + _GetBufferPtr(): number; +}>; +export default Module; diff --git a/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.js b/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.js new file mode 100644 index 0000000000000000000000000000000000000000..7ff85e582d49404ba7565cef5428115398baac3f --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/hash-wasm/sha256.js @@ -0,0 +1,685 @@ + +var Module = (() => { + var _unused = import.meta.url; + + return ( +function(moduleArg = {}) { + +// include: shell.js +// The Module object: Our interface to the outside world. We import +// and export values on it. There are various ways Module can be used: +// 1. Not defined. We create it here +// 2. A function parameter, function(Module) { ..generated code.. } +// 3. pre-run appended it, var Module = {}; ..generated code.. +// 4. External script tag defines var Module. +// We need to check if Module already exists (e.g. case 3 above). +// Substitution will be replaced with actual code on later stage of the build, +// this way Closure Compiler will not mangle it (e.g. case 4. above). +// Note that if you want to run closure, and also to use Module +// after the generated code, you will need to define var Module = {}; +// before the code. Then that object will be used in the code, and you +// can continue to use Module afterwards as well. +var Module = moduleArg; + +// Set up the promise that indicates the Module is initialized +var readyPromiseResolve, readyPromiseReject; +Module['ready'] = new Promise((resolve, reject) => { + readyPromiseResolve = resolve; + readyPromiseReject = reject; +}); + +// --pre-jses are emitted after the Module integration code, so that they can +// refer to Module (if they choose; they can also define Module) + + +// Sometimes an existing Module object exists with properties +// meant to overwrite the default module functionality. Here +// we collect those properties and reapply _after_ we configure +// the current environment's defaults to avoid having to be so +// defensive during initialization. +var moduleOverrides = Object.assign({}, Module); + +var arguments_ = []; +var thisProgram = './this.program'; +var quit_ = (status, toThrow) => { + throw toThrow; +}; + +// Determine the runtime environment we are in. You can customize this by +// setting the ENVIRONMENT setting at compile time (see settings.js). + +// Attempt to auto-detect the environment +var ENVIRONMENT_IS_WEB = typeof window == 'object'; +var ENVIRONMENT_IS_WORKER = typeof importScripts == 'function'; +// N.b. Electron.js environment is simultaneously a NODE-environment, but +// also a web environment. +var ENVIRONMENT_IS_NODE = typeof process == 'object' && typeof process.versions == 'object' && typeof process.versions.node == 'string'; +var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; + +// `/` should be present at the end if `scriptDirectory` is not empty +var scriptDirectory = ''; +function locateFile(path) { + if (Module['locateFile']) { + return Module['locateFile'](path, scriptDirectory); + } + return scriptDirectory + path; +} + +// Hooks that are implemented differently in different runtime environments. +var read_, + readAsync, + readBinary; + +// Note that this includes Node.js workers when relevant (pthreads is enabled). +// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and +// ENVIRONMENT_IS_NODE. +if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled + scriptDirectory = self.location.href; + } else if (typeof document != 'undefined' && document.currentScript) { // web + scriptDirectory = document.currentScript.src; + } + // When MODULARIZE, this JS may be executed later, after document.currentScript + // is gone, so we saved it, and we use it here instead of any other info. + if (false) { + scriptDirectory = false; + } + // blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them. + // otherwise, slice off the final part of the url to find the script directory. + // if scriptDirectory does not contain a slash, lastIndexOf will return -1, + // and scriptDirectory will correctly be replaced with an empty string. + // If scriptDirectory contains a query (starting with ?) or a fragment (starting with #), + // they are removed because they could contain a slash. + if (scriptDirectory.startsWith('blob:')) { + scriptDirectory = ''; + } else { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, '').lastIndexOf('/')+1); + } + + // Differentiate the Web Worker from the Node Worker case, as reading must + // be done differently. + { +// include: web_or_worker_shell_read.js +read_ = (url) => { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.send(null); + return xhr.responseText; + } + + if (ENVIRONMENT_IS_WORKER) { + readBinary = (url) => { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, false); + xhr.responseType = 'arraybuffer'; + xhr.send(null); + return new Uint8Array(/** @type{!ArrayBuffer} */(xhr.response)); + }; + } + + readAsync = (url, onload, onerror) => { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'arraybuffer'; + xhr.onload = () => { + if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0 + onload(xhr.response); + return; + } + onerror(); + }; + xhr.onerror = onerror; + xhr.send(null); + } + +// end include: web_or_worker_shell_read.js + } +} else +{ +} + +var out = Module['print'] || console.log.bind(console); +var err = Module['printErr'] || console.error.bind(console); + +// Merge back in the overrides +Object.assign(Module, moduleOverrides); +// Free the object hierarchy contained in the overrides, this lets the GC +// reclaim data used. +moduleOverrides = null; + +// Emit code to handle expected values on the Module object. This applies Module.x +// to the proper local x. This has two benefits: first, we only emit it if it is +// expected to arrive, and second, by using a local everywhere else that can be +// minified. + +if (Module['arguments']) arguments_ = Module['arguments']; + +if (Module['thisProgram']) thisProgram = Module['thisProgram']; + +if (Module['quit']) quit_ = Module['quit']; + +// perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message +// end include: shell.js + +// include: preamble.js +// === Preamble library stuff === + +// Documentation for the public APIs defined in this file must be updated in: +// site/source/docs/api_reference/preamble.js.rst +// A prebuilt local version of the documentation is available at: +// site/build/text/docs/api_reference/preamble.js.txt +// You can also build docs locally as HTML or other formats in site/ +// An online HTML version (which may be of a different version of Emscripten) +// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html + +var wasmBinary; +if (Module['wasmBinary']) wasmBinary = Module['wasmBinary']; + +if (typeof WebAssembly != 'object') { + abort('no native wasm support detected'); +} + +// include: base64Utils.js +// Converts a string of base64 into a byte array (Uint8Array). +function intArrayFromBase64(s) { + + var decoded = atob(s); + var bytes = new Uint8Array(decoded.length); + for (var i = 0 ; i < decoded.length ; ++i) { + bytes[i] = decoded.charCodeAt(i); + } + return bytes; +} + +// If filename is a base64 data URI, parses and returns data (Buffer on node, +// Uint8Array otherwise). If filename is not a base64 data URI, returns undefined. +function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); +} +// end include: base64Utils.js +// Wasm globals + +var wasmMemory; + +//======================================== +// Runtime essentials +//======================================== + +// whether we are quitting the application. no code should run after this. +// set in exit() and abort() +var ABORT = false; + +// set by exit() and abort(). Passed to 'onExit' handler. +// NOTE: This is also used as the process return code code in shell environments +// but only when noExitRuntime is false. +var EXITSTATUS; + +// In STRICT mode, we only define assert() when ASSERTIONS is set. i.e. we +// don't define it at all in release modes. This matches the behaviour of +// MINIMAL_RUNTIME. +// TODO(sbc): Make this the default even without STRICT enabled. +/** @type {function(*, string=)} */ +function assert(condition, text) { + if (!condition) { + // This build was created without ASSERTIONS defined. `assert()` should not + // ever be called in this configuration but in case there are callers in + // the wild leave this simple abort() implementation here for now. + abort(text); + } +} + +// Memory management + +var HEAP, +/** @type {!Int8Array} */ + HEAP8, +/** @type {!Uint8Array} */ + HEAPU8, +/** @type {!Int16Array} */ + HEAP16, +/** @type {!Uint16Array} */ + HEAPU16, +/** @type {!Int32Array} */ + HEAP32, +/** @type {!Uint32Array} */ + HEAPU32, +/** @type {!Float32Array} */ + HEAPF32, +/** @type {!Float64Array} */ + HEAPF64; + +// include: runtime_shared.js +function updateMemoryViews() { + var b = wasmMemory.buffer; + Module['HEAP8'] = HEAP8 = new Int8Array(b); + Module['HEAP16'] = HEAP16 = new Int16Array(b); + Module['HEAPU8'] = HEAPU8 = new Uint8Array(b); + Module['HEAPU16'] = HEAPU16 = new Uint16Array(b); + Module['HEAP32'] = HEAP32 = new Int32Array(b); + Module['HEAPU32'] = HEAPU32 = new Uint32Array(b); + Module['HEAPF32'] = HEAPF32 = new Float32Array(b); + Module['HEAPF64'] = HEAPF64 = new Float64Array(b); +} +// end include: runtime_shared.js +// include: runtime_stack_check.js +// end include: runtime_stack_check.js +// include: runtime_assertions.js +// end include: runtime_assertions.js +var __ATPRERUN__ = []; // functions called before the runtime is initialized +var __ATINIT__ = []; // functions called during startup +var __ATEXIT__ = []; // functions called during shutdown +var __ATPOSTRUN__ = []; // functions called after the main() is called + +var runtimeInitialized = false; + +function preRun() { + if (Module['preRun']) { + if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']]; + while (Module['preRun'].length) { + addOnPreRun(Module['preRun'].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); +} + +function initRuntime() { + runtimeInitialized = true; + + + callRuntimeCallbacks(__ATINIT__); +} + +function postRun() { + + if (Module['postRun']) { + if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']]; + while (Module['postRun'].length) { + addOnPostRun(Module['postRun'].shift()); + } + } + + callRuntimeCallbacks(__ATPOSTRUN__); +} + +function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); +} + +function addOnInit(cb) { + __ATINIT__.unshift(cb); +} + +function addOnExit(cb) { +} + +function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); +} + +// include: runtime_math.js +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32 + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc + +// end include: runtime_math.js +// A counter of dependencies for calling run(). If we need to +// do asynchronous work before running, increment this and +// decrement it. Incrementing must happen in a place like +// Module.preRun (used by emcc to add file preloading). +// Note that you can add dependencies in preRun, even though +// it happens right before run - run will be postponed until +// the dependencies are met. +var runDependencies = 0; +var runDependencyWatcher = null; +var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled + +function getUniqueRunDependency(id) { + return id; +} + +function addRunDependency(id) { + runDependencies++; + + Module['monitorRunDependencies']?.(runDependencies); + +} + +function removeRunDependency(id) { + runDependencies--; + + Module['monitorRunDependencies']?.(runDependencies); + + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); // can add another dependenciesFulfilled + } + } +} + +/** @param {string|number=} what */ +function abort(what) { + Module['onAbort']?.(what); + + what = 'Aborted(' + what + ')'; + // TODO(sbc): Should we remove printing and leave it up to whoever + // catches the exception? + err(what); + + ABORT = true; + EXITSTATUS = 1; + + what += '. Build with -sASSERTIONS for more info.'; + + // Use a wasm runtime error, because a JS error might be seen as a foreign + // exception, which means we'd run destructors on it. We need the error to + // simply make the program stop. + // FIXME This approach does not work in Wasm EH because it currently does not assume + // all RuntimeErrors are from traps; it decides whether a RuntimeError is from + // a trap or not based on a hidden field within the object. So at the moment + // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that + // allows this in the wasm spec. + + // Suppress closure compiler warning here. Closure compiler's builtin extern + // definition for WebAssembly.RuntimeError claims it takes no arguments even + // though it can. + // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed. + /** @suppress {checkTypes} */ + var e = new WebAssembly.RuntimeError(what); + + readyPromiseReject(e); + // Throw the error whether or not MODULARIZE is set because abort is used + // in code paths apart from instantiation where an exception is expected + // to be thrown when abort is called. + throw e; +} + +// include: memoryprofiler.js +// end include: memoryprofiler.js +// include: URIUtils.js +// Prefix of data URIs emitted by SINGLE_FILE and related options. +var dataURIPrefix = 'data:application/octet-stream;base64,'; + +/** + * Indicates whether filename is a base64 data URI. + * @noinline + */ +var isDataURI = (filename) => filename.startsWith(dataURIPrefix); + +/** + * Indicates whether filename is delivered via file protocol (as opposed to http/https) + * @noinline + */ +var isFileURI = (filename) => filename.startsWith('file://'); +// end include: URIUtils.js +// include: runtime_exceptions.js +// end include: runtime_exceptions.js +var wasmBinaryFile; + wasmBinaryFile = 'data:application/octet-stream;base64,AGFzbQEAAAABHQZgAX8AYAABf2AAAGABfwF/YAJ/fwBgA39/fwF/Aw0MAgAEAgMBBQABAQADBAUBcAEBAQUGAQGAAoACBg4CfwFB8IuEBAt/AUEACweYAQoGbWVtb3J5AgARX193YXNtX2NhbGxfY3RvcnMAAAtIYXNoX1VwZGF0ZQABCkhhc2hfRmluYWwAAwlIYXNoX0luaXQABAxHZXRCdWZmZXJQdHIABRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQAJc3RhY2tTYXZlAAkMc3RhY2tSZXN0b3JlAAoKc3RhY2tBbGxvYwALCossDAIAC+4CAgV/AX5BACgCwAoiASABKQNAIgYgAK18NwNAAkACQAJAIAanQT9xIgINAEGACyEBIAAhAgwBC0HAACACayEDAkAgAEUNACADIAAgAyAASRshBCABIAJqIQVBACEBA0AgBSABIgFqQYALIAFqLQAAOgAAIAFBAWoiAiEBIAIgBEcNAAsLAkACQCAAIANJIgRFDQBBgAshASAAIQIMAQtBACgCwAoiAUHIAGogARACQYALIANqIQEgACADayECCyABIQEgAiECIAQNAQsgASEBAkACQCACIgJBwABPDQAgASEFIAIhAAwBCyACIQIgASEEA0BBACgCwApByABqIAQiBBACIAJBQGoiASECIARBwABqIgUhBCAFIQUgASEAIAFBP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I(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile); + } + +function getBinarySync(file) { + if (file == wasmBinaryFile && wasmBinary) { + return new Uint8Array(wasmBinary); + } + var binary = tryParseAsDataURI(file); + if (binary) { + return binary; + } + if (readBinary) { + return readBinary(file); + } + throw 'both async and sync fetching of the wasm failed'; +} + +function getBinaryPromise(binaryFile) { + + // Otherwise, getBinarySync should be able to get it synchronously + return Promise.resolve().then(() => getBinarySync(binaryFile)); +} + +function instantiateArrayBuffer(binaryFile, imports, receiver) { + return getBinaryPromise(binaryFile).then((binary) => { + return WebAssembly.instantiate(binary, imports); + }).then(receiver, (reason) => { + err(`failed to asynchronously prepare wasm: ${reason}`); + + abort(reason); + }); +} + +function instantiateAsync(binary, binaryFile, imports, callback) { + return instantiateArrayBuffer(binaryFile, imports, callback); +} + +// Create the wasm instance. +// Receives the wasm imports, returns the exports. +function createWasm() { + // prepare imports + var info = { + 'env': wasmImports, + 'wasi_snapshot_preview1': wasmImports, + }; + // Load the wasm module and create an instance of using native support in the JS engine. + // handle a generated wasm instance, receiving its exports and + // performing other necessary setup + /** @param {WebAssembly.Module=} module*/ + function receiveInstance(instance, module) { + wasmExports = instance.exports; + + + + wasmMemory = wasmExports['memory']; + + updateMemoryViews(); + + addOnInit(wasmExports['__wasm_call_ctors']); + + removeRunDependency('wasm-instantiate'); + return wasmExports; + } + // wait for the pthread pool (if any) + addRunDependency('wasm-instantiate'); + + // Prefer streaming instantiation if available. + function receiveInstantiationResult(result) { + // 'result' is a ResultObject object which has both the module and instance. + // receiveInstance() will swap in the exports (to Module.asm) so they can be called + // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line. + // When the regression is fixed, can restore the above PTHREADS-enabled path. + receiveInstance(result['instance']); + } + + // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback + // to manually instantiate the Wasm module themselves. This allows pages to + // run the instantiation parallel to any other async startup actions they are + // performing. + // Also pthreads and wasm workers initialize the wasm instance through this + // path. + if (Module['instantiateWasm']) { + + try { + return Module['instantiateWasm'](info, receiveInstance); + } catch(e) { + err(`Module.instantiateWasm callback failed with error: ${e}`); + // If instantiation fails, reject the module ready promise. + readyPromiseReject(e); + } + } + + // If instantiation fails, reject the module ready promise. + instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult).catch(readyPromiseReject); + return {}; // no exports yet; we'll fill them in later +} + +// Globals used by JS i64 conversions (see makeSetValue) +var tempDouble; +var tempI64; + +// include: runtime_debug.js +// end include: runtime_debug.js +// === Body === +// end include: preamble.js + + + /** @constructor */ + function ExitStatus(status) { + this.name = 'ExitStatus'; + this.message = `Program terminated with exit(${status})`; + this.status = status; + } + + var callRuntimeCallbacks = (callbacks) => { + while (callbacks.length > 0) { + // Pass the module as the first argument. + callbacks.shift()(Module); + } + }; + + + /** + * @param {number} ptr + * @param {string} type + */ + function getValue(ptr, type = 'i8') { + if (type.endsWith('*')) type = '*'; + switch (type) { + case 'i1': return HEAP8[ptr]; + case 'i8': return HEAP8[ptr]; + case 'i16': return HEAP16[((ptr)>>1)]; + case 'i32': return HEAP32[((ptr)>>2)]; + case 'i64': abort('to do getValue(i64) use WASM_BIGINT'); + case 'float': return HEAPF32[((ptr)>>2)]; + case 'double': return HEAPF64[((ptr)>>3)]; + case '*': return HEAPU32[((ptr)>>2)]; + default: abort(`invalid type for getValue: ${type}`); + } + } + + var noExitRuntime = Module['noExitRuntime'] || true; + + + /** + * @param {number} ptr + * @param {number} value + * @param {string} type + */ + function setValue(ptr, value, type = 'i8') { + if (type.endsWith('*')) type = '*'; + switch (type) { + case 'i1': HEAP8[ptr] = value; break; + case 'i8': HEAP8[ptr] = value; break; + case 'i16': HEAP16[((ptr)>>1)] = value; break; + case 'i32': HEAP32[((ptr)>>2)] = value; break; + case 'i64': abort('to do setValue(i64) use WASM_BIGINT'); + case 'float': HEAPF32[((ptr)>>2)] = value; break; + case 'double': HEAPF64[((ptr)>>3)] = value; break; + case '*': HEAPU32[((ptr)>>2)] = value; break; + default: abort(`invalid type for setValue: ${type}`); + } + } +var wasmImports = { + +}; +var wasmExports = createWasm(); +var ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports['__wasm_call_ctors'])(); +var _Hash_Update = Module['_Hash_Update'] = (a0) => (_Hash_Update = Module['_Hash_Update'] = wasmExports['Hash_Update'])(a0); +var _Hash_Final = Module['_Hash_Final'] = () => (_Hash_Final = Module['_Hash_Final'] = wasmExports['Hash_Final'])(); +var _Hash_Init = Module['_Hash_Init'] = (a0) => (_Hash_Init = Module['_Hash_Init'] = wasmExports['Hash_Init'])(a0); +var _GetBufferPtr = Module['_GetBufferPtr'] = () => (_GetBufferPtr = Module['_GetBufferPtr'] = wasmExports['GetBufferPtr'])(); +var stackSave = () => (stackSave = wasmExports['stackSave'])(); +var stackRestore = (a0) => (stackRestore = wasmExports['stackRestore'])(a0); +var stackAlloc = (a0) => (stackAlloc = wasmExports['stackAlloc'])(a0); + + +// include: postamble.js +// === Auto-generated postamble setup entry stuff === + + + + +var calledRun; + +dependenciesFulfilled = function runCaller() { + // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false) + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled +}; + +function run() { + + if (runDependencies > 0) { + return; + } + + preRun(); + + // a preRun added a dependency, run will be called later + if (runDependencies > 0) { + return; + } + + function doRun() { + // run may have just been called through dependencies being fulfilled just in this very frame, + // or while the async setStatus time below was happening + if (calledRun) return; + calledRun = true; + Module['calledRun'] = true; + + if (ABORT) return; + + initRuntime(); + + readyPromiseResolve(Module); + if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); + + postRun(); + } + + if (Module['setStatus']) { + Module['setStatus']('Running...'); + setTimeout(function() { + setTimeout(function() { + Module['setStatus'](''); + }, 1); + doRun(); + }, 1); + } else + { + doRun(); + } +} + +if (Module['preInit']) { + if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']]; + while (Module['preInit'].length > 0) { + Module['preInit'].pop()(); + } +} + +run(); + +// end include: postamble.js + + + + return moduleArg.ready +} +); +})(); +export default Module; \ No newline at end of file diff --git a/node_modules/@huggingface/hub/src/vendor/lz4js/LICENSE b/node_modules/@huggingface/hub/src/vendor/lz4js/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7dfda0d31577cba1033826adacb3c799c234790a --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/lz4js/LICENSE @@ -0,0 +1,11 @@ +ISC License + +Copyright 2019 John Chadwick + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +--- + +Note: this license is not actually included in https://github.com/Benzinga/lz4js, but the package.json specifies the ISC license diff --git a/node_modules/@huggingface/hub/src/vendor/lz4js/index.ts b/node_modules/@huggingface/hub/src/vendor/lz4js/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..150805de6f593a353bc282dba723794182145d0e --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/lz4js/index.ts @@ -0,0 +1,537 @@ +// lz4.js - An implementation of Lz4 in plain JavaScript. +// +// TODO: +// - Unify header parsing/writing. +// - Support options (block size, checksums) +// - Support streams +// - Better error handling (handle bad offset, etc.) +// - HC support (better search algorithm) +// - Tests/benchmarking + +import * as xxhash from "./xxh32.js"; +import * as util from "./util.js"; + +// Constants +// -- + +// Compression format parameters/constants. +const minMatch = 4; +const matchSearchLimit = 12; +const minTrailingLitterals = 5; +const skipTrigger = 6; +const hashSize = 1 << 16; + +// Token constants. +const mlBits = 4; +const mlMask = (1 << mlBits) - 1; +const runBits = 4; +const runMask = (1 << runBits) - 1; + +// Shared buffers +const blockBuf = makeBuffer(5 << 20); +const hashTable = makeHashTable(); + +// Frame constants. +const magicNum = 0x184d2204; + +// Frame descriptor flags. +const fdContentChksum = 0x4; +const fdContentSize = 0x8; +const fdBlockChksum = 0x10; +// var fdBlockIndep = 0x20; +const fdVersion = 0x40; +const fdVersionMask = 0xc0; + +// Block sizes. +const bsUncompressed = 0x80000000; +const bsDefault = 7; +const bsShift = 4; +const bsMask = 7; +const bsMap: Record = { + 4: 0x10000, + 5: 0x40000, + 6: 0x100000, + 7: 0x400000, +}; + +// Utility functions/primitives +// -- + +// Makes our hashtable. On older browsers, may return a plain array. +function makeHashTable() { + try { + return new Uint32Array(hashSize); + } catch (error) { + const hashTable = new Array(hashSize); + + for (let i = 0; i < hashSize; i++) { + hashTable[i] = 0; + } + + return hashTable; + } +} + +// Clear hashtable. +function clearHashTable(table: Uint32Array | number[]) { + for (let i = 0; i < hashSize; i++) { + table[i] = 0; + } +} + +// Makes a byte buffer. On older browsers, may return a plain array. +function makeBuffer(size: number) { + return new Uint8Array(size); +} + +function sliceArray(array: Uint8Array, start: number, end: number) { + return array.slice(start, end); +} + +// Implementation +// -- + +// Calculates an upper bound for lz4 compression. +export function compressBound(n: number) { + return (n + n / 255 + 16) | 0; +} + +// Calculates an upper bound for lz4 decompression, by reading the data. +export function decompressBound(src: Uint8Array) { + let sIndex = 0; + + // Read magic number + if (util.readU32(src, sIndex) !== magicNum) { + throw new Error("invalid magic number"); + } + + sIndex += 4; + + // Read descriptor + const descriptor = src[sIndex++]; + + // Check version + if ((descriptor & fdVersionMask) !== fdVersion) { + throw new Error("incompatible descriptor version " + (descriptor & fdVersionMask)); + } + + // Read flags + const useBlockSum = (descriptor & fdBlockChksum) !== 0; + const useContentSize = (descriptor & fdContentSize) !== 0; + + // Read block size + const bsIdx = (src[sIndex++] >> bsShift) & bsMask; + + if (bsMap[bsIdx] === undefined) { + throw new Error("invalid block size " + bsIdx); + } + + const maxBlockSize = bsMap[bsIdx]; + + // Get content size + if (useContentSize) { + return util.readU64(src, sIndex); + } + + // Checksum + sIndex++; + + // Read blocks. + let maxSize = 0; + while (true) { + let blockSize = util.readU32(src, sIndex); + sIndex += 4; + + if (blockSize & bsUncompressed) { + blockSize &= ~bsUncompressed; + maxSize += blockSize; + } else if (blockSize > 0) { + maxSize += maxBlockSize; + } + + if (blockSize === 0) { + return maxSize; + } + + if (useBlockSum) { + sIndex += 4; + } + + sIndex += blockSize; + } +} + +// Decompresses a block of Lz4. +export function decompressBlock(src: Uint8Array, dst: Uint8Array, sIndex: number, sLength: number, dIndex: number) { + let mLength, mOffset, sEnd, n, i; + const hasCopyWithin = dst.copyWithin !== undefined && dst.fill !== undefined; + + // Setup initial state. + sEnd = sIndex + sLength; + + // Consume entire input block. + while (sIndex < sEnd) { + const token = src[sIndex++]; + + // Copy literals. + let literalCount = token >> 4; + if (literalCount > 0) { + // Parse length. + if (literalCount === 0xf) { + while (true) { + literalCount += src[sIndex]; + if (src[sIndex++] !== 0xff) { + break; + } + } + } + + // Copy literals + for (n = sIndex + literalCount; sIndex < n; ) { + dst[dIndex++] = src[sIndex++]; + } + } + + if (sIndex >= sEnd) { + break; + } + + // Copy match. + mLength = token & 0xf; + + // Parse offset. + mOffset = src[sIndex++] | (src[sIndex++] << 8); + + // Parse length. + if (mLength === 0xf) { + while (true) { + mLength += src[sIndex]; + if (src[sIndex++] !== 0xff) { + break; + } + } + } + + mLength += minMatch; + + // Copy match + // prefer to use typedarray.copyWithin for larger matches + // NOTE: copyWithin doesn't work as required by LZ4 for overlapping sequences + // e.g. mOffset=1, mLength=30 (repeach char 30 times) + // we special case the repeat char w/ array.fill + if (hasCopyWithin && mOffset === 1) { + dst.fill(dst[dIndex - 1] | 0, dIndex, dIndex + mLength); + dIndex += mLength; + } else if (hasCopyWithin && mOffset > mLength && mLength > 31) { + dst.copyWithin(dIndex, dIndex - mOffset, dIndex - mOffset + mLength); + dIndex += mLength; + } else { + for (i = dIndex - mOffset, n = i + mLength; i < n; ) { + dst[dIndex++] = dst[i++] | 0; + } + } + } + + return dIndex; +} + +// Compresses a block with Lz4. +export function compressBlock( + src: Uint8Array, + dst: Uint8Array, + sIndex: number, + sLength: number, + hashTable: Uint32Array | number[], +) { + let mIndex, mAnchor, mLength, mOffset, mStep; + let literalCount, dIndex, sEnd, n; + + // Setup initial state. + dIndex = 0; + sEnd = sLength + sIndex; + mAnchor = sIndex; + + let searchMatchCount = (1 << skipTrigger) + 3; + + // Search for matches with a limit of matchSearchLimit bytes + // before the end of block (Lz4 spec limitation.) + while (sIndex <= sEnd - matchSearchLimit) { + const seq = util.readU32(src, sIndex); + let hash = util.hashU32(seq) >>> 0; + + // Crush hash to 16 bits. + hash = (((hash >> 16) ^ hash) >>> 0) & 0xffff; + + // Look for a match in the hashtable. NOTE: remove one; see below. + mIndex = hashTable[hash] - 1; + + // Put pos in hash table. NOTE: add one so that zero = invalid. + hashTable[hash] = sIndex + 1; + + // Determine if there is a match (within range.) + if (mIndex < 0 || (sIndex - mIndex) >>> 16 > 0 || util.readU32(src, mIndex) !== seq) { + mStep = searchMatchCount++ >> skipTrigger; + sIndex += mStep; + continue; + } + + searchMatchCount = (1 << skipTrigger) + 3; + + // Calculate literal count and offset. + literalCount = sIndex - mAnchor; + mOffset = sIndex - mIndex; + + // We've already matched one word, so get that out of the way. + sIndex += minMatch; + mIndex += minMatch; + + // Determine match length. + // N.B.: mLength does not include minMatch, Lz4 adds it back + // in decoding. + mLength = sIndex; + while (sIndex < sEnd - minTrailingLitterals && src[sIndex] === src[mIndex]) { + sIndex++; + mIndex++; + } + mLength = sIndex - mLength; + + // Write token + literal count. + const token = mLength < mlMask ? mLength : mlMask; + if (literalCount >= runMask) { + dst[dIndex++] = (runMask << mlBits) + token; + for (n = literalCount - runMask; n >= 0xff; n -= 0xff) { + dst[dIndex++] = 0xff; + } + dst[dIndex++] = n; + } else { + dst[dIndex++] = (literalCount << mlBits) + token; + } + + // Write literals. + for (let i = 0; i < literalCount; i++) { + dst[dIndex++] = src[mAnchor + i]; + } + + // Write offset. + dst[dIndex++] = mOffset; + dst[dIndex++] = mOffset >> 8; + + // Write match length. + if (mLength >= mlMask) { + for (n = mLength - mlMask; n >= 0xff; n -= 0xff) { + dst[dIndex++] = 0xff; + } + dst[dIndex++] = n; + } + + // Move the anchor. + mAnchor = sIndex; + } + + // Nothing was encoded. + if (mAnchor === 0) { + return 0; + } + + // Write remaining literals. + // Write literal token+count. + literalCount = sEnd - mAnchor; + if (literalCount >= runMask) { + dst[dIndex++] = runMask << mlBits; + for (n = literalCount - runMask; n >= 0xff; n -= 0xff) { + dst[dIndex++] = 0xff; + } + dst[dIndex++] = n; + } else { + dst[dIndex++] = literalCount << mlBits; + } + + // Write literals. + sIndex = mAnchor; + while (sIndex < sEnd) { + dst[dIndex++] = src[sIndex++]; + } + + return dIndex; +} + +// Decompresses a frame of Lz4 data. +export function decompressFrame(src: Uint8Array, dst: Uint8Array) { + let useBlockSum, useContentSum, useContentSize, descriptor; + let sIndex = 0; + let dIndex = 0; + + // Read magic number + if (util.readU32(src, sIndex) !== magicNum) { + throw new Error("invalid magic number"); + } + + sIndex += 4; + + // Read descriptor + descriptor = src[sIndex++]; + + // Check version + if ((descriptor & fdVersionMask) !== fdVersion) { + throw new Error("incompatible descriptor version"); + } + + // Read flags + useBlockSum = (descriptor & fdBlockChksum) !== 0; + useContentSum = (descriptor & fdContentChksum) !== 0; + useContentSize = (descriptor & fdContentSize) !== 0; + + // Read block size + const bsIdx = (src[sIndex++] >> bsShift) & bsMask; + + if (bsMap[bsIdx] === undefined) { + throw new Error("invalid block size"); + } + + if (useContentSize) { + // TODO: read content size + sIndex += 8; + } + + sIndex++; + + // Read blocks. + while (true) { + var compSize; + + compSize = util.readU32(src, sIndex); + sIndex += 4; + + if (compSize === 0) { + break; + } + + if (useBlockSum) { + // TODO: read block checksum + sIndex += 4; + } + + // Check if block is compressed + if ((compSize & bsUncompressed) !== 0) { + // Mask off the 'uncompressed' bit + compSize &= ~bsUncompressed; + + // Copy uncompressed data into destination buffer. + for (let j = 0; j < compSize; j++) { + dst[dIndex++] = src[sIndex++]; + } + } else { + // Decompress into blockBuf + dIndex = decompressBlock(src, dst, sIndex, compSize, dIndex); + sIndex += compSize; + } + } + + if (useContentSum) { + // TODO: read content checksum + sIndex += 4; + } + + return dIndex; +} + +// Compresses data to an Lz4 frame. +export function compressFrame(src: Uint8Array, dst: Uint8Array) { + let dIndex = 0; + + // Write magic number. + util.writeU32(dst, dIndex, magicNum); + dIndex += 4; + + // Descriptor flags. + dst[dIndex++] = fdVersion; + dst[dIndex++] = bsDefault << bsShift; + + // Descriptor checksum. + dst[dIndex] = xxhash.hash(0, dst, 4, dIndex - 4) >> 8; + dIndex++; + + // Write blocks. + const maxBlockSize = bsMap[bsDefault]; + let remaining = src.length; + let sIndex = 0; + + // Clear the hashtable. + clearHashTable(hashTable); + + // Split input into blocks and write. + while (remaining > 0) { + let compSize = 0; + const blockSize = remaining > maxBlockSize ? maxBlockSize : remaining; + + compSize = compressBlock(src, blockBuf, sIndex, blockSize, hashTable); + + if (compSize > blockSize || compSize === 0) { + // Output uncompressed. + util.writeU32(dst, dIndex, 0x80000000 | blockSize); + dIndex += 4; + + for (let z = sIndex + blockSize; sIndex < z; ) { + dst[dIndex++] = src[sIndex++]; + } + + remaining -= blockSize; + } else { + // Output compressed. + util.writeU32(dst, dIndex, compSize); + dIndex += 4; + + for (let j = 0; j < compSize; ) { + dst[dIndex++] = blockBuf[j++]; + } + + sIndex += blockSize; + remaining -= blockSize; + } + } + + // Write blank end block. + util.writeU32(dst, dIndex, 0); + dIndex += 4; + + return dIndex; +} + +// Decompresses a buffer containing an Lz4 frame. maxSize is optional; if not +// provided, a maximum size will be determined by examining the data. The +// buffer returned will always be perfectly-sized. +export function decompress(src: Uint8Array, maxSize: number) { + let dst, size; + + if (maxSize === undefined) { + maxSize = decompressBound(src); + } + dst = makeBuffer(maxSize); + size = decompressFrame(src, dst); + + if (size !== maxSize) { + dst = sliceArray(dst, 0, size); + } + + return dst; +} + +// Compresses a buffer to an Lz4 frame. maxSize is optional; if not provided, +// a buffer will be created based on the theoretical worst output size for a +// given input size. The buffer returned will always be perfectly-sized. +export function compress(src: Uint8Array, maxSize?: number) { + let dst, size; + + if (maxSize === undefined) { + maxSize = compressBound(src.length); + } + + dst = makeBuffer(maxSize); + size = compressFrame(src, dst); + + if (size !== maxSize) { + dst = sliceArray(dst, 0, size); + } + + return dst; +} diff --git a/node_modules/@huggingface/hub/src/vendor/lz4js/util.ts b/node_modules/@huggingface/hub/src/vendor/lz4js/util.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d579b76604d2fe13537423de069f61eca50a2d4 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/lz4js/util.ts @@ -0,0 +1,54 @@ +// Simple hash function, from: http://burtleburtle.net/bob/hash/integer.html. +// Chosen because it doesn't use multiply and achieves full avalanche. +export function hashU32(a: number): number { + a = a | 0; + a = (a + 2127912214 + (a << 12)) | 0; + a = a ^ -949894596 ^ (a >>> 19); + a = (a + 374761393 + (a << 5)) | 0; + a = (a + -744332180) ^ (a << 9); + a = (a + -42973499 + (a << 3)) | 0; + return (a ^ -1252372727 ^ (a >>> 16)) | 0; +} + +// Reads a 64-bit little-endian integer from an array. +export function readU64(b: Uint8Array, n: number): number { + let x = 0; + x |= b[n++] << 0; + x |= b[n++] << 8; + x |= b[n++] << 16; + x |= b[n++] << 24; + x |= b[n++] << 32; + x |= b[n++] << 40; + x |= b[n++] << 48; + x |= b[n++] << 56; + return x; +} + +// Reads a 32-bit little-endian integer from an array. +export function readU32(b: Uint8Array, n: number): number { + let x = 0; + x |= b[n++] << 0; + x |= b[n++] << 8; + x |= b[n++] << 16; + x |= b[n++] << 24; + return x; +} + +// Writes a 32-bit little-endian integer from an array. +export function writeU32(b: Uint8Array, n: number, x: number): void { + b[n++] = (x >> 0) & 0xff; + b[n++] = (x >> 8) & 0xff; + b[n++] = (x >> 16) & 0xff; + b[n++] = (x >> 24) & 0xff; +} + +// Multiplies two numbers using 32-bit integer multiplication. +// Algorithm from Emscripten. +export function imul(a: number, b: number): number { + const ah = a >>> 16; + const al = a & 65535; + const bh = b >>> 16; + const bl = b & 65535; + + return (al * bl + ((ah * bl + al * bh) << 16)) | 0; +} diff --git a/node_modules/@huggingface/hub/src/vendor/lz4js/xxh32.ts b/node_modules/@huggingface/hub/src/vendor/lz4js/xxh32.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9d135c657c69da01cda9beab2abe1b06b009e2e --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/lz4js/xxh32.ts @@ -0,0 +1,96 @@ +// xxh32.js - implementation of xxhash32 in plain JavaScript +import * as util from "./util.js"; + +// xxhash32 primes +const prime1 = 0x9e3779b1; +const prime2 = 0x85ebca77; +const prime3 = 0xc2b2ae3d; +const prime4 = 0x27d4eb2f; +const prime5 = 0x165667b1; + +// Utility functions/primitives +// -- +function rotl32(x: number, r: number): number { + x = x | 0; + r = r | 0; + + return (x >>> ((32 - r) | 0)) | (x << r) | 0; +} + +function rotmul32(h: number, r: number, m: number): number { + h = h | 0; + r = r | 0; + m = m | 0; + + return util.imul((h >>> ((32 - r) | 0)) | (h << r), m) | 0; +} + +function shiftxor32(h: number, s: number): number { + h = h | 0; + s = s | 0; + + return ((h >>> s) ^ h) | 0; +} + +// Implementation +// -- + +function xxhapply(h: number, src: number, m0: number, s: number, m1: number): number { + return rotmul32(util.imul(src, m0) + h, s, m1); +} + +function xxh1(h: number, src: Uint8Array, index: number): number { + return rotmul32(h + util.imul(src[index], prime5), 11, prime1); +} + +function xxh4(h: number, src: Uint8Array, index: number): number { + return xxhapply(h, util.readU32(src, index), prime3, 17, prime4); +} + +function xxh16(h: number[], src: Uint8Array, index: number): number[] { + return [ + xxhapply(h[0], util.readU32(src, index + 0), prime2, 13, prime1), + xxhapply(h[1], util.readU32(src, index + 4), prime2, 13, prime1), + xxhapply(h[2], util.readU32(src, index + 8), prime2, 13, prime1), + xxhapply(h[3], util.readU32(src, index + 12), prime2, 13, prime1), + ]; +} + +function xxh32(seed: number, src: Uint8Array, index: number, len: number): number { + let h; + const l = len; + if (len >= 16) { + h = [seed + prime1 + prime2, seed + prime2, seed, seed - prime1]; + + while (len >= 16) { + h = xxh16(h, src, index); + + index += 16; + len -= 16; + } + + h = rotl32(h[0], 1) + rotl32(h[1], 7) + rotl32(h[2], 12) + rotl32(h[3], 18) + l; + } else { + h = (seed + prime5 + len) >>> 0; + } + + while (len >= 4) { + h = xxh4(h, src, index); + + index += 4; + len -= 4; + } + + while (len > 0) { + h = xxh1(h, src, index); + + index++; + len--; + } + + h = shiftxor32(util.imul(shiftxor32(util.imul(shiftxor32(h, 15), prime2), 13), prime3), 16); + + return h >>> 0; +} + +export const hash = xxh32; diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/basic.ts b/node_modules/@huggingface/hub/src/vendor/type-fest/basic.ts new file mode 100644 index 0000000000000000000000000000000000000000..3fa40a039955fec376a3e8cdc42dc425a00a859b --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/basic.ts @@ -0,0 +1,31 @@ +/** +Matches a JSON object. + +This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. + +@category JSON +*/ +export type JsonObject = { [Key in string]: JsonValue } & { [Key in string]?: JsonValue | undefined }; + +/** +Matches a JSON array. + +@category JSON +*/ +export type JsonArray = JsonValue[] | readonly JsonValue[]; + +/** +Matches any valid JSON primitive value. + +@category JSON +*/ +export type JsonPrimitive = string | number | boolean | null; + +/** +Matches any valid JSON value. + +@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`. + +@category JSON +*/ +export type JsonValue = JsonPrimitive | JsonObject | JsonArray; diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/entries.ts b/node_modules/@huggingface/hub/src/vendor/type-fest/entries.ts new file mode 100644 index 0000000000000000000000000000000000000000..3975d823ae3297d6bd021dd5aae2568e66dea6d7 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/entries.ts @@ -0,0 +1,66 @@ +import type { ArrayEntry, MapEntry, ObjectEntry, SetEntry } from "./entry"; + +type ArrayEntries = Array>; +type MapEntries = Array>; +type ObjectEntries = Array>; +type SetEntries> = Array>; + +/** +Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries. + +For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable. + +@see `Entry` if you want to just access the type of a single entry. + +@example +``` +import type {Entries} from 'type-fest'; + +interface Example { + someKey: number; +} + +const manipulatesEntries = (examples: Entries) => examples.map(example => [ + // Does some arbitrary processing on the key (with type information available) + example[0].toUpperCase(), + + // Does some arbitrary processing on the value (with type information available) + example[1].toFixed() +]); + +const example: Example = {someKey: 1}; +const entries = Object.entries(example) as Entries; +const output = manipulatesEntries(entries); + +// Objects +const objectExample = {a: 1}; +const objectEntries: Entries = [['a', 1]]; + +// Arrays +const arrayExample = ['a', 1]; +const arrayEntries: Entries = [[0, 'a'], [1, 1]]; + +// Maps +const mapExample = new Map([['a', 1]]); +const mapEntries: Entries = [['a', 1]]; + +// Sets +const setExample = new Set(['a', 1]); +const setEntries: Entries = [['a', 'a'], [1, 1]]; +``` + +@category Object +@category Map +@category Set +@category Array +*/ +export type Entries = + BaseType extends Map + ? MapEntries + : BaseType extends Set + ? SetEntries + : BaseType extends readonly unknown[] + ? ArrayEntries + : BaseType extends object + ? ObjectEntries + : never; diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/entry.ts b/node_modules/@huggingface/hub/src/vendor/type-fest/entry.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f8dd55ccc1d6b750408519e733cc0e848f26f4a --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/entry.ts @@ -0,0 +1,69 @@ +type MapKey = BaseType extends Map ? KeyType : never; +type MapValue = BaseType extends Map ? ValueType : never; + +export type ArrayEntry = [number, BaseType[number]]; +export type MapEntry = [MapKey, MapValue]; +export type ObjectEntry = [keyof BaseType, BaseType[keyof BaseType]]; +export type SetEntry = BaseType extends Set ? [ItemType, ItemType] : never; + +/** +Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry. + +For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable. + +@see `Entries` if you want to just access the type of the array of entries (which is the return of the `.entries()` method). + +@example +``` +import type {Entry} from 'type-fest'; + +interface Example { + someKey: number; +} + +const manipulatesEntry = (example: Entry) => [ + // Does some arbitrary processing on the key (with type information available) + example[0].toUpperCase(), + + // Does some arbitrary processing on the value (with type information available) + example[1].toFixed(), +]; + +const example: Example = {someKey: 1}; +const entry = Object.entries(example)[0] as Entry; +const output = manipulatesEntry(entry); + +// Objects +const objectExample = {a: 1}; +const objectEntry: Entry = ['a', 1]; + +// Arrays +const arrayExample = ['a', 1]; +const arrayEntryString: Entry = [0, 'a']; +const arrayEntryNumber: Entry = [1, 1]; + +// Maps +const mapExample = new Map([['a', 1]]); +const mapEntry: Entry = ['a', 1]; + +// Sets +const setExample = new Set(['a', 1]); +const setEntryString: Entry = ['a', 'a']; +const setEntryNumber: Entry = [1, 1]; +``` + +@category Object +@category Map +@category Array +@category Set +*/ +export type Entry = + BaseType extends Map + ? MapEntry + : BaseType extends Set + ? SetEntry + : BaseType extends readonly unknown[] + ? ArrayEntry + : BaseType extends object + ? ObjectEntry + : never; diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/except.ts b/node_modules/@huggingface/hub/src/vendor/type-fest/except.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6a38169ee1fe3239f8b8b561600007ebab6c0f1 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/except.ts @@ -0,0 +1,68 @@ +import type { IsEqual } from "./is-equal"; + +/** +Filter out keys from an object. + +Returns `never` if `Exclude` is strictly equal to `Key`. +Returns `never` if `Key` extends `Exclude`. +Returns `Key` otherwise. + +@example +``` +type Filtered = Filter<'foo', 'foo'>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', string>; +//=> never +``` + +@example +``` +type Filtered = Filter<'bar', 'foo'>; +//=> 'bar' +``` + +@see {Except} +*/ +type Filter = + IsEqual extends true ? never : KeyType extends ExcludeType ? never : KeyType; + +/** +Create a type from an object type without certain keys. + +We recommend setting the `requireExactProps` option to `true`. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)). + +@example +``` +import type {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type FooWithoutA = Except; +//=> {b: string} + +const fooWithoutA: FooWithoutA = {a: 1, b: '2'}; +//=> errors: 'a' does not exist in type '{ b: string; }' + +type FooWithoutB = Except; +//=> {a: number} & Partial> + +const fooWithoutB: FooWithoutB = {a: 1, b: '2'}; +//=> errors at 'b': Type 'string' is not assignable to type 'undefined'. +``` + +@category Object +*/ +export type Except = { + [KeyType in keyof ObjectType as Filter]: ObjectType[KeyType]; +}; diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/is-equal.ts b/node_modules/@huggingface/hub/src/vendor/type-fest/is-equal.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6ff2e53c4d25df11584f0a59504e08170e0a3b8 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/is-equal.ts @@ -0,0 +1,27 @@ +/** +Returns a boolean for whether the two given types are equal. + +@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 +@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796 + +Use-cases: +- If you want to make a conditional branch based on the result of a comparison of two types. + +@example +``` +import type {IsEqual} from 'type-fest'; + +// This type returns a boolean for whether the given array includes the given item. +// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal. +type Includes = + Value extends readonly [Value[0], ...infer rest] + ? IsEqual extends true + ? true + : Includes + : false; +``` + +@category Type Guard +@category Utilities +*/ +export type IsEqual = (() => G extends A ? 1 : 2) extends () => G extends B ? 1 : 2 ? true : false; diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/license-cc0 b/node_modules/@huggingface/hub/src/vendor/type-fest/license-cc0 new file mode 100644 index 0000000000000000000000000000000000000000..0e259d42c996742e9e3cba14c677129b2c1b6311 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/license-cc0 @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/license-mit b/node_modules/@huggingface/hub/src/vendor/type-fest/license-mit new file mode 100644 index 0000000000000000000000000000000000000000..fa7ceba3eb4a9657a9db7f3ffca4e4e97a9019de --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/license-mit @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/set-required.ts b/node_modules/@huggingface/hub/src/vendor/type-fest/set-required.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e4c6417a92e2b600e66cb00d2c4ff9675620269 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/set-required.ts @@ -0,0 +1,34 @@ +import type { Except } from "./except"; +import type { Simplify } from "./simplify"; + +/** +Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required. + +@example +``` +import type {SetRequired} from 'type-fest'; + +type Foo = { + a?: number; + b: string; + c?: boolean; +} + +type SomeRequired = SetRequired; +// type SomeRequired = { +// a?: number; +// b: string; // Was already required and still is. +// c: boolean; // Is now required. +// } +``` + +@category Object +*/ +export type SetRequired = Simplify< + // Pick just the keys that are optional from the base type. + Except & + // Pick the keys that should be required from the base type and make them required. + Required> +>; diff --git a/node_modules/@huggingface/hub/src/vendor/type-fest/simplify.ts b/node_modules/@huggingface/hub/src/vendor/type-fest/simplify.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4564fe7043dd43ce6ac4de4b332d7c85915910c --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/type-fest/simplify.ts @@ -0,0 +1,59 @@ +/** +Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability. + +@example +``` +import type {Simplify} from 'type-fest'; + +type PositionProps = { + top: number; + left: number; +}; + +type SizeProps = { + width: number; + height: number; +}; + +// In your editor, hovering over `Props` will show a flattened object with all the properties. +type Props = Simplify; +``` + +Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface. + +If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify` if you can't re-declare the `value`. + +@example +``` +import type {Simplify} from 'type-fest'; + +interface SomeInterface { + foo: number; + bar?: string; + baz: number | undefined; +} + +type SomeType = { + foo: number; + bar?: string; + baz: number | undefined; +}; + +const literal = {foo: 123, bar: 'hello', baz: 456}; +const someType: SomeType = literal; +const someInterface: SomeInterface = literal; + +function fn(object: Record): void {} + +fn(literal); // Good: literal object type is sealed +fn(someType); // Good: type is sealed +fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened +fn(someInterface as Simplify); // Good: transform an `interface` into a `type` +``` + +@link https://github.com/microsoft/TypeScript/issues/15300 + +@category Object +*/ +// eslint-disable-next-line @typescript-eslint/ban-types +export type Simplify = { [KeyType in keyof T]: T[KeyType] } & {}; diff --git a/node_modules/@huggingface/hub/src/vendor/xet-chunk/.prettierignore b/node_modules/@huggingface/hub/src/vendor/xet-chunk/.prettierignore new file mode 100644 index 0000000000000000000000000000000000000000..4c43fe68f6405ee8c6c641998a414c8fa66b0aba --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/xet-chunk/.prettierignore @@ -0,0 +1 @@ +*.js \ No newline at end of file diff --git a/node_modules/@huggingface/hub/src/vendor/xet-chunk/README.md b/node_modules/@huggingface/hub/src/vendor/xet-chunk/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e0c55e0aafc8f2ff89b431780d0bc4e11ec7772e --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/xet-chunk/README.md @@ -0,0 +1,7 @@ +# Xet-Chunk + +WASM utilities to chunk & hash data. + +An assembly script implementation is available in `@huggingface/xetchunk-wasm`, but for performance reasons we're using WASM directly compiled from the rust source, see https://github.com/huggingface/xet-core/tree/main/hf_xet_wasm which on my local machine processes data at 480MB/s. + +The `chunker_wasm_bg.js`and `chunker_wasm_bg.wasm.base64.ts` are generated with `pnpm --filter hub build:xet-wasm`. diff --git a/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm.ts b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm.ts new file mode 100644 index 0000000000000000000000000000000000000000..efc7d0294bbb4702589a7970fb068382a0304baa --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm.ts @@ -0,0 +1,68 @@ +// export * from "./chunker_wasm_bg.js"; +import * as __glue_imports from "./chunker_wasm_bg.js"; +// @ts-expect-error no types +import { __wbg_set_wasm } from "./chunker_wasm_bg.js"; +// @ts-expect-error no types +import { wasmBinary } from "./chunker_wasm_bg.wasm.base64.ts"; + +let initPromise: Promise | null = null; + +async function init(): Promise { + if (initPromise) { + return initPromise; + } + let resolve: (value: void) => void; + let reject: (reason?: unknown) => void; + initPromise = new Promise((_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }); + + await Promise.resolve(); + + try { + const wasmModule = await WebAssembly.compile(wasmBinary); + const imports = Object.entries( + WebAssembly.Module.imports(wasmModule).reduce( + (result, item) => ({ + ...result, + // @ts-expect-error ok for any type + [item.module]: [...(result[item.module] || []), item.name], + }), + {}, + ), + ).map(([from, names]) => ({ from, names })); + const wasm = await WebAssembly.instantiate(wasmModule, { + "./hf_xet_thin_wasm_bg.js": Object.fromEntries( + // @ts-expect-error ok for any type + (imports[0].names as string[]).map((name) => [name, __glue_imports[name]]), + ), + }); + __wbg_set_wasm(wasm.exports); + // console.log("exports", exports); + // @ts-expect-error it's assigned + wasm.exports.__wbindgen_start(); + + // @ts-expect-error it's assigned + resolve(); + } catch (error) { + // @ts-expect-error it's assigned + reject(error); + } +} + +init(); + +export { init }; + +export { + compute_xorb_hash, + compute_file_hash, + Chunker, + compute_verification_hash, + compute_hmac, +} from "./chunker_wasm_bg.js"; + +// const exports = WebAssembly.Module.exports(wasmModule).map((item) => item.name); + +// console.log("imports", imports); diff --git a/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.d.ts b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..52c6d5edafe830f44981919ec97d0ff2028d398a --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.d.ts @@ -0,0 +1,12 @@ +/* tslint:disable */ +/* eslint-disable */ +export function compute_xorb_hash(chunks_array: Array<{ hash: string; length: number }>): string; +export function compute_verification_hash(chunkHashes: string[]): string; +export function compute_file_hash(chunks_array: Array<{ hash: string; length: number }>): string; +export function compute_hmac(hash: string, key: string): string; +export class Chunker { + free(): void; + constructor(target_chunk_size: number); + add_data(data: Uint8Array): Array<{ hash: string; length: number; dedup: boolean }>; + finish(): Array<{ hash: string; length: number; dedup: boolean }>; +} diff --git a/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.js b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.js new file mode 100644 index 0000000000000000000000000000000000000000..f5e249e67dd69202a563353c63b389923ad3fd0f --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.js @@ -0,0 +1,577 @@ +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; +} + + +let WASM_VECTOR_LEN = 0; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; + +let cachedTextEncoder = new lTextEncoder('utf-8'); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_export_4.set(idx, obj); + return idx; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches && builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; + +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +function passArray8ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 1, 1) >>> 0; + getUint8ArrayMemory0().set(arg, ptr / 1); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_export_4.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} +/** + * takes an Array of Objects of the form { "hash": string, "length": number } + * and returns a string of a hash + * @param {any} chunks_array + * @returns {string} + */ +export function compute_xorb_hash(chunks_array) { + let deferred2_0; + let deferred2_1; + try { + const ret = wasm.compute_xorb_hash(chunks_array); + var ptr1 = ret[0]; + var len1 = ret[1]; + if (ret[3]) { + ptr1 = 0; len1 = 0; + throw takeFromExternrefTable0(ret[2]); + } + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); + } finally { + wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); + } +} + +/** + * takes an Array of Objects of the form { "hash": string, "length": number } + * and returns a string of a hash + * @param {any} chunks_array + * @returns {string} + */ +export function compute_file_hash(chunks_array) { + let deferred2_0; + let deferred2_1; + try { + const ret = wasm.compute_file_hash(chunks_array); + var ptr1 = ret[0]; + var len1 = ret[1]; + if (ret[3]) { + ptr1 = 0; len1 = 0; + throw takeFromExternrefTable0(ret[2]); + } + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); + } finally { + wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); + } +} + +function passArrayJsValueToWasm0(array, malloc) { + const ptr = malloc(array.length * 4, 4) >>> 0; + for (let i = 0; i < array.length; i++) { + const add = addToExternrefTable0(array[i]); + getDataViewMemory0().setUint32(ptr + 4 * i, add, true); + } + WASM_VECTOR_LEN = array.length; + return ptr; +} +/** + * takes an Array of hashes as strings and returns the verification hash for that range of chunk hashes + * @param {string[]} chunk_hashes + * @returns {string} + */ +export function compute_verification_hash(chunk_hashes) { + let deferred3_0; + let deferred3_1; + try { + const ptr0 = passArrayJsValueToWasm0(chunk_hashes, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.compute_verification_hash(ptr0, len0); + var ptr2 = ret[0]; + var len2 = ret[1]; + if (ret[3]) { + ptr2 = 0; len2 = 0; + throw takeFromExternrefTable0(ret[2]); + } + deferred3_0 = ptr2; + deferred3_1 = len2; + return getStringFromWasm0(ptr2, len2); + } finally { + wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); + } +} + +/** + * takes a hash and HMAC key (both as hex strings) and returns the HMAC result as a hex string + * @param {string} hash_hex + * @param {string} hmac_key_hex + * @returns {string} + */ +export function compute_hmac(hash_hex, hmac_key_hex) { + let deferred4_0; + let deferred4_1; + try { + const ptr0 = passStringToWasm0(hash_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passStringToWasm0(hmac_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.compute_hmac(ptr0, len0, ptr1, len1); + var ptr3 = ret[0]; + var len3 = ret[1]; + if (ret[3]) { + ptr3 = 0; len3 = 0; + throw takeFromExternrefTable0(ret[2]); + } + deferred4_0 = ptr3; + deferred4_1 = len3; + return getStringFromWasm0(ptr3, len3); + } finally { + wasm.__wbindgen_free(deferred4_0, deferred4_1, 1); + } +} + +const ChunkerFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_chunker_free(ptr >>> 0, 1)); + +export class Chunker { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + ChunkerFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_chunker_free(ptr, 0); + } + /** + * @param {number} target_chunk_size + */ + constructor(target_chunk_size) { + const ret = wasm.chunker_new(target_chunk_size); + this.__wbg_ptr = ret >>> 0; + ChunkerFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {Uint8Array} data + * @returns {any} + */ + add_data(data) { + const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.chunker_add_data(this.__wbg_ptr, ptr0, len0); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); + } + /** + * @returns {any} + */ + finish() { + const ret = wasm.chunker_finish(this.__wbg_ptr); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); + } +} + +export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) { + const ret = String(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); +}; + +export function __wbg_buffer_609cc3eee51ed158(arg0) { + const ret = arg0.buffer; + return ret; +}; + +export function __wbg_call_672a4d21634d4a24() { return handleError(function (arg0, arg1) { + const ret = arg0.call(arg1); + return ret; +}, arguments) }; + +export function __wbg_done_769e5ede4b31c67b(arg0) { + const ret = arg0.done; + return ret; +}; + +export function __wbg_get_67b2ba62fc30de12() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(arg0, arg1); + return ret; +}, arguments) }; + +export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return ret; +}; + +export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) { + const ret = arg0[arg1]; + return ret; +}; + +export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) { + let result; + try { + result = arg0 instanceof ArrayBuffer; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; + +export function __wbg_instanceof_Uint8Array_17156bcf118086a9(arg0) { + let result; + try { + result = arg0 instanceof Uint8Array; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; + +export function __wbg_isArray_a1eab7e0d067391b(arg0) { + const ret = Array.isArray(arg0); + return ret; +}; + +export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) { + const ret = Number.isSafeInteger(arg0); + return ret; +}; + +export function __wbg_iterator_9a24c88df860dc65() { + const ret = Symbol.iterator; + return ret; +}; + +export function __wbg_length_a446193dc22c12f8(arg0) { + const ret = arg0.length; + return ret; +}; + +export function __wbg_length_e2d2a49132c1b256(arg0) { + const ret = arg0.length; + return ret; +}; + +export function __wbg_new_405e22f390576ce2() { + const ret = new Object(); + return ret; +}; + +export function __wbg_new_78feb108b6472713() { + const ret = new Array(); + return ret; +}; + +export function __wbg_new_a12002a7f91c75be(arg0) { + const ret = new Uint8Array(arg0); + return ret; +}; + +export function __wbg_next_25feadfc0913fea9(arg0) { + const ret = arg0.next; + return ret; +}; + +export function __wbg_next_6574e1a8a62d1055() { return handleError(function (arg0) { + const ret = arg0.next(); + return ret; +}, arguments) }; + +export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) { + arg0[arg1 >>> 0] = arg2; +}; + +export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) { + arg0[arg1] = arg2; +}; + +export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) { + arg0.set(arg1, arg2 >>> 0); +}; + +export function __wbg_value_cd1ffa7b1ab794f1(arg0) { + const ret = arg0.value; + return ret; +}; + +export function __wbindgen_as_number(arg0) { + const ret = +arg0; + return ret; +}; + +export function __wbindgen_boolean_get(arg0) { + const v = arg0; + const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; + return ret; +}; + +export function __wbindgen_debug_string(arg0, arg1) { + const ret = debugString(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); +}; + +export function __wbindgen_error_new(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return ret; +}; + +export function __wbindgen_in(arg0, arg1) { + const ret = arg0 in arg1; + return ret; +}; + +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_export_4; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; +}; + +export function __wbindgen_is_function(arg0) { + const ret = typeof(arg0) === 'function'; + return ret; +}; + +export function __wbindgen_is_object(arg0) { + const val = arg0; + const ret = typeof(val) === 'object' && val !== null; + return ret; +}; + +export function __wbindgen_is_undefined(arg0) { + const ret = arg0 === undefined; + return ret; +}; + +export function __wbindgen_jsval_loose_eq(arg0, arg1) { + const ret = arg0 == arg1; + return ret; +}; + +export function __wbindgen_memory() { + const ret = wasm.memory; + return ret; +}; + +export function __wbindgen_number_get(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'number' ? obj : undefined; + getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); +}; + +export function __wbindgen_number_new(arg0) { + const ret = arg0; + return ret; +}; + +export function __wbindgen_string_get(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); +}; + +export function __wbindgen_string_new(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return ret; +}; + +export function __wbindgen_throw(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; + diff --git a/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.wasm.base64.ts b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.wasm.base64.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ecdcfc36bc0071a5a27a56d7022d82207bad226 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.wasm.base64.ts @@ -0,0 +1,1370 @@ +// Generated by build-xet-wasm.sh +// Repository: https://github.com/huggingface/xet-core.git +// Branch: main +// Package: hf_xet_thin_wasm +// JS Target: bundler +// Build Date: 2025-09-10 23:53:23 UTC + +export const wasmBase64 = atob( + ` +AGFzbQEAAAABwAIuYAJ/f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ACQQA2AhBBAUcNCSACIAIoAhQiAzYCOCACIAMQ +5gECQCACKAIAIgYEQCACKAIEIgEhDQwBCyACQThqIAJBzwBqQdiQwAAQPiEGQYCAgIB4IQELIANBhAFPBEAgAxBvCyABQYCAgIB4 +Rw0CIABBgICAgHg2AgAgACAGNgIEDAULIAlFBEAgAigCECACQQA2AhBBAUcNCSACIAIoAhQ2AiQgAkEoaiIEIAJBJGoiAygCACUB +EB0EfiADKAIAJQEQCSIORAAAAAAAAODDZiEDIARC////////////AAJ+IA6ZRAAAAAAAAOBDYwRAIA6wDAELQoCAgICAgICAgH8L +QoCAgICAgICAgH8gAxsgDkT////////fQ2QbQgAgDiAOYRs3AwhCAQVCAAs3AwACfwJAIAIoAihBAUYEQCACKQMwIg9CAFkNAQsg +AkEkaiACQc8AakHIkMAAED4hBEEBDAELIA9CgICAgBBaBEAgAkEBOgA4IAIgDzcDQCMAQTBrIgMkACADQciQwAA2AgQgAyACQc8A +ajYCACADQQI2AgwgA0HIjMAANgIIIANCAjcCFCADIAOtQoCAgICQAYQ3AyggAyACQThqrUKAgICAoAGENwMgIAMgA0EgajYCECAD +QQhqEGQhBCADQTBqJABBAQwBCyAPpyEEQQALIAIoAiQiBUGEAU8EQCAFEG8LQQEhCUUNAgwBC0HVksAAQQYQgQEhBAsgAEGAgICA +eDYCACAAIAQ2AgQgAUGAgICAeHJBgICAgHhGDQMgBiABEMoBDAMLCyACKAIYIgMgAigCHEcNAAsgAUGAgICAeEYEQEHRksAAQQQQ +gAEhASAAQYCAgIB4NgIAIAAgATYCBAwBCyAJRQRAQdWSwABBBhCAASEEIABBgICAgHg2AgAgACAENgIEIAFFDQEgBiABEMoBDAEL +IAAgBDYCDCAAIA02AgggACAGNgIEIAAgATYCACACKAIgIgBBhAFPBEAgABBvCyACKAIQRQ0DIAIoAhQiA0GDAU0NAwwCCyACKAIg +IgBBhAFPBEAgABBvCyACKAIQRQ0CIAIoAhQiA0GDAUsNAQwCCyACQQxqIAJBzwBqQfi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hwhAANAIANBAWsiA0UNAiAAIAUgBCgCEBEAAEUNAAtBAQ8LDAILIAAgASACIAQoAgwRAQAEQEEBDwtBACEDA0AgAyAGRgRAQQAP +CyADQQFqIQMgACAFIAQoAhARAABFDQALIANBAWsgBkkPCyAAKAIcIAEgAiAAKAIgKAIMEQEADwsgACgCHCABIAIgACgCICgCDBEB +AAveCAIKfwF+IwBBgAJrIgQkACAEIAEpABg3AhggBCABKQAQNwIQIAQgASkACDcCCCAEIAEpAAA3AgACfyADQYEITwRAIARBIGoh +BSMAQeAAayIBJAAgAUE4aiIGQgA3AwAgAUEwaiIHQgA3AwAgAUEoaiIIQgA3AwAgAUEgaiIJQgA3AwAgAUEYaiIKQgA3AwAgAUEQ +aiILQgA3AwAgAUEIaiIMQgA3AwAgAUIANwMAIAIgAyAEQgBBECABQcAAECohAiABQdgAakIANwMAIAFB0ABqQgA3AwAgAUHIAGpC +ADcDACABQgA3A0ACQAJAAkACQCACQQNPBEADQCACQQV0IgJBwQBPDQIgASACIARBECABQUBrIg1BIBA9IgJBBXQiA0HBAE8NAyAD +QSFPDQQgASANIAMQNRogAkECSw0ACwsgBSABKQMANwAAIAVBOGogBikDADcAACAFQTBqIAcpAwA3AAAgBUEoaiAIKQMANwAAIAVB +IGogCSkDADcAACAFQRhqIAopAwA3AAAgBUEQaiALKQMANwAAIAVBCGogDCkDADcAACABQeAAaiQADAMLIAJBwABBgL7AABDOAQAL +IANBwABBkL7AABDOAQALIANBIEGgvsAAEM4BAAsgBEH4AGogBEEYaikCADcDACAEQfAAaiAEQRBqKQIANwMAIARB6ABqIARBCGop +AgA3AwAgBCAEKQIANwNgQcAAIQNBFAwBCyAEQcgBakIANwMAIARBwAFqQgA3AwAgBEG4AWpCADcDACAEQbABakIANwMAIARBqAFq +QgA3AwAgBEGYAWpCADcDACAEQRA6APoBIARBoAFqQgA3AwAgBEHYAWoiBSAEQQhqKQIANwMAIARB6AFqIgYgBEEYaikCADcDACAE +QeABaiIHIARBEGopAgA3AwAgBEIANwOQASAEIAQpAgA3A9ABIARBADsB+AEgBEIANwPwASAEQZABaiACIAMQRSEBIARB6ABqIAUp +AwA3AwAgBEHwAGogBykDADcDACAEQfgAaiAGKQMANwMAIARBKGogAUEIaikDADcDACAEQTBqIAFBEGopAwA3AwAgBEE4aiABQRhq +KQMANwMAIARBQGsgAUEgaikDADcDACAEQcgAaiABQShqKQMANwMAIARB0ABqIAFBMGopAwA3AwAgBEHYAGogAUE4aikDADcDACAE +IAQpA9ABNwNgIAQgASkDADcDICAEKQPwASEOIAQtAPgBIQMgBC0A+gEgBC0A+QFFckECcgshASAEIA43A4ABIAQgAzoAiAEgBCAB +OgCJASAEQagBaiICIARB+ABqKQMANwMAIARBoAFqIgUgBEHwAGopAwA3AwAgBEGYAWoiBiAEQegAaikDADcDACAEIAQpA2A3A5AB +IARBkAFqIARBIGogA0IAIAFBCHIQJyAAIAIpAwA3ABggACAFKQMANwAQIAAgBikDADcACCAAIAQpA5ABNwAAIARBgAJqJAALuAsB +BX8jAEEgayIEJAACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAQ4oBgEBAQEBAQEBAgQBAQMBAQEBAQEBAQEBAQEBAQEBAQEBAQgB +AQEBBwALIAFB3ABGDQQLIAJBAXFFIAFBgAZJcg0HAn8CQEERQQAgAUGvsARPGyICIAJBCHIiAyABQQt0IgIgA0ECdEHg+8AAaigC +AEELdEkbIgMgA0EEciIDIANBAnRB4PvAAGooAgBBC3QgAksbIgMgA0ECciIDIANBAnRB4PvAAGooAgBBC3QgAksbIgMgA0EBaiID +IANBAnRB4PvAAGooAgBBC3QgAksbIgMgA0EBaiIDIANBAnRB4PvAAGooAgBBC3QgAksbIgNBAnRB4PvAAGooAgBBC3QiBSACRiAC +IAVLaiADaiIDQSFNBEAgA0ECdEHg+8AAaiIGKAIAQRV2IQJB7wUhBQJ/AkAgA0EhRg0AIAYoAgRBFXYhBSADDQBBAAwBCyAGQQRr +KAIAQf///wBxCyEDAkAgBSACQX9zakUN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ICAAIAs3AxggACAKNwMQIAAgCTcDCEIAIQ0LIAAgDTcDAA8LIAFBwABBAEEQQYS7wAAQvAEACyABQcAAQRBBIEGUu8AAELwBAAsg +AUHAAEEgQTBBpLvAABC8AQALjAUBCH8CQCACQRBJBEAgACEDDAELAkAgAEEAIABrQQNxIgZqIgUgAE0NACAAIQMgASEEIAYEQCAG +IQcDQCADIAQtAAA6AAAgBEEBaiEEIANBAWohAyAHQQFrIgcNAAsLIAZBAWtBB0kNAANAIAMgBC0AADoAACADQQFqIARBAWotAAA6 +AAAgA0ECaiAEQQJqLQAAOgAAIANBA2ogBEEDai0AADoAACADQQRqIARBBGotAAA6AAAgA0EFaiAEQQVqLQAAOgAAIANBBmogBEEG +ai0AADoAACADQQdqIARBB2otAAA6AAAgBEEIaiEEIANBCGoiAyAFRw0ACwsgBSACIAZrIgdBfHEiCGohAwJAIAEgBmoiBEEDcUUE +QCADIAVNDQEgBCEBA0AgBSABKAIANgIAIAFBBGohASAFQQRqIgUgA0kNAAsMAQsgAyAFTQ0AIARBA3QiAkEYcSEGIARBfHEiCUEE +aiEBQQAgAmtBGHEhCiAJKAIAIQIDQCAFIAIgBnYgASgCACICIAp0cjYCACABQQRqIQEgBUEEaiIFIANJDQALCyAHQQNxIQIgBCAI +aiEBCwJAIAMgAiADaiIGTw0AIAJBB3EiBARAA0AgAyABLQAAOgAAIAFBAWohASADQQFqIQMgBEEBayIEDQALCyACQQFrQQdJDQAD +QCADIAEtAAA6AAAgA0EBaiABQQFqLQAAOgAAIANBAmogAUECai0AADoAACADQQNqIAFBA2otAAA6AAAgA0EEaiABQQRqLQAAOgAA +IANBBWogAUEFai0AADoAACADQQZqIAFBBmotAAA6AAAgA0EHaiABQQdqLQAAOgAAIAFBCGohASADQQhqIgMgBkcNAAsLIAALhAYC +AX8BfCMAQTBrIgIkAAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAAtAABBAWsOEQECAwQFBgcICQoLDA0O +DxARAAsgAiAALQABOgAIIAJBAjYCFCACQdi/wAA2AhAgAkIBNwIcIAIgAkEIaq1CgICAgOAHhDcDKCACIAJBKGo2AhggASgCHCAB +KAIgIAJBEGoQOAwRCyACIAApAwg3AwggAkECNgIUIAJB9L/AADYCECACQgE3AhwgAiACQQhqrUKAgICA8AeENwMoIAIgAkEoajYC +GCABKAIcIAEoAiAgAkEQahA4DBALIAIgACkDCDcDCCACQQI2AhQgAkH0v8AANgIQIAJCATcCHCACIAJBCGqtQoCAgICACIQ3Aygg +AiACQShqNgIYIAEoAhwgASgCICACQRBqEDgMDwsgACsDCCEDIAJBAjYCFCACQZTAwAA2AhAgAkIBNwIcIAIgAkEoaq1CgICAgJAI +hDcDCCACIAM5AyggAiACQQhqNgIYIAEoAhwgASgCICACQRBqEDgMDgsgAiAAKAIENgIIIAJBAjYCFCACQbDAwAA2AhAgAkIBNwIc +IAIgAkEIaq1CgICAgKAIhDcDKCACIAJBKGo2AhggASgCHCABKAIgIAJBEGoQOAwNCyACIAApAgQ3AgggAkEBNgIUIAJByMDAADYC +ECACQgE3AhwgAiACQQhqrUKAgICAsAiENwMoIAIgAkEoajYCGCABKAIcIAEoAiAgAkEQahA4DAwLIAFBxL/AAEEKELoBDAsLIAFB +0MDAAEEKELoBDAoLIAFB2sDAAEEMELoBDAkLIAFB5sDAAEEOELoBDAgLIAFB9MDAAEEIELoBDAcLIAFB/MDAAEEDELoBDAYLIAFB +/8DAAEEEELoBDAULIAFBg8HAAEEMELoBDAQLIAFBj8HAAEEPELoBDAMLIAFBnsHAAEENELoBDAILIAFBq8HAAEEOELoBDAELIAEg +ACgCBCAAKAIIELoBCyACQTBqJAAL/gUBBX8gAEEIayIBIABBBGsoAgAiA0F4cSIAaiECAkACQCADQQFxDQAgA0ECcUUNASABKAIA +IgMgAGohACABIANrIgFBkIfBACgCAEYEQCACKAIEQQNxQQNHDQFBiIfBACAANgIAIAIgAigCBEF+cTYCBCABIABBAXI2AgQgAiAA +NgIADwsgASADEFALAkACQAJAAkACQCACKAIEIgNBAnFFBEAgAkGUh8EAKAIARg0CIAJBkIfBACgCAEYNAyACIANBeHEiAhBQIAEg +ACACaiIAQQFyNgIEIAAgAWogADYCACABQZCHwQAoAgBHDQFBiIfBACAANgIADwsgAiADQX5xNgIEIAEgAEEBcjYCBCAAIAFqIAA2 +AgALIABBgAJJDQIgASAAEFVBACEBQaiHwQBBqIfBACgCAEEBayIANgIAIAANBEHwhMEAKAIAIgAEQANAIAFBAWohASAAKAIIIgAN +AAsLQaiHwQBB/x8gASABQf8fTRs2AgAPC0GUh8EAIAE2AgBBjIfBAEGMh8EAKAIAIABqIgA2AgAgASAAQQFyNgIEQZCHwQAoAgAg +AUYEQEGIh8EAQQA2AgBBkIfBAEEANgIACyAAQaCHwQAoAgAiA00NA0GUh8EAKAIAIgJFDQNBACEAQYyHwQAoAgAiBEEpSQ0CQeiE +wQAhAQNAIAIgASgCACIFTwRAIAIgBSABKAIEakkNBAsgASgCCCEBDAALAAtBkIfBACABNgIAQYiHwQBBiIfBACgCACAAaiIANgIA +IAEgAEEBcjYCBCAAIAFqIAA2AgAPCyAAQfgBcUH4hMEAaiECAn9BgIfBACgCACIDQQEgAEEDdnQiAHFFBEBBgIfBACAAIANyNgIA +IAIMAQsgAigCCAshACACIAE2AgggACABNgIMIAEgAjYCDCABIAA2AggPC0HwhMEAKAIAIgEEQANAIABBAWohACABKAIIIgENAAsL +QaiHwQBB/x8gACAAQf8fTRs2AgAgAyAETw0AQaCHwQBBfzYCAAsL6gQBCn8jAEEwayIDJAAgAyABNgIsIAMgADYCKCADQQM6ACQg +A0IgNwIcIANBADYCFCADQQA2AgwCfwJAAkACQCACKAIQIgpFBEAgAigCDCIARQ0BIAIoAggiASAAQQN0aiEEIABBAWtB/////wFx +QQFqIQcgAigCACEAA0AgAEEEaigCACIFBEAgAygCKCAAKAIAIAUgAygCLCgCDBEBAA0ECyABKAIAIANBDGogAUEEaigCABEAAA0D +IABBCGohACABQQhqIgEgBEcNAA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EIAE2 +AhwgBCABNgIYIAQgASAEKAIUQQR0ajYCJCMAQYACayICJAAgBEEYaiIDKAIIIQkgAygCACEOIAMoAgQiByEBAkACQAJAAn8CQAJA +AkAgByADKAIMIgVGIgZFBEAgBzUCDCESIAcoAgAhASACQdgBaiAHKAIEIgMgBygCCBA0IAIoAtgBIgpFBEAgAkHQAWogAkH4AWop +AwA3AwAgAkHIAWogAkHwAWopAwA3AwAgAkHAAWogAkHoAWopAwA3AwAgAiACKQPgATcDuAELIAEEQCADIAEQygELIAdBEGohASAK +QQFxRQ0BCyABIAVHBEAgBSABa0EEdiEDA0AgASgCACIKBEAgAUEEaigCACAKEMoBCyABQRBqIQEgA0EBayIDDQALCyAJRQ0BIA4g +CUEEdBDKASAGDQIMBQsgAkEwaiIDIAJB0AFqKQMANwMAIAJBKGoiBiACQcgBaikDADcDACACQSBqIgogAkHAAWopAwA3AwAgAiAC +KQO4ATcDGEH5gsEALQAAGkGgAUEIEL4BIgdFDQMgByACKQMYNwMAIAcgEjcDICAHQRhqIAMpAwA3AwAgB0EQaiAGKQMANwMAIAdB +CGogCikDADcDAEEBIQYgAkEBNgIUIAIgBzYCECACQQQ2AgwCfwJAIAEgBUYEQCABIQMMAQsgAkHgAWohCkHIACEMA0AgATUCDCES +IAEoAgAhAyACQdgBaiABKAIEIgsgASgCCBA0IAIoAtgBIg1FBEAgAkHQAWogCkEYaikDADcDACACQcgBaiAKQRBqKQMANwMAIAJB +wAFqIApBCGopAwA3AwAgAiAKKQMANwO4AQsgAwRAIAsgAxDKAQsgAUEQaiEDQQEgDUEBcQ0CGiACQeAAaiACQcABaikDACITNwMA +IAJB0ABqIg0gAkHQAWopAwA3AwAgAkHIAGoiDyACQcgBaikDADcDACACQUBrIhAgEzcDACACIAIpA7gBIhM3A1ggAiATNwM4IAIo +AgwgBkYEQCACQQxqIAZBAUEIQSgQWCACKAIQIQcLIAcgDGoiEUEgayILIAIpAzg3AwAgECkDACETIA8pAwAhFCANKQMAIRUgESAS +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AAIANBB2ogAToAACADQQZq +IAE6AAAgA0EFaiABOgAAIANBBGogAToAACADQQNqIAE6AAAgA0ECaiABOgAAIANBAWogAToAACADQQhqIgMgBEcNAAsLIAQgAiAF +ayICQXxxaiIDIARLBEAgAUH/AXFBgYKECGwhBQNAIAQgBTYCACAEQQRqIgQgA0kNAAsLIAJBA3EhAgsCQCADIAIgA2oiBU8NACAC +QQdxIgQEQANAIAMgAToAACADQQFqIQMgBEEBayIEDQALCyACQQFrQQdJDQADQCADIAE6AAAgA0EHaiABOgAAIANBBmogAToAACAD +QQVqIAE6AAAgA0EEaiABOgAAIANBA2ogAToAACADQQJqIAE6AAAgA0EBaiABOgAAIANBCGoiAyAFRw0ACwsgAAv+AgEEfwJAAkAC +QAJAAkACQAJ/AkAgByAIVgRAIAcgCH0gCFgNAwJAIAYgByAGfVQgByAGQgGGfSAIQgGGWnFFBEAgBiAIVg0BDAoLIAIgA0kNBQwI +CyAHIAYgCH0iBn0gBlYNCCACIANJDQUgASADaiEMIAEhCwJAA0AgAyAJRg0BIAlBAWohCSALQQFrIgsgA2oiCi0AAEE5Rg0ACyAK +IAotAABBAWo6AAAgAyAJa0EBaiADTw0HIApBAWpBMCAJQQFrEEMaDAcLQTEgA0UNAhogAUExOgAAIANBAUcNAUEwDAILIABBADYC +AA8LIAFBAWpBMCADQQFrEEMaQTALIQkgBEEBasEiBCAFwUwgAiADTXINAyAMIAk6AAAgA0EBaiEDDAMLIABBADYCAA8LIAMgAkGQ +4sAAEM4BAAsgAyACQfDhwAAQzgEACyACIANPDQAgAyACQYDiwAAQzgEACyAAIAQ7AQggACADNgIEIAAgATYCAA8LIABBADYCAAub +AwECfwJAAkACQAJAIAAtAGgiAwRAIANBwQBPDQMgACADaiABIAJBwAAgA2siAyACIANJGyIDEDUaIAAgAC0AaCADaiIEOgBoIAEg +A2ohASACIANrIgJFBEBBACECDAILIABBQGsgAEHAACAAKQNgIAAtAGogAC0AaUVyECcgAEIANwMAIABBADoAaCAAQQhqQgA3AwAg +AEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgACAALQBpQQFqOgBpC0EA +IQMgAkHBAEkNASAAQUBrIQQgAC0AaSEDA0AgBCABQcAAIAApA2AgAC0AaiADQf8BcUVyECcgACAALQBpQQFqIgM6AGkgAUFAayEB +IAJBQGoiAkHAAEsNAAsgAC0AaCEECyAEQf8BcSIDQcEATw0CCyAAIANqIAEgAkHAACADayIBIAEgAksbIgEQNRogACAALQBoIAFq +OgBoIAAPCyADQcAAQfC8wAAQzQEACyADQcAAQfC8wAAQzQEAC+cCAQV/AkBBzf97QRAgACAAQRBNGyIAayABTQ0AIABBECABQQtq +QXhxIAFBC0kbIgRqQQxqECgiAkUNACACQQhrIQECQCAAQQFrIgMgAnFFBEAgASEADAELIAJBBGsiBSgCACIGQXhxIAIgA2pBACAA +a3FBCGsiAiAAQQAgAiABa0EQTRtqIgAgAWsiAmshAyAGQQNxBEAgACADIAAoAgRBAXFyQQJyNgIEIAAgA2oiAyADKAIEQQFyNgIE +IAUgAiAFKAIAQQFxckECcjYCACABIAJqIgMgAygCBEEBcjYCBCABIAIQQQwBCyABKAIAIQEgACADNgIEIAAgASACajYCAAsCQCAA +KAIEIgFBA3FFDQAgAUF4cSICIARBEGpNDQAgACAEIAFBAXFyQQJyNgIEIAAgBGoiASACIARrIgRBA3I2AgQgACACaiICIAIoAgRB +AXI2AgQgASAEEEELIABBCGohAwsgAwuCAwEHfyMAQRBrIgQkAAJAAkACQAJAAkAgASgCBCICRQ0AIAEoAgAhByACQQNxIQUCQCAC +QQRJBEBBACECDAELIAdBHGohAyACQXxxIQhBACECA0AgAygCACADQQhrKAIAIANBEGsoAgAgA0EYaygCACACampqaiECIANBIGoh +AyAIIAZBBGoiBkcNAAsLIAUEQCAGQQN0IAdqQQRqIQMDQCADKAIAIAJqIQIgA0EIaiEDIAVBAWsiBQ0ACwsgASgCDARAIAJBAEgN +ASAHKAIER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PBEAgAkEMakEDciEEIAIgAUESdkHwAXI6 +AAwgAiABQQZ2QT9xQYABcjoADiACIAFBDHZBP3FBgAFyOgANQQQMAgsgAkEMakECciEEIAIgAUEMdkHgAXI6AAwgAiABQQZ2QT9x +QYABcjoADUEDDAELIAJBDGpBAXIhBCACIAFBBnZBwAFyOgAMQQILIQMgBCABQT9xQYABcjoAACADIAAoAgAgACgCCCIBa0sEQCAA +IAEgAxBnIAAoAgghAQsgACgCBCABaiACQQxqIAMQNRogACABIANqNgIIDAELIAAoAggiAyAAKAIARgRAIABBnM3AABBsCyAAIANB +AWo2AgggACgCBCADaiABOgAACyACQRBqJABBAAvCAgECfyMAQRBrIgIkAAJAIAFBgAFPBEAgAkEANgIMAn8gAUGAEE8EQCABQYCA +BE8EQCACIAFBP3FBgAFyOgAPIAIgAUESdkHwAXI6AAwgAiABQQZ2QT9xQYABcjoADiACIAFBDHZBP3FBgAFyOgANQQQMAgsgAiAB +QT9xQYABcjoADiACIAFBDHZB4AFyOgAMIAIgAUEGdkE/cUGAAXI6AA1BAwwBCyACIAFBP3FBgAFyOgANIAIgAUEGdkHAAXI6AAxB +AgshASABIAAoAgAgACgCCCIDa0sEQCAAIAMgARBgIAAoAgghAwsgACgCBCADaiACQQxqIAEQNRogACABIANqNgIIDAELIAAoAggi +AyAAKAIARgRAIABBuMbAABBsCyAAKAIEIANqIAE6AAAgACADQQFqNgIICyACQRBqJABBAAvEAgEEfyAAQgA3AhAgAAJ/QQAgAUGA +AkkNABpBHyABQf///wdLDQAaIAFBBiABQQh2ZyIDa3ZBAXEgA0EBdGtBPmoLIgI2AhwgAkECdEHog8EAaiEEQQEgAnQiA0GEh8EA +KAIAcUUEQCAEIAA2AgAgACAENgIYIAAgADYCDCAAIAA2AghBhIfBAEGEh8EAKAIAIANyNgIADwsCQAJAIAEgBCgCACIDKAIEQXhx +RgRAIAMhAgwBCyABQRkgAkEBdmtBACACQR9HG3QhBQNAIAMgBUEddkEEcWpBEGoiBCgCACICRQ0CIAVBAXQhBSACIQMgAigCBEF4 +cSABRw0ACwsgAigCCCIBIAA2AgwgAiAANgIIIABBADYCGCAAIAI2AgwgACABNgIIDwsgBCAANgIAIAAgAzYCGCAAIAA2AgwgACAA +NgIIC/oCAgF/AX4jAEHgAWsiAiQAIAIgASkDADcDQCACIAEpAwg3A0ggAiABKQMQNwNQIAJCgICAgKAHIgMgAkHYAGqthDcDOCAC +IAMgAkHQAGqthDcDMCACIAMgAkHIAGqthDcDKCACIAMgAkFAa62ENwMgIAIgASkDGDcDWCACQQM6ANwBIAJBCDYC2AEgAkKggICA +MDcC0AEgAkKAgICAgAI3AsgBIAJBAjYCwAEgAkEDOgC8ASACQQg2ArgBIAJCoICAgCA3ArABIAJCgICAgIACNwKoASACQQI2AqAB +IAJBAzoAnAEgAkEINgKYASACQqCAgIAQNwKQASACQoCAgICAAjcCiAEgAkECNgKAASACQQM6AHwgAkEINgJ4IAJCIDcCcCACQoCA +gICAAjcCaCACQQI2AmAgAkEENgIcIAJBBDYCDCACQeS6wAA2AgggAkEENgIUIAIgAkHgAGo2AhggAiACQSBqNgIQIAAgAkEIahBH +IAJB4AFqJAALiwIBAX8jAEEQayICJAAgACgCACEAAn8gASgCACABKAIIcgRAIAJBADYCDCABIAJBDGoCfyAAQYABTwRAIABBgBBP +BEAgAEGAgARPBEAgAiAAQT9xQYABcjoADyACIABBEnZB8AFyOgAMIAIgAEEGdkE/cUGAAXI6AA4gAiAAQQx2QT9xQYABcjoADUEE +DAMLIAIgAEE/cUGAAXI6AA4gAiAAQQx2QeABcjoADCACIABBBnZBP3FBgAFyOgANQQMMAgsgAiAAQT9xQYABcjoADSACIABBBnZB +wAFyOgAMQQIMAQsgAiAAOgAMQQELEDEMAQsgASgCHCAAIAEoAiAoAhARAAALIAJBEGokAAv8AQIEfwF+IwBBIGsiBSQAAkACQCAE +RQ0AIAEgASACaiICSw0AIAMgBGpBAWtBACADa3GtIAIgACgCACIBQQF0IgYgAiAGSxsiAkEIQQRBASAE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JBBEZyDQAgAS0ABEEuRiIDIAJBBUZyDQAgAS0ABUEuRiIDIAJB +BkZyDQAgAS0ABkEuRiEDCyAAIAMgAC0ABHI6AAQgACgCACABIAIQugEgBkEQaiQAC9MBAgZ/AX4jAEEgayICJABBBCAAKAIAIgRB +AWoiAyAEQQF0IgUgAyAFSxsiAyADQQRNGyIFrUIUfiIIQiCIUEUEQEEAQQAgARCxAQALAkAgCKciB0H8////B00EQEEAIQMgAiAE +BH8gAiAEQRRsNgIcIAIgACgCBDYCFEEEBSADCzYCGCACQQhqQQQgByACQRRqEHMgAigCCEEBRw0BIAIoAgwhBiACKAIQIQMLIAYg +AyABELEBAAsgAigCDCEBIAAgBTYCACAAIAE2AgQgAkEgaiQAC94BAQR/IwBBEGsiAyQAIAAoAgwhAQJAAn8CQAJAAkACQAJAIAAo +AgQOAgABAgsgAQ0BQQEhAUEAIQBBASECDAMLIAFFDQELIANBBGogABBHIAMoAgQhACADKAIIIQIgAygCDAwCCyAAKAIAIgEoAgQi +AEEASA0CIAEoAgAhASAARQRAQQEhAkEAIQAMAQtB+YLBAC0AABpBASEEIABBARC+ASICRQ0CCyACIAEgABA1GiAACyEBIAIgARC0 +ASAABEAgAiAAEMoBCyADQRBqJAAPCyAEIABBlIvAABCxAQAL0AEBBX8jAEEgayIBJAAgACgCACIDQQFqIgIgA0EBdCIEIAIgBEsb +IgJB/////wBLBEBBAEEAQbiQwAAQsQEACwJAQQQgAiACQQRNGyICQQR0IgRB/P///wdNBH8gASADBH8gASADQQR0NgIcIAEgACgC +BDYCFEEEBUEACzYCGCABQQhqQQQgBCABQRRqEHMgASgCCEEBRw0BIAEoAhAhBSABKAIMBUEACyAFQbiQwAAQsQEACyABKAIMIQMg +ACACNgIAIAAgAzYCBCABQSBqJAAL8gEBAn8jAEEwayICJAACQCAAKQMAQv///////////wCDQoCAgICAgID4/wBaBEAgAkEBNgIU +IAJBvMHAADYCECACQgE3AhwgAiAArUKAgICAwAiENwMoIAIgAkEoajYCGCAB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DcDKCADIAQgA0EEaq2ENwMgIAMgA0EgajYCECADQQhqIAIQnQEAC2cAIwBBMGsiACQAQfiCwQAt +AAAEQCAAQQI2AgwgAEGIycAANgIIIABCATcCFCAAIAE2AiwgACAAQSxqrUKAgICAoAmENwMgIAAgAEEgajYCECAAQQhqQbDJwAAQ +nQEACyAAQTBqJAALnAICA38BfiMAQRBrIgEkACABQaiDwQA2AgQgAEGwg8EALQAAQQNHBH8gASABQQRqNgIIIAEgAUEIajYCDCAB +QQxqIQIjAEEgayIAJAACQAJAAkACQAJAAkACQEGwg8EALQAAQQFrDgMCBAEAC0Gwg8EAQQI6AAAgAigCACIDKAIAIQIgA0EANgIA +IAJFDQIgAigCAEKACDcDAEGwg8EAQQM6AAALIABBIGokAAwECyAAQQA2AhggAEEBNgIMIABBqLDAADYCCAwCC0HoscAAENEBAAsg +AEEANgIYIABBATYCDCAAQeiwwAA2AggLIABCBDcCECAAQQhqQeyvwAAQnQEACyABKAIEBUGog8EACykDABCuASABQRBqJABQC14B +AX8jAEEwayICJAAgAiABNgIMIAIgADYCCCACQQI2AhQgAkHojMAANgIQIAJCATcCHCACIAJBCGqtQoCAgICwAYQ3AyggAiACQShq +NgIYIAJBEGoQZCACQTBqJAALXgEBfyMAQTBrIgIkACACIAE2AgwgAiAANgIIIAJBAjYCFCACQYyNwAA2AhAgAkIBNwIcIAIgAkEI +aq1CgICAgLABhDcDKCACIAJBKGo2AhggAkEQahBkIAJBMGokAAtbAQF/IAEoAgAiBEEBcQRAIAAgASAEIARBfnEgAiADEG0PCyAE +IAQoAggiAUEBajYCCCABQQBOBEAgACAENgIMIAAgAzYCCCAAIAI2AgQgAEG8uMAANgIADwsAC2MBAX9BACEBAkAgA0EATgRAIANF +BEBBASEEDAILQfmCwQAtAAAaQQEhASADQQEQvgEiBA0BCyABIANBpLbAABCxAQALIAQgAiADEDUhASAAIAM2AgggACABNgIEIAAg +AzYCAAtYAQF/IAEoAgAiBEEBcQRAIAAgASAEIAQgAiADEG0PCyAEIAQoAggiAUEBajYCCCABQQBOBEAgACAENgIMIAAgAzYCCCAA +IAI2AgQgAEG8uMAANgIADwsAC1gBAX8jAEEgayIDJAAgA0EYaiACQRhqKQAANwMAIANBEGogAkEQaikAADcDACADQQhqIAJBCGop +AAA3AwAgAyACKQAANwMAIAAgAyABQSAQMiADQSBqJAALTgAjAEEgayIAJAAgAEEBNgIEIABB4L7AADYCACAAQgE3AgwgAELIvsCA +wAc3AxggACAAQRhqNgIIIAEoAhwgASgCICAAEDggAEEgaiQAC00BAX8jAEEwayIBJAAgAUEBNgIMIAFBsOTAADYCCCABQgE3AhQg +ASABQS9qrUKAgICAgAyENwMgIAEgAUEgajYCECABQQhqIAAQnQEAC0MAIAEoAgAiAUEBcQRAIAFBfnEgAiADEOUBIQEgACADNgII +IAAgATYCBCAAIAIgA2ogAWs2AgAPCyAAIAEgAiADEF4LOgEBfyMAQSBrIgAkACAAQQA2AhggAEEBNgIMIABBtMrAADYCCCAAQgQ3 +AhAgAEEIakHoysAAEJ0BAAtFAQF/IAIgACgCACAAKAIIIgNrSwRAIAAgAyACQQFBARBYIAAoAgghAwsgACgCBCADaiABIAIQNRog +ACACIANqNgIIQQALQQEBfyACIAAoAgAgACgCCCIDa0sEQCAAIAMgAhBgIAAoAgghAwsgACgCBCADaiABIAIQNRogACACIANqNgII +QQALQAAgASgCACIBQQFxBEAgASACIAMQ5QEhASAAIAM2AgggACABNgIEIAAgAiADaiABazYCAA8LIAAgASACIAMQXgtCAQF/IAAo +AgAiACgCMCIBBEAgACgCNCABEMoBCwJAIABBf0YNACAAIAAoAgRBAWsiATYCBCABDQAgAEHIABDKAQsLTwECf0H5gsEALQAAGiAB +KAIEIQIgASgCACEDQQhBBBC+ASIBRQRAQQRBCBDjAQALIAEgAjYCBCABIAM2AgAgAEHQycAANgIEIAAgATYCAAtBAQF/IAIgACgC +ACAAKAIIIgNrSwRAIAAgAyACEGcgACgCCCEDCyAAKAIEIANqIAEgAhA1GiAAIAIgA2o2AghBAAtCAQF/IwBBIGsiAyQAIANBADYC +ECADQQE2AgQgA0IENwIIIAMgATYCHCADIAA2AhggAyADQRhqNgIAIAMgAhCdAQALQAEBfyABKAIAIgEgASgCCCIEQQFqNgIIIARB +AEgEQAALIAAgATYCDCAAIAM2AgggACACNgIEIABBvLjAADYCAAs8ACAAIAEpAAA3AAAgAEEYaiABQRhqKQAANwAAIABBEGogAUEQ +aikAADcAACAAQQhqIAFBCGopAAA3AAALjgIBA38gACgCACECIAEoAhQiAEEQcUUEQCAAQSBxRQRAIAIgARDQAQ8LQQAhACMAQYAB +ayIEJAAgAigCACECA0AgACAEakH/AGogAkEPcSIDQTByIANBN2ogA0EKSRs6AAAgAEEBayEAIAJBD0sgAkEEdiECDQALIAFBAUHc +5sAAQQIgACAEakGAAWpBACAAaxAwIARBgAFqJAAPC0EAIQAjAEGAAWsiBCQAIAIoAgAhAgNAIAAgBGpB/wBqIAJBD3EiA0EwciAD +QdcAaiADQQpJGzoAACAAQQFrIQAgAkEPSyACQQR2IQINAAsgAUEBQdzmwABBAiAAIARqQYABakEAIABrEDAgBEGAAWokAAvgcwMj +fxp+AXwgASgCFEEBcSECIAArAwAhPwJAIAEoAghBAUYEQAJ/IAEhCCABKAIMIRNBACEAIwBB8AhrIgkkACA/vSEnAn9BAyA/mUQA +AAAAAADwf2ENABpBAiAnQoCAgICAgID4/wCDIiZCgICAgICAgPj/AFENABogJ0L/////////B4MiKUKAgICAgICACIQgJ0IBhkL+ +////////D4MgJ0I0iKdB/w9xIgEbIiVCAYMhKCAmUARAQQQgKVANARogAUGzCGshAEIBISYgKFAMAQtCgICAgICAgCAgJUIBhiAl +QoCAgICAgIAIUSIAGyElQgJCASAAGyEmQct3Qcx3IAAbIAFqIQAgKFALIQEgCSAAOwHoCCAJICY3A+AIIAlCATcD2AggCSAlNwPQ +CCAJIAE6AOoIAkACfwJAAkACQAJAIAFBAmsiAwRAQQEhAUG748AAQbzjwAAgJ0IAUyIGG0G748AAQQEgBhsgA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AXEQKQsgBSgC0AIhDiAFQZwFaiAFQbABakGgARA1 +GiAFIA42ArwGIAciBkEKTwRAIAVBlAVqIQEDQCAFKAK8BiIEQSlPDQoCQCAERQ0AIARBAnQhAAJ/IARB/////wNqIgJB/////wNx +IgNFBEBCACElIAVBnAVqIABqDAELIAAgAWohBCADQQFqQf7///8HcSEDQgAhJQNAIARBBGoiACAANQIAICVCIIaEIiVCgJTr3AOA +IiY+AgAgBCAENQIAICUgJkKAlOvcA359QiCGhCIlQoCU69wDgCImPgIAICUgJkKAlOvcA359ISUgBEEIayEEIANBAmsiAw0ACyAE +QQhqCyACQQFxDQBBBGsiACAANQIAICVCIIaEQoCU69wDgD4CAAsgBkEJayIGQQlLDQALCyAGQQJ0QZjhwABqKAIAQQF0IgFFDQUg +BSgCvAYiBEEpTw0IIAQEfyAEQQJ0IQAgAa0hJQJ/IARB/////wNqIgFB/////wNxIgJFBEBCACEmIAVBnAVqIABqDAELIAJBAWpB +/v///wdxIQMgACAFakGUBWohBEIAISYDQCAEQQRqIgAgADUCACAmQiCGhCImICWAIic+AgAgBCAENQIAICYgJSAnfn1CIIaEIiYg +JYAiJz4CACAmICUgJ359ISYgBEEIayEEIANBAmsiAw0ACyAEQQhqCyEAIAFBAXFFBEAgAEEEayIAIAA1AgAgJkIghoQgJYA+AgAL +IAUoArwGBUEACyEAIAUoAqwBIgEgACAAIAFJGyIAQShLDREgAEUEQEEAIQAMCAsgAEEBcSEMIABBAUYEQEEAIQYMBwsgAEE+cSER +QQAhBiAFQZwFaiEEIAVBDGohAwNAIAQgBCgCACINIAMoAgBqIgIgBkEBcWoiEDYCACAEQQRqIgYgBigCACIWIANBBGooAgBqIgYg +AiANSSACIBBLcmoiAjYCACAGIBZJIAIgBklyIQYgA0EIaiEDIARBCGohBCARIApBAmoiCkcNAAsMBgtB18/AAEEcQeDSwAAQkAEA +C0GE0MAAQR1B8NLAABCQAQALQbTQwABBHEGA08AAEJABAAtBmNLAAEE2QfDTwAAQkAEAC0H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AQQFqQTAgBEEBaxBDGgwDCwJ/QTEgBkUNABogC0ExOgAAQTAgBkEBRg0AGiALQQFqQTAgBkEB +axBDGkEwCyAPQQFqIQ8gHSAGIAdPcg0COgAAIAZBAWohBgwCCyAAIAdBkNPAABB9AAsgBiAHQaDTwAAQzgEACyAGIAdLDQELIBgg +DzsBCCAYIAY2AgQgGCALNgIAIAVBwAZqJAAMBgsgBiAHQbDTwAAQzgEACyAEQShBlPjAABDOAQALQShBKEGU+MAAEH0ACyABQShB +lPjAABDOAQALQaT4wABBGkGU+MAAEJABAAsgCUHICGogCUGYCGooAgA2AgAgCSAJKQKQCDcDwAgLIBQgCS4ByAgiAEgEQCAJQQhq +IAkoAsAIIAkoAsQIIAAgEyAJQZAIahBRIAkoAgwhASAJKAIIDAMLQQIhASAJQQI7AZAIIBNFBEBBASEBIAlBATYCmAggCUHD48AA +NgKUCCAJQZAIagwDCyAJIBM2AqAIIAlBADsBnAggCUECNgKYCCAJQbnjwAA2ApQIIAlBkAhqDAILQcTjwABBJUHs48AAEJABAAtB +ASEBIAlBATYCmAggCUHD48AANgKUCCAJQZAIagshACAJIAE2AswIIAkgADYCyAggCSAcNgLECCAJIBk2AsAIIAggCUHACGoQOSAJ +QfAIaiQADAELIABBKEGU+MAAEM4BAAsPCwJ/IAEhEUEAIQBBACEBIwBBgAFrIgQkACA/vSEmAn9BAyA/mUQAAAAAAADwf2ENABpB +AiAmQoCAgICAgID4/wCDIidCgICAgICAgPj/AFENABogJkL/////////B4MiKUKAgICAgICACIQgJkIBhkL+////////D4MgJkI0 +iKdB/w9xIgAbIiVCAYMhKCAnUARAQQQgKVANARogAEGzCGshAEIBIScgKFAMAQtCgICAgICAgCAgJUIBhiAlQoCAgICAgIAIUSID +GyElQgJCASADGyEnQct3Qcx3IAMbIABqIQAgKFALIQMgBCAAOwF4IAQgJzcDcCAEQgE3A2ggBCAlNwNgIAQgAzoAegJAAn8CQAJA +AkAgA0ECayIDBEBBASEAQbvjwABBvOPAACAmQgBTIgYbQbvjwABBASAGGyACGyEYQQEgJkI/iKcgAhshGUEDIAMgA0EDTxtBAmsO +AgMCAQsgBEEDNgIoIARBvePAADYCJCAEQQI7ASBBASEYQQEhACAEQSBqDAMLIARBAzYCKCAEQcDjwAA2AiQgBEECOwEgIARBIGoM +AgsgBEEgaiEGIARBD2oiDiEIIwBBMGsiAyQAAkACQAJ/AkACQAJAAkACQAJAAkACQCAEQeAAaiIMIgApAwAiJVBFBEAgACkDCCIn +UA0BIAApAxAiJlANAiAlICZ8IiYgJVQNAyAlICdUDQQgJkKAgICAgICAgCBaDQUgAyAALwEYIgA7AQggAyAlICd9Iic3AwAgACAA +QSBrIAAgJkKAgICAEFQiAhsiC0EQayALICZCIIYgJiACGyImQoCAgICAgMAAVCICGyILQQhrIAsgJkIQhiAmIAIbIiZCgICAgICA +gIABVCICGyILQQRrIAsgJkIIhiAmIAIbIiZCgICAgICAgIAQVCICGyILQQJrIAsgJkIEhiAmIAIbIiZCgICAgICAgIDAAFQiAhsg +JkIChiAmIAIbIihCAFkiC2siAmvBIglBAEgNBiADQn8gCa0iKYgiJiAngzcDECAmICdUDQogAyAAOwEIIAMgJTcDACADICUgJoM3 +AxAgJSAmVg0KQaB/IAJrwUHQAGxBsKcFakHOEG0iAEHRAE8NByAAQQR0IgBBgNTAAGopAwAiKkL/////D4MiJiAlIClCP4MiJYYi +K0IgiCI1fiIsQiCIIjEgKkIgiCIpIDV+IjJ8ICkgK0L/////D4MiKn4iK0IgiCI2fCEzICxC/////w+DICYgKn5CIIh8ICtC//// +/w+DfCI3QoCAgIAIfEIgiCErQgFBACACIABBiNTAAGovAQBqa0E/ca0iLIYiKkIBfSEuICYgJyAlhiIlQiCIIid+Ii1C/////w+D +ICYgJUL/////D4MiJX5CIIh8ICUgKX4iJUL/////D4N8Ij5CgICAgAh8QiCIITQgJyApfiE4ICVCIIghOSAtQiCIITogAEGK1MAA +ai8BACEJICkgKCALrYYiJUIgiCI7fiI8ICYgO34iJ0IgiCI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ICxUICcgMnwgKSArfFpyRQRAICYgK3whJUEAIQIMBwsgDyANQQFrIg06AAAg +JiAofCEmICcgLnwhLSAsIC9WBEAgKCApfCEpICUgKHwhJSAnICh9IScgKCAtWA0BCwsgKCAtViECICYgK3whJQwFCyABQQFqIQEg +AkEKSSACQQpuIQJFDQALQdDfwAAQlwEACyABIAhqQQFrIQsgKiAxIDZ8IDdCgICAgAh8QiCIfCAyfEIKfiAvIDB8ID1CgICAgAh8 +QiCIfCA8fEIKfn0gKH58IS0gKUIKfiAmICp8fSEuICwgJn0hL0IAISkDQCAmICp8IiUgLFQgKSAvfCAmIC18WnJFBEBBACEADAUL +IAsgAkEBayICOgAAICkgLnwiMCAqVCEAICUgLFoNBSApICp9ISkgJSEmICogMFgNAAsMBAtBEUERQeDfwAAQfQALIAFBEUHw38AA +EH0ACwJAICUgKlogAnINACAqICUgKHwiJlggKiAlfSAmICp9VHENACAGQQA2AgAMBAsgJSA0QgN9WCAlQgJacUUEQCAGQQA2AgAM +BAsgBiAJOwEIIAYgAUEBajYCBAwCCyAmISULAkAgJSArWiAAcg0AICsgJSAqfCImWCArICV9ICYgK31UcQ0AIAZBADYCAAwCCyAl +IChCWH4gJ3xYICUgKEIUflpxRQRAIAZBADYCAAwCCyAGIAk7AQggBiABNgIECyAGIAg2AgALIANBMGokAAwBCyADQQA2AhgjAEEQ +ayIAJAAgACADNgIMIAAgA0EQajYCCCAAQQhqQajlwAAgAEEMakGo5cAAIANBGGpB/M3AABBLAAsCQCAEKAIgRQRAIARB0ABqIRAj +AEGgCmsiASQAAkACQAJAAkAgAQJ/AkACQAJAAkACQAJAIAwpAwAiJVBFBEAgDCkDCCInUA0BIAwpAxAiJlANAiAlICZ8IiggJVQN +AyAlICdUDQQgDCwAGiETIAwuARghACABICU+AgAgAUEBQQIgJUKAgICAEFQiAhs2AqABIAFBACAlQiCIpyACGzYCBCABQQhqQQBB +mAEQQxogASAnPgKkASABQQFBAiAnQoCAgIAQVCICGzYCxAIgAUEAICdCIIinIAIbNgKoASABQawBakEAQZgBEEMaIAEgJj4CyAIg +AUEBQQIgJkKAgICAEFQiAhs2AugDIAFBACAmQiCIpyACGzYCzAIgAUHQAmpBAEGYARBDGiABQfADakEAQZwBEEMaIAFBATYC7AMg +AUEBNgKMBSAArCAoQgF9eX1CwprB6AR+QoChzaC0AnxCIIinIgLBIQ0CQCAAQQBOBEAgASAAED8aIAFBpAFqIAAQPxogAUHIAmog +ABA/GgwBCyABQewDakEAIABrwRA/GgsCQCANQQBIBEAgAUEAIA1rQf//A3EiABApIAFBpAFqIAAQKSABQcgCaiAAECkMAQsgAUHs +A2ogAkH//wFxECkLIAEoAqABIQMgAUH8CGogAUGgARA1GiABIAM2ApwKIAEoAugDIgsgAyADIAtJGyICQShLDRIgAkUEQEEAIQIM +BwsgAkEBcSEJIAJBAUYNBSACQT5xIQogAUH8CGohACABQcgCaiEIA0AgACAFIAAoAgAiDyAIKAIAaiIGaiIFNgIAIABBBGoiDCAM +KAIAIhQgCEEEaigCAGoiDCAFIAZJIAYgD0lyaiIGNgIAIAYgDEkgDCAUSXIhBSAIQQhqIQggAEEIaiEAIAogB0ECaiIHRw0ACwwF +C0HXz8AAQRxB9M/AABCQAQALQYTQwABBHUGk0MAAEJABAAtBtNDAAEEcQdDQwAAQkAEAC0GY0sAAQTZB0NLAABCQAQALQdDRwABB +N0GI0sAAEJABAAsgCQR/IAdBAnQiACABQfwIamoiBiAGKAIAIgYgAUHIAmogAGooAgBqIgAgBWoiBzYCACAAIAZJIAAgB0tyBSAF +C0UNACACQShGDQMgAUH8CGogAkECdGpBATYCACACQQFqIQILIAEgAjYCnAogAiABKAKMBSIHIAIgB0sbIgBBKU8NAyAAQQJ0IQAC +QANAIAAEQEF/IABBBGsiACABQfwIamooAgAiAiAAIAFB7ANqaigCACIGRyACIAZLGyIIRQ0BDAILC0F/QQAgABshCAsgCCATSARA +IA1BAWohDQwCCwJAIANFBEBBACEDDAELIANBAWtB/////wNxIgBBAWoiAkEDcSE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AA3AAAgACAB +QSBqNgIMIAFBGGogBEEYaikAADcAACABQRBqIARBEGopAAA3AAAgAUEIaiAEQQhqKQAANwAACyAAIAFBAWo2AgQgAS0AACEAQQEL +IQEgBSAAOgABIAUgAToAAAJAIAUtAABFBEAgC0EANgIIIAtCgICAgBA3AgACQCACKAIAIgBFDQAgAigCCCIBRQ0AIAAgARDKAQsg +AigCECIARQ0BIAIoAhgiAUUNASAAIAEQygEMAQsCQEEIQX8gAigCDCIRIAIoAgQiDmtBACACKAIAIgQbIgEgAigCHCIYIAIoAhQi +AGtBACACKAIQIhQbaiIGIAEgBksbQQFqIgFBfyABGyIBIAFBCE0bIgFBAEgNACAFLQABIQlB+YLBAC0AABpBASEIIAFBARC+ASIG +RQ0AIAYgCToAACAFQQE2AgwgBSAGNgIIIAUgATYCBCACKAIkIRogAigCICEJIAIoAhghGSACKAIIIQhBASECA0ACfwJ/AkAgBEUN +ACAOIA4gEUcNARogCEUNACAEIAgQygELAkAgCUUgCSAaRnJFBEBB+YLBAC0AABpBIEEBEL4BIgQNAUEBQSBB0K7AABCxAQALAkAg +FEUNACAAIBhHBEBBACEEIAAiAUEBagwECyAZRQ0AIBQgGRDKAQsgCyAFKQIENwIAIAtBCGogBUEMaigCADYCAAwFCyAEIAkpAAA3 +AAAgBEEYaiAJQRhqKQAANwAAIARBEGogCUEQaikAADcAACAEQQhqIAlBCGopAAA3AABBICEIIARBIGohESAJQSBqIQkgBAsiAUEB +aiEOIAALIQAgAS0AACEbIAUoAgQgAkYEQCAFQQRqIQwjAEEgayIBJAACQAJAIAJBfyARIA5rQQAgBBsiBiAYIABrQQAgFBtqIhIg +BiASSxtBAWoiBkF/IAYbIAJqIgZLDQBBCCAGIAwoAgAiEkEBdCIVIAYgFUsbIgYgBkEITRsiFa0iHUIgiFBFDQAgHaciHEH///// +B0sNACABIBIEfyABIBI2AhwgASAMKAIENgIUQQEFQQALNgIYIAFBCGpBASAcIAFBFGoQcyABKAIIQQFHDQEgASgCECEGIAEoAgwh +FgsgFiAGQeyywAAQsQEACyABKAIMIQYgDCAVNgIAIAwgBjYCBCABQSBqJAAgBSgCCCEGCyACIAZqIBs6AAAgBSACQQFqIgI2AgwM +AAsACyAIIAFB0K3AABCxAQALIAVBEGokACAHQUBrIgBB4K7AACAHKAIQIgEgBygCFBAyIANBKGoiAiAAEJIBIAcoAgwiAARAIAEg +ABDKAQsgB0HgAGokACAPIAIQViAXRQ0BIBAgF0EFdBDKAQwBCyADQQA2AiQgA0KAgICAEDcCHCADQaCCwAA2AkggA0EDOgBAIANC +IDcCOCADQQA2AjAgA0EANgIoIAMgA0EcajYCRCADQc8AaiADQShqELcBDQEgAygCHCEAIAMoAiAiASADKAIkELMBIQIgAARAIAEg +ABDKAQsgD0GAgICAeDYCACAPIAI2AgQLIANB0ABqJAAMAQtByILAAEE3IANBzwBqQbiCwABB8IPAABB5AAsCQAJAIA0CfyAKKAIU +IgNBgICAgHhGBEBBACEAIAooAhghAUEBDAELIAooAhghAQJAIAooAhwiEyADTwRAIAEhAAwBCyATRQRAQQEhACABIAMQygEMAQsg +ASADQQEgExC2ASIARQ0CC0EAIQFBAAs2AgwgDSABNgIIIA0gEzYCBCANIAA2AgAgCkEgaiQADAELQQEgE0GQgsAAELEBAAsgDSgC +ACANKAIEIA0oAgggDSgCDCANQRBqJAALqQ0CGX8EfiMAQRBrIgskACMAQSBrIgYkAAJAAkACQCAABEAgAEEIayINIA0oAgBBAWoi +CTYCACAJRQ0BIAAoAgANAiAAQX82AgAgBiANNgIQIAYgADYCDCAGIAI2AhwgBiABNgIYIAYgAjYCFCAGIABBCGoiCTYCCEEAIQIj +AEHwAGsiAyQAIANBEGohDyAGQRRqIhQoAgQhFSAUKAIIIQcjAEGAAWsiASQAIAFBADYCFCABQoCAgICAATcCDAJAAkAgBwRAIAFB +yABqQQRyIQQDQCACIAdLDQIgAUHIAGogCSACIBVqIAcgAmtBABAuIAFBIGoiESAEQQhqKQIANwMAIAFBKGoiEiAEQRBqKQIANwMA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RAIAIhBQwB +CyAGRQRAQQEhBSACIAQQygEMAQsgAiAEQQEgBhC2ASIFRQ0CC0EAIQRBACECDAILQQEhAkEAIQUMAQtBASAGQZCCwAAQsQEACyAD +IAI2AgwgAyAENgIIIAMgBjYCBCADIAU2AgAgAUEwaiQAIAMoAgAgAygCBCADKAIIIAMoAgwgA0EQaiQAC5gDAQl/IwBBEGsiAiQA +EEgiAyAAJgEjAEEQayIGJAAgBkEEaiEEIwBB4ABrIgEkACABQUBrIAMQQiABKAJEIQMCQCABKAJAIghBgICAgHhHBEACQCABKAJI +IgdFBEAgAUEYakIANwMAIAFBEGpCADcDACABQQhqQgA3AwAgAUIANwMADAELIAFBIGoiCSADIAcQLSABQUBrIgdB1IbAABCSASAB +IAkgBxCFAQsgBCABEFYgCEUNASADIAhBKGwQygEMAQsgBEGAgICAeDYCACAEIAM2AgQLIAFB4ABqJAACQAJAIAICfyAGKAIEIgNB +gICAgHhGBEAgBigCCCEBQQAhBEEBDAELIAYoAgghAQJAIAYoAgwiBCADTwRAIAEhBQwBCyAERQRAQQEhBSABIAMQygEMAQsgASAD +QQEgBBC2ASIFRQ0CC0EAIQFBAAs2AgwgAiABNgIIIAIgBDYCBCACIAU2AgAgBkEQaiQADAELQQEgBEGQgsAAELEBAAsgAigCACAC +KAIEIAIoAgggAigCDCACQRBqJAAL+gECAn8BfiMAQRBrIgIkACACQQE7AQwgAiABNgIIIAIgADYCBCMAQRBrIgEkACACQQRqIgAp +AgAhBCABIAA2AgwgASAENwIEIwBBEGsiACQAIAFBBGoiASgCACICKAIMIQMCQAJAAkACQCACKAIEDgIAAQILIAMNAUEBIQJBACED +DAILIAMNACACKAIAIgIoAgQhAyACKAIAIQIMAQsgAEGAgICAeDYCACAAIAE2AgwgAEH8ycAAIAEoAgQgASgCCCIALQAIIAAtAAkQ +agALIAAgAzYCBCAAIAI2AgAgAEHgycAAIAEoAgQgASgCCCIALQAIIAAtAAkQagALmwYBCn8jAEEQayIGJAAjAEEgayIFJAACQAJA +AkAgAARAIABBCGsiByAHKAIAQQFqIgM2AgAgA0UNASAAKAIADQIgAEF/NgIAIAUgBzYCHCAFIAA2AhggBSAAQQhqIgM2AhQgBUEI +aiEJIwBBkAFrIgEkACABQQA2AhQgAUKAgICAwAA3AgwjAEFAaiICJAAgAkEIaiADQQFBAEEBEC4gAUEYaiIEQShqIAJBMGopAwA3 +AwAgBEEgaiACQShqKQMANwMAIARBGGogAkEgaikDADcDACAEQRBqIAJBGGopAwA3AwAgBEEIaiACQRBqKQMANwMAIAQgAikDCDcD +ACACQUBrJAAgASgCGARAIAFB8ABqIAFBQGspAwA3AwAgAUHoAGogAUE4aikDADcDACABQeAAaiABQTBqKQMANwMAIAFB2ABqIgIg +AUEoaikDADcDACABQdAAaiIEIAFBIGopAwA3AwAgASABKQMYNwNIIAIQfyEIIAFB/ABqIAIQViABIAg6AIwBIAEgBCgCACICNgKI +ASABQdQAaiABKAJMIAIgASgCSCgCEBEDACABKAIUIgIgASgCDEYEQCABQQxqQcSGwAAQYwsgASgCECACQRRsaiIEIAEpAnw3AgAg +BEEIaiABQYQBaikCADcCACAEQRBqIAFBjAFqKAIANgIAIANBAToAMCABIAJBAWo2AhQLIAFBADYCGCABIAFBGGogAUEMahBhIAEo +AgQhBCABKAIAIQggASgCFCICBEAgASgCECEDA0AgAygCACIKBEAgA0EEaigCACAKEMoBCyADQRRqIQMgAkEBayICDQALCyABKAIM +IgMEQCABKAIQIANBFGwQygELIAkgBDYCBCAJIAg2AgAgAUGQAWokACAFKAIMIQMgBSgCCCEBIABBADYCACAHIAcoAgBBAWsiADYC +ACAARQRAIAVBHGoQjQELIAYgATYCCCAGIANBACABQQFxIgAbNgIEIAZBACADIAAbNgIAIAVBIGokAAwDCxDdAQsACxDeAQALIAYo +AgAgBigCBCAGKAIIIAZBEGokAAshAAJAIAEgAxCiAQRAIAAgASADIAIQtgEiAA0BCwALIAALJQAgAEUEQEGAtcAAQTIQ3AEACyAA +IAIgAyAEIAUgASgCEBESA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LDQAgACgCACgCCEEBRgtrAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2 +AgAgA0ECNgIMIANBkPrAADYCCCADQgI3AhQgAyADQQRqrUKAgICAoAmENwMoIAMgA61CgICAgKAJhDcDICADIANBIGo2AhAgA0EI +aiACEJ0BAAtrAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2AgAgA0ECNgIMIANBsPrAADYCCCADQgI3AhQgAyADQQRqrUKAgICAoAmE +NwMoIAMgA61CgICAgKAJhDcDICADIANBIGo2AhAgA0EIaiACEJ0BAAtrAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2AgAgA0ECNgIM +IANB5PrAADYCCCADQgI3AhQgAyADQQRqrUKAgICAoAmENwMoIAMgA61CgICAgKAJhDcDICADIANBIGo2AhAgA0EIaiACEJ0BAAsL +ACAAKAIAIAEQTAsPAEG45MAAQSsgABCQAQALDQAgACkDAEEBIAEQSQsOACABQYCFwABBBRC6AQsOACABQbyFwABBEBC6AQsOACAB +QaSLwABBBRC6AQsOACABQbiPwABBChC6AQsMACAAKAIAIAEQ0gEL8QMBAX8gACgCACECIwBBkAJrIgAkACAAIAIpAwA3A3AgACAC +KQMINwN4IAAgAikDEDcDgAEgACAAQYgBaq1CgICAgKAHhDcDaCAAIABBgAFqrUKAgICAoAeENwNgIAAgAEH4AGqtQoCAgICgB4Q3 +A1ggACAAQfAAaq1CgICAgKAHhDcDUCAAIAIpAxg3A4gBIABBAzoAjAIgAEEINgKIAiAAQqCAgIAwNwKAAiAAQoCAgICAAjcC+AEg +AEECNgLwASAAQQM6AOwBIABBCDYC6AEgAEKggICAIDcC4AEgAEKAgICAgAI3AtgBIABBAjYC0AEgAEEDOgDMASAAQQg2AsgBIABC +oICAgBA3AsABIABCgICAgIACNwK4ASAAQQI2ArABIABBAzoArAEgAEEINgKoASAAQiA3AqABIABCgICAgIACNwKYASAAQQI2ApAB +IABBBDYCTCAAQQQ2AjwgAEHkusAANgI4IABBBDYCRCAAIABBkAFqNgJIIAAgAEHQAGo2AkAgAEEsaiICIABBOGoQRyAAIAKtQoCA +gICwB4Q3AyAgAEEBNgIMIABB9LvAADYCCCAAQgE3AhQgACAAQSBqNgIQIAEoAhwgASgCICAAQQhqEDggACgCLCICBEAgACgCMCAC +EMoBCyAAQZACaiQACw0AIABBiJLAACABEDgLDgAgAUG0tsAAQQsQugELDQAgAEGkv8AAIAEQOAsJACAAIAEQJAALDQBBgMXAAEEb +ENwBAAsOAEGbxcAAQc8AENwBAAsNACAAQaTHwAAgARA4CwwAIAAgASkCADcDAAsNACAAQYDLwAAgARA4Cw4AIAFB+MrAAEEFELoB +CxoAIAAgAUHUg8EAKAIAIgBBywAgABsRAgAACwoAIAIgACABEDELxgkBCH8CQAJAIAIiBSAAIgcgAWtLBEAgASACaiEAIAIgB2oh +AiAFQRBJDQFBACACQQNxIgZrIQkCQCACQXxxIgMgAk8NACAGQQFrAkAgBkUEQCAAIQQMAQsgBiEIIAAhBANAIAJBAWsiAiAEQQFr +IgQtAAA6AAAgCEEBayIIDQALC0EDSQ0AIARBBGshBANAIAJBAWsgBEEDai0AADoAACACQQJrIARBAmotAAA6AAAgAkEDayAEQQFq +LQAAOgAAIAJBBGsiAiAELQAAOgAAIARBBGshBCACIANLDQALCyADIAUgBmsiBEF8cSIFayECQQAgBWshBgJAIAAgCWoiAEEDcUUE +QCACIANPDQEgASAEakEEayEBA0AgA0EEayIDIAEoAgA2AgAgAUEEayEBIAIgA0kNAAsMAQsgAiADTw0AIABBA3QiBUEYcSEIIABB +fHEiCUEEayEBQQAgBWtBGHEhCiAJKAIAIQUDQCADQQRrIgMgBSAKdCABKAIAIgUgCHZyNgIAIAFBBGshASACIANJDQALCyAEQQNx +IQUgACAGaiEADAELAkAgBUEQSQRAIAchAgwBCwJAIAdBACAHa0EDcSIGaiIEIAdNDQAgByECIAEhAyAGBEAgBiEAA0AgAiADLQAA +OgAAIANBAWohAyACQQFqIQIgAEEBayIADQALCyAGQQFrQQdJDQADQCACIAMtAAA6AAAgAkEBaiADQQFqLQAAOgAAIAJBAmogA0EC +ai0AADoAACACQQNqIANBA2otAAA6AAAgAkEEaiADQQRqLQAAOgAAIAJBBWogA0EFai0AADoAACACQQZqIANBBmotAAA6AAAgAkEH +aiADQQdqLQAAOgAAIANBCGohAyACQQhqIgIgBEcNAAsLIAQgBSAGayIDQXxxIghqIQICQCABIAZqIgBBA3FFBEAgAiAETQ0BIAAh +AQNAIAQgASgCADYCACABQQRqIQEgBEEEaiIEIAJJDQALDAELIAIgBE0NACAAQQN0IgVBGHEhBiAAQXxxIglBBGohAUEAIAVrQRhx +IQogCSgCACEFA0AgBCAFIAZ2IAEoAgAiBSAKdHI2AgAgAUEEaiEBIARBBGoiBCACSQ0ACwsgA0EDcSEFIAAgCGohAQsgAiACIAVq +IgBPDQEgBUEHcSIDBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWohAiADQQFrIgMNAAsLIAVBAWtBB0kNAQNAIAIgAS0AADoAACAC +QQFqIAFBAWotAAA6AAAgAkECaiABQQJqLQAAOgAAIAJBA2ogAUEDai0AADoAACACQQRqIAFBBGotAAA6AAAgAkEFaiABQQVqLQAA +OgAAIAJBBmogAUEGai0AADoAACACQQdqIAFBB2otAAA6AAAgAUEIaiEBIAJBCGoiAiAARw0ACwwBCyACIAVrIgQgAk8NACAFQQNx +IgEEQANAIAJBAWsiAiAAQQFrIgAtAAA6AAAgAUEBayIBDQALCyAFQQFrQQNJDQAgAEEEayEBA0AgAkEBayABQQNqLQAAOgAAIAJB +AmsgAUECai0AADoAACACQQNrIAFBAWotAAA6AAAgAkEEayICIAEtAAA6AAAgAUEEayEBIAIgBEsNAAsLIAcLCgAgACABJQEQBQsO +ACABQcbBwABBAxC6AQsOACABQby/wABBCBC6AQsJACAAQQA2AgALCAAgACUBEAILCAAgACUBEBELCAAgACUBECELBABBAAsCAAsL +tYIBDgBBgIDAAAu1Ai9Vc2Vycy9hc3NhZnZheW5lci9oZi9odWdnaW5nZmFjZS5qcy9wYWNrYW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UAwA3BDII +AQ4BFgUBDwAHARECBwECAQVkAaAHAAE9BAAE/gIAB20HAGCA8ABB8ILBAAsBSQBwCXByb2R1Y2VycwIIbGFuZ3VhZ2UBBFJ1c3QA +DHByb2Nlc3NlZC1ieQMFcnVzdGMdMS44Ni4wICgwNWY5ODQ2ZjggMjAyNS0wMy0zMSkGd2FscnVzBjAuMjMuMwx3YXNtLWJpbmRn +ZW4HMC4yLjEwMABJD3RhcmdldF9mZWF0dXJlcwQrD211dGFibGUtZ2xvYmFscysIc2lnbi1leHQrD3JlZmVyZW5jZS10eXBlcysK +bXVsdGl2YWx1ZQ== +` + .trim() + .replaceAll("\n", ""), +); +const wasmBinary = new Uint8Array(wasmBase64.length); +for (let i = 0; i < wasmBase64.length; i++) { + wasmBinary[i] = wasmBase64.charCodeAt(i); +} +export { wasmBinary }; diff --git a/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.wasm.d.ts b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.wasm.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f801c69db889b8f690c747f2ac6a4d5ba31e3175 --- /dev/null +++ b/node_modules/@huggingface/hub/src/vendor/xet-chunk/chunker_wasm_bg.wasm.d.ts @@ -0,0 +1,19 @@ +/* tslint:disable */ +/* eslint-disable */ +export const memory: WebAssembly.Memory; +export const __wbg_chunker_free: (a: number, b: number) => void; +export const chunker_new: (a: number) => number; +export const chunker_add_data: (a: number, b: number, c: number) => [number, number, number]; +export const chunker_finish: (a: number) => [number, number, number]; +export const compute_xorb_hash: (a: any) => [number, number, number, number]; +export const compute_file_hash: (a: any) => [number, number, number, number]; +export const compute_verification_hash: (a: number, b: number) => [number, number, number, number]; +export const compute_hmac: (a: number, b: number, c: number, d: number) => [number, number, number, number]; +export const __wbindgen_malloc: (a: number, b: number) => number; +export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; +export const __wbindgen_exn_store: (a: number) => void; +export const __externref_table_alloc: () => number; +export const __wbindgen_export_4: WebAssembly.Table; +export const __externref_table_dealloc: (a: number) => void; +export const __wbindgen_free: (a: number, b: number, c: number) => void; +export const __wbindgen_start: () => void; diff --git a/node_modules/@huggingface/hub/tsconfig.json b/node_modules/@huggingface/hub/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..39d83f3de17ed66fd4c6afa8dad7491bd1fd356c --- /dev/null +++ b/node_modules/@huggingface/hub/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "lib": ["ES2022", "DOM"], + "module": "CommonJS", + "moduleResolution": "node", + "target": "ES2022", + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "skipLibCheck": true, + "noImplicitOverride": true, + "outDir": "./dist", + "declaration": true, + "declarationMap": true, + "sourceMap": true + }, + "include": ["src", "index.ts", "cli.ts"], + "exclude": ["dist"] +} diff --git a/node_modules/@huggingface/tasks/LICENSE b/node_modules/@huggingface/tasks/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1e25cde938b8abaa64a25aba817a01b7aba6472d --- /dev/null +++ b/node_modules/@huggingface/tasks/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Hugging Face + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/README.md b/node_modules/@huggingface/tasks/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3d49eb3a8a963177742bf062d844fdf2c7f7890a --- /dev/null +++ b/node_modules/@huggingface/tasks/README.md @@ -0,0 +1,32 @@ +# Tasks + +This package contains the definition files (written in Typescript) for the huggingface.co hub's: + +- **pipeline types** (a.k.a. **task types**) - used to determine which widget to display on the model page, and which inference API to run. +- **default widget inputs** - when they aren't provided in the model card. +- definitions and UI elements for **model and dataset libraries**. + +Please add any missing ones to these definitions by opening a PR. Thanks 🔥 + +⚠️ The hub's definitive doc is at https://huggingface.co/docs/hub. + +## Definition of Tasks + +This package also contains data used to define https://huggingface.co/tasks. + +The Task pages are made to lower the barrier of entry to understand a task that can be solved with machine learning and use or train a model to accomplish it. It's a collaborative documentation effort made to help out software developers, social scientists, or anyone with no background in machine learning that is interested in understanding how machine learning models can be used to solve a problem. + +The task pages avoid jargon to let everyone understand the documentation, and if specific terminology is needed, it is explained on the most basic level possible. This is important to understand before contributing to Tasks: at the end of every task page, the user is expected to be able to find and pull a model from the Hub and use it on their data and see if it works for their use case to come up with a proof of concept. + +## How to Contribute +You can open a pull request to contribute a new documentation about a new task. Under `src/tasks` we have a folder for every task that contains two files, `about.md` and `data.ts`. `about.md` contains the markdown part of the page, use cases, resources and minimal code block to infer a model that belongs to the task. `data.ts` contains redirections to canonical models and datasets, metrics, the schema of the task and the information the inference widget needs. + +![Anatomy of a Task Page](https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/contribution-guide/anatomy.png) + +We have a [`dataset`](https://huggingface.co/datasets/huggingfacejs/tasks) that contains data used in the inference widget. The last file is `const.ts`, which has the task to library mapping (e.g. spacy to token-classification) where you can add a library. They will look in the top right corner like below. + +![Libraries of a Task](https://huggingface.co/datasets/huggingfacejs/tasks/resolve/main/contribution-guide/libraries.png) + +This might seem overwhelming, but you don't necessarily need to add all of these in one pull request or on your own, you can simply contribute one section. Feel free to ask for help whenever you need. + +## Feedback (feature requests, bugs, etc.) is super welcome 💙💚💛💜♥️🧡 diff --git a/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7dc46b97a7ba271fef3a38989e1f0dcd6a5e6af6 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.d.ts @@ -0,0 +1,99 @@ +/** + * Elements configurable by a dataset library. + */ +export interface DatasetLibraryUiElement { + /** + * Pretty name of the library. + * displayed (in tags?, and) on the main + * call-to-action button on the dataset page. + */ + prettyLabel: string; + /** + * Repo name of the library's (usually on GitHub) code repo + */ + repoName: string; + /** + * URL to library's (usually on GitHub) code repo + */ + repoUrl: string; + /** + * URL to library's docs + */ + docsUrl?: string; +} +export declare const DATASET_LIBRARIES_UI_ELEMENTS: { + mlcroissant: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + webdataset: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + datasets: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + pandas: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + dask: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + distilabel: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + fiftyone: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + lance: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + argilla: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + polars: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + duckdb: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; + datadesigner: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + }; +}; +export type DatasetLibraryKey = keyof typeof DATASET_LIBRARIES_UI_ELEMENTS; +//# sourceMappingURL=dataset-libraries.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8c7553eddf91259a20de8bdc39ec70c1733e4dac --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dataset-libraries.d.ts","sourceRoot":"","sources":["../../src/dataset-libraries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyES,CAAC;AAGpD,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,6BAA6B,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.js b/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.js new file mode 100644 index 0000000000000000000000000000000000000000..2fe1f0c33dbca3fe6c3c511730fd43c4b28eb6a9 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/dataset-libraries.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DATASET_LIBRARIES_UI_ELEMENTS = void 0; +exports.DATASET_LIBRARIES_UI_ELEMENTS = { + mlcroissant: { + prettyLabel: "Croissant", + repoName: "croissant", + repoUrl: "https://github.com/mlcommons/croissant/tree/main/python/mlcroissant", + docsUrl: "https://huggingface.co/docs/dataset-viewer/mlcroissant", + }, + webdataset: { + prettyLabel: "WebDataset", + repoName: "webdataset", + repoUrl: "https://github.com/webdataset/webdataset", + docsUrl: "https://huggingface.co/docs/hub/datasets-webdataset", + }, + datasets: { + prettyLabel: "Datasets", + repoName: "datasets", + repoUrl: "https://github.com/huggingface/datasets", + docsUrl: "https://huggingface.co/docs/hub/datasets-usage", + }, + pandas: { + prettyLabel: "pandas", + repoName: "pandas", + repoUrl: "https://github.com/pandas-dev/pandas", + docsUrl: "https://huggingface.co/docs/hub/datasets-pandas", + }, + dask: { + prettyLabel: "Dask", + repoName: "dask", + repoUrl: "https://github.com/dask/dask", + docsUrl: "https://huggingface.co/docs/hub/datasets-dask", + }, + distilabel: { + prettyLabel: "Distilabel", + repoName: "distilabel", + repoUrl: "https://github.com/argilla-io/distilabel", + docsUrl: "https://huggingface.co/docs/hub/datasets-distilabel", + }, + fiftyone: { + prettyLabel: "FiftyOne", + repoName: "fiftyone", + repoUrl: "https://github.com/voxel51/fiftyone", + docsUrl: "https://huggingface.co/docs/hub/datasets-fiftyone", + }, + lance: { + prettyLabel: "Lance", + repoName: "lance", + repoUrl: "https://github.com/lance-format/lance", + docsUrl: "https://huggingface.co/docs/hub/datasets-lance", + }, + argilla: { + prettyLabel: "Argilla", + repoName: "argilla", + repoUrl: "https://github.com/argilla-io/argilla", + docsUrl: "https://huggingface.co/docs/hub/datasets-argilla", + }, + polars: { + prettyLabel: "Polars", + repoName: "polars", + repoUrl: "https://github.com/pola-rs/polars", + docsUrl: "https://huggingface.co/docs/hub/datasets-polars", + }, + duckdb: { + prettyLabel: "DuckDB", + repoName: "duckdb", + repoUrl: "https://github.com/duckdb/duckdb", + docsUrl: "https://huggingface.co/docs/hub/datasets-duckdb", + }, + datadesigner: { + prettyLabel: "NeMo Data Designer", + repoName: "datadesigner", + repoUrl: "https://github.com/NVIDIA-NeMo/DataDesigner", + docsUrl: "https://nvidia-nemo.github.io/DataDesigner/", + }, +}; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9bd77d2be8a451d248b0f8776226127e315a039 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.d.ts @@ -0,0 +1,6 @@ +import type { WidgetExample } from "./widget-example.js"; +import type { WidgetType } from "./pipelines.js"; +type PerLanguageMapping = Map; +export declare const MAPPING_DEFAULT_WIDGET: Map; +export {}; +//# sourceMappingURL=default-widget-inputs.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e652e43f9eb09082b9409d0ec2c35eca1d52a541 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"default-widget-inputs.d.ts","sourceRoot":"","sources":["../../src/default-widget-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,KAAK,kBAAkB,GAAG,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC,CAAC;AAoqBtE,eAAO,MAAM,sBAAsB,iCAejC,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.js b/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.js new file mode 100644 index 0000000000000000000000000000000000000000..9bfab33a3603c28c68a01d8827e69f21526b670c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/default-widget-inputs.js @@ -0,0 +1,677 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MAPPING_DEFAULT_WIDGET = void 0; +/// NOTE TO CONTRIBUTORS: +/// +/// When adding sample inputs for a new language, you don't +/// necessarily have to translate the inputs from existing languages. +/// (which were quite random to begin with) +/// +/// i.e. Feel free to be creative and provide better samples. +// +/// The placeholder will be replaced by the correct mask token +/// in the following examples, depending on the model type +/// +/// see [INTERNAL] github.com/huggingface/moon-landing/blob/c5c3d45fe0ab27347b3ab27bdad646ef20732351/server/lib/App.ts#L254 +// +const MAPPING_EN = new Map([ + ["text-classification", [`I like you. I love you`]], + [ + "token-classification", + [ + `My name is Wolfgang and I live in Berlin`, + `My name is Sarah and I live in London`, + `My name is Clara and I live in Berkeley, California.`, + ], + ], + [ + "table-question-answering", + [ + { + text: `How many stars does the transformers repository have?`, + table: { + Repository: ["Transformers", "Datasets", "Tokenizers"], + Stars: [36542, 4512, 3934], + Contributors: [651, 77, 34], + "Programming language": ["Python", "Python", "Rust, Python and NodeJS"], + }, + }, + ], + ], + [ + "question-answering", + [ + { + text: `Where do I live?`, + context: `My name is Wolfgang and I live in Berlin`, + }, + { + text: `Where do I live?`, + context: `My name is Sarah and I live in London`, + }, + { + text: `What's my name?`, + context: `My name is Clara and I live in Berkeley.`, + }, + { + text: `Which name is also used to describe the Amazon rainforest in English?`, + context: `The Amazon rainforest (Portuguese: Floresta Amazônica or Amazônia; Spanish: Selva Amazónica, Amazonía or usually Amazonia; French: Forêt amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain "Amazonas" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species.`, + }, + ], + ], + [ + "zero-shot-classification", + [ + { + text: "I have a problem with my iphone that needs to be resolved asap!", + candidate_labels: "urgent, not urgent, phone, tablet, computer", + multi_class: true, + }, + { + text: "Last week I upgraded my iOS version and ever since then my phone has been overheating whenever I use your app.", + candidate_labels: "mobile, website, billing, account access", + multi_class: false, + }, + { + text: "A new model offers an explanation for how the Galilean satellites formed around the solar system’s largest world. Konstantin Batygin did not set out to solve one of the solar system’s most puzzling mysteries when he went for a run up a hill in Nice, France. Dr. Batygin, a Caltech researcher, best known for his contributions to the search for the solar system’s missing “Planet Nine,” spotted a beer bottle. At a steep, 20 degree grade, he wondered why it wasn’t rolling down the hill. He realized there was a breeze at his back holding the bottle in place. Then he had a thought that would only pop into the mind of a theoretical astrophysicist: “Oh! This is how Europa formed.” Europa is one of Jupiter’s four large Galilean moons. And in a paper published Monday in the Astrophysical Journal, Dr. Batygin and a co-author, Alessandro Morbidelli, a planetary scientist at the Côte d’Azur Observatory in France, present a theory explaining how some moons form around gas giants like Jupiter and Saturn, suggesting that millimeter-sized grains of hail produced during the solar system’s formation became trapped around these massive worlds, taking shape one at a time into the potentially habitable moons we know today.", + candidate_labels: "space & cosmos, scientific discovery, microbiology, robots, archeology", + multi_class: true, + }, + ], + ], + ["translation", [`My name is Wolfgang and I live in Berlin`, `My name is Sarah and I live in London`]], + [ + "summarization", + [ + `The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.`, + ], + ], + [ + "conversational", + [ + `Hi, what can you help me with?`, + `What is 84 * 3 / 2?`, + `Tell me an interesting fact about the universe!`, + `Explain quantum computing in simple terms.`, + ], + ], + [ + "text-generation", + [ + `My name is Julien and I like to`, + `I like traveling by train because`, + `Paris is an amazing place to visit,`, + `Once upon a time,`, + ], + ], + ["fill-mask", [`Paris is the of France.`, `The goal of life is .`]], + [ + "sentence-similarity", + [ + { + source_sentence: "That is a happy person", + sentences: ["That is a happy dog", "That is a very happy person", "Today is a sunny day"], + }, + ], + ], +]); +const MAPPING_ZH = new Map([ + ["text-classification", [`我喜欢你。 我爱你`]], + ["token-classification", [`我叫沃尔夫冈,我住在柏林。`, `我叫萨拉,我住在伦敦。`, `我叫克拉拉,我住在加州伯克利。`]], + [ + "question-answering", + [ + { + text: `我住在哪里?`, + context: `我叫沃尔夫冈,我住在柏林。`, + }, + { + text: `我住在哪里?`, + context: `我叫萨拉,我住在伦敦。`, + }, + { + text: `我的名字是什么?`, + context: `我叫克拉拉,我住在伯克利。`, + }, + ], + ], + ["translation", [`我叫沃尔夫冈,我住在柏林。`, `我叫萨拉,我住在伦敦。`]], + [ + "zero-shot-classification", + [ + { + text: "房间干净明亮,非常不错", + candidate_labels: "这是一条差评, 这是一条好评", + }, + ], + ], + [ + "summarization", + [ + `该塔高324米(1063英尺),与一幢81层的建筑物一样高,是巴黎最高的建筑物。 它的底座是方形的,每边长125米(410英尺)。 在建造过程中,艾菲尔铁塔超过了华盛顿纪念碑,成为世界上最高的人造结构,它保持了41年的头衔,直到1930年纽约市的克莱斯勒大楼竣工。这是第一个到达300米高度的结构。 由于1957年在塔顶增加了广播天线,因此它现在比克莱斯勒大厦高5.2米(17英尺)。 除发射器外,艾菲尔铁塔是法国第二高的独立式建筑,仅次于米劳高架桥。`, + ], + ], + [ + "text-generation", + [`我叫朱利安,我喜欢`, `我叫托马斯,我的主要`, `我叫玛丽亚,我最喜欢的`, `我叫克拉拉,我是`, `从前,`], + ], + ["fill-mask", [`巴黎是国的首都。`, `生活的真谛是。`]], + [ + "sentence-similarity", + [ + { + source_sentence: "那是 個快樂的人", + sentences: ["那是 條快樂的狗", "那是 個非常幸福的人", "今天是晴天"], + }, + ], + ], +]); +const MAPPING_FR = new Map([ + ["text-classification", [`Je t'apprécie beaucoup. Je t'aime.`]], + ["token-classification", [`Mon nom est Wolfgang et je vis à Berlin`]], + [ + "question-answering", + [ + { + text: `Où est-ce que je vis?`, + context: `Mon nom est Wolfgang et je vis à Berlin`, + }, + ], + ], + ["translation", [`Mon nom est Wolfgang et je vis à Berlin`]], + [ + "summarization", + [ + `La tour fait 324 mètres (1,063 pieds) de haut, environ la même hauteur qu'un immeuble de 81 étages, et est la plus haute structure de Paris. Sa base est carrée, mesurant 125 mètres (410 pieds) sur chaque côté. Durant sa construction, la tour Eiffel surpassa le Washington Monument pour devenir la plus haute structure construite par l'homme dans le monde, un titre qu'elle conserva pendant 41 ans jusqu'à l'achèvement du Chrysler Building à New-York City en 1930. Ce fut la première structure à atteindre une hauteur de 300 mètres. Avec l'ajout d'une antenne de radiodiffusion au sommet de la tour Eiffel en 1957, celle-ci redevint plus haute que le Chrysler Building de 5,2 mètres (17 pieds). En excluant les transmetteurs, elle est la seconde plus haute structure autoportante de France après le viaduc de Millau.`, + ], + ], + ["text-generation", [`Mon nom est Julien et j'aime`, `Mon nom est Thomas et mon principal`, `Il était une fois`]], + ["fill-mask", [`Paris est la de la France.`]], + [ + "sentence-similarity", + [ + { + source_sentence: "C'est une personne heureuse", + sentences: [ + "C'est un chien heureux", + "C'est une personne très heureuse", + "Aujourd'hui est une journée ensoleillée", + ], + }, + ], + ], +]); +const MAPPING_ES = new Map([ + ["text-classification", [`Te quiero. Te amo.`]], + ["token-classification", [`Me llamo Wolfgang y vivo en Berlin`]], + [ + "question-answering", + [ + { + text: `¿Dónde vivo?`, + context: `Me llamo Wolfgang y vivo en Berlin`, + }, + { + text: `¿Quién inventó el submarino?`, + context: `Isaac Peral fue un murciano que inventó el submarino`, + }, + { + text: `¿Cuántas personas hablan español?`, + context: `El español es el segundo idioma más hablado del mundo con más de 442 millones de hablantes`, + }, + ], + ], + [ + "translation", + [ + `Me llamo Wolfgang y vivo en Berlin`, + `Los ingredientes de una tortilla de patatas son: huevos, patatas y cebolla`, + ], + ], + [ + "summarization", + [ + `La torre tiene 324 metros (1.063 pies) de altura, aproximadamente la misma altura que un edificio de 81 pisos y la estructura más alta de París. Su base es cuadrada, mide 125 metros (410 pies) a cada lado. Durante su construcción, la Torre Eiffel superó al Washington Monument para convertirse en la estructura artificial más alta del mundo, un título que mantuvo durante 41 años hasta que el Chrysler Building en la ciudad de Nueva York se terminó en 1930. Fue la primera estructura en llegar Una altura de 300 metros. Debido a la adición de una antena de transmisión en la parte superior de la torre en 1957, ahora es más alta que el Chrysler Building en 5,2 metros (17 pies). Excluyendo los transmisores, la Torre Eiffel es la segunda estructura independiente más alta de Francia después del Viaducto de Millau.`, + ], + ], + [ + "text-generation", + [ + `Me llamo Julien y me gusta`, + `Me llamo Thomas y mi principal`, + `Me llamo Manuel y trabajo en`, + `Érase una vez,`, + `Si tú me dices ven, `, + ], + ], + ["fill-mask", [`Mi nombre es y vivo en Nueva York.`, `El español es un idioma muy en el mundo.`]], + [ + "sentence-similarity", + [ + { + source_sentence: "Esa es una persona feliz", + sentences: ["Ese es un perro feliz", "Esa es una persona muy feliz", "Hoy es un día soleado"], + }, + ], + ], +]); +const MAPPING_RU = new Map([ + ["text-classification", [`Ты мне нравишься. Я тебя люблю`]], + ["token-classification", [`Меня зовут Вольфганг и я живу в Берлине`]], + [ + "question-answering", + [ + { + text: `Где живу?`, + context: `Меня зовут Вольфганг и я живу в Берлине`, + }, + ], + ], + ["translation", [`Меня зовут Вольфганг и я живу в Берлине`]], + [ + "summarization", + [ + `Высота башни составляет 324 метра (1063 фута), примерно такая же высота, как у 81-этажного здания, и самое высокое сооружение в Париже. Его основание квадратно, размером 125 метров (410 футов) с любой стороны. Во время строительства Эйфелева башня превзошла монумент Вашингтона, став самым высоким искусственным сооружением в мире, и этот титул она удерживала в течение 41 года до завершения строительство здания Крайслер в Нью-Йорке в 1930 году. Это первое сооружение которое достигло высоты 300 метров. Из-за добавления вещательной антенны на вершине башни в 1957 году она сейчас выше здания Крайслер на 5,2 метра (17 футов). За исключением передатчиков, Эйфелева башня является второй самой высокой отдельно стоящей структурой во Франции после виадука Мийо.`, + ], + ], + ["text-generation", [`Меня зовут Жюльен и`, `Меня зовут Томас и мой основной`, `Однажды`]], + ["fill-mask", [`Меня зовут и я инженер живущий в Нью-Йорке.`]], + [ + "sentence-similarity", + [ + { + source_sentence: "Это счастливый человек", + sentences: ["Это счастливая собака", "Это очень счастливый человек", "Сегодня солнечный день"], + }, + ], + ], +]); +const MAPPING_UK = new Map([ + ["translation", [`Мене звати Вольфґанґ і я живу в Берліні.`]], + ["fill-mask", [`Мене звати .`]], +]); +const MAPPING_IT = new Map([ + ["text-classification", [`Mi piaci. Ti amo`]], + [ + "token-classification", + [ + `Mi chiamo Wolfgang e vivo a Berlino`, + `Mi chiamo Sarah e vivo a Londra`, + `Mi chiamo Clara e vivo a Berkeley in California.`, + ], + ], + [ + "question-answering", + [ + { + text: `Dove vivo?`, + context: `Mi chiamo Wolfgang e vivo a Berlino`, + }, + { + text: `Dove vivo?`, + context: `Mi chiamo Sarah e vivo a Londra`, + }, + { + text: `Come mio chiamo?`, + context: `Mi chiamo Clara e vivo a Berkeley.`, + }, + ], + ], + ["translation", [`Mi chiamo Wolfgang e vivo a Berlino`, `Mi chiamo Sarah e vivo a Londra`]], + [ + "summarization", + [ + `La torre degli Asinelli è una delle cosiddette due torri di Bologna, simbolo della città, situate in piazza di porta Ravegnana, all'incrocio tra le antiche strade San Donato (ora via Zamboni), San Vitale, Maggiore e Castiglione. Eretta, secondo la tradizione, fra il 1109 e il 1119 dal nobile Gherardo Asinelli, la torre è alta 97,20 metri, pende verso ovest per 2,23 metri e presenta all'interno una scalinata composta da 498 gradini. Ancora non si può dire con certezza quando e da chi fu costruita la torre degli Asinelli. Si presume che la torre debba il proprio nome a Gherardo Asinelli, il nobile cavaliere di fazione ghibellina al quale se ne attribuisce la costruzione, iniziata secondo una consolidata tradizione l'11 ottobre 1109 e terminata dieci anni dopo, nel 1119.`, + ], + ], + [ + "text-generation", + [ + `Mi chiamo Loreto e mi piace`, + `Mi chiamo Thomas e il mio principale`, + `Mi chiamo Marianna, la mia cosa preferita`, + `Mi chiamo Clara e sono`, + `C'era una volta`, + ], + ], + ["fill-mask", [`Roma è la d'Italia.`, `Lo scopo della vita è .`]], + [ + "sentence-similarity", + [ + { + source_sentence: "Questa è una persona felice", + sentences: ["Questo è un cane felice", "Questa è una persona molto felice", "Oggi è una giornata di sole"], + }, + ], + ], +]); +const MAPPING_FA = new Map([ + [ + "text-classification", + [`پروژه به موقع تحویل شد و همه چیز خوب بود.`, `سیب‌زمینی بی‌کیفیت بود.`, `قیمت و کیفیت عالی`, `خوب نبود اصلا`], + ], + [ + "token-classification", + [ + `این سریال به صورت رسمی در تاریخ دهم می ۲۰۱۱ توسط شبکه فاکس برای پخش رزرو شد.`, + `دفتر مرکزی شرکت پارس‌مینو در شهر اراک در استان مرکزی قرار دارد.`, + `وی در سال ۲۰۱۳ درگذشت و مسئول خاکسپاری و اقوامش برای او مراسم یادبود گرفتند.`, + ], + ], + [ + "question-answering", + [ + { + text: `من کجا زندگی میکنم؟`, + context: `نام من پژمان است و در گرگان زندگی میکنم.`, + }, + { + text: `نامم چیست و کجا زندگی می‌کنم؟`, + context: `اسمم سارا است و در آفریقای جنوبی زندگی میکنم.`, + }, + { + text: `نام من چیست؟`, + context: `من مریم هستم و در تبریز زندگی می‌کنم.`, + }, + { + text: `بیشترین مساحت جنگل آمازون در کدام کشور است؟`, + context: [ + "آمازون نام بزرگ‌ترین جنگل بارانی جهان است که در شمال آمریکای جنوبی قرار گرفته و بیشتر آن در خاک برزیل و پرو", + "جای دارد. بیش از نیمی از همه جنگل‌های بارانی باقی‌مانده در جهان در آمازون قرار دارد.", + "مساحت جنگل‌های آمازون ۵٫۵ میلیون کیلومتر مربع است که بین ۹ کشور تقسیم شده‌است.", + ].join("\n"), + }, + ], + ], + [ + "translation", + [ + "بیشتر مساحت جنگل‌های آمازون در حوضه آبریز رود آمازون و ۱۱۰۰ شاخه آن واقع شده‌است.", + "مردمان نَبَطی از هزاره‌های یکم و دوم پیش از میلاد در این منطقه زندگی می‌کردند.", + ], + ], + [ + "summarization", + [ + [ + "شاهنامه اثر حکیم ابوالقاسم فردوسی توسی، حماسه‌ای منظوم، بر حسب دست نوشته‌های ", + "موجود دربرگیرنده نزدیک به ۵۰٬۰۰۰ بیت تا نزدیک به ۶۱٬۰۰۰ بیت و یکی از ", + "بزرگ‌ترین و برجسته‌ترین سروده‌های حماسی جهان است که سرایش آن دست‌آوردِ ", + "دست‌کم سی سال کارِ پیوستهٔ این سخن‌سرای نامدار ایرانی است. موضوع این شاهکار ادبی،", + " افسانه‌ها و تاریخ ایران از آغاز تا حملهٔ عرب‌ها به ایران در سدهٔ هفتم میلادی است", + " (شاهنامه از سه بخش اسطوره، پهلوانی و تاریخی تشکیل شده‌است) که در چهار", + " دودمان پادشاهیِ پیشدادیان، کیانیان، اشکانیان و ساسانیان گنجانده می‌شود.", + " شاهنامه بر وزن «فَعولُن فعولن فعولن فَعَلْ»، در بحرِ مُتَقارِبِ مثمَّنِ محذوف نگاشته شده‌است.", + "هنگامی که زبان دانش و ادبیات در ایران زبان عربی بود، فردوسی، با سرودن شاهنامه", + " با ویژگی‌های هدف‌مندی که داشت، زبان پارسی را زنده و پایدار کرد. یکی از ", + " بن‌مایه‌های مهمی که فردوسی برای سرودن شاهنامه از آن استفاده کرد،", + " شاهنامهٔ ابومنصوری بود. شاهنامه نفوذ بسیاری در جهت‌گیری ", + " فرهنگ فارسی و نیز بازتاب‌های شکوه‌مندی در ادبیات جهان داشته‌است و شاعران ", + " بزرگی مانند گوته و ویکتور هوگو از آن به نیکی یاد کرده‌اند.", + ].join("\n"), + ], + ], + ["text-generation", ["اسم من نازنین است و من", "روزی روزگاری"]], + [ + "fill-mask", + [ + `زندگی یک سوال است و این که چگونه کنیم پاسخ این سوال!`, + `زندگی از مرگ پرسید: چرا همه من را دارند اما از تو متنفرند؟`, + ], + ], +]); +const MAPPING_AR = new Map([ + ["text-classification", [`أحبك. أهواك`]], + [ + "token-classification", + [`إسمي محمد وأسكن في برلين`, `إسمي ساره وأسكن في لندن`, `إسمي سامي وأسكن في القدس في فلسطين.`], + ], + [ + "question-answering", + [ + { + text: `أين أسكن؟`, + context: `إسمي محمد وأسكن في بيروت`, + }, + { + text: `أين أسكن؟`, + context: `إسمي ساره وأسكن في لندن`, + }, + { + text: `ما اسمي؟`, + context: `اسمي سعيد وأسكن في حيفا.`, + }, + { + text: `ما لقب خالد بن الوليد بالعربية؟`, + context: `خالد بن الوليد من أبطال وقادة الفتح الإسلامي وقد تحدثت عنه اللغات الإنجليزية والفرنسية والإسبانية ولقب بسيف الله المسلول.`, + }, + ], + ], + ["translation", [`إسمي محمد وأسكن في برلين`, `إسمي ساره وأسكن في لندن`]], + [ + "summarization", + [ + `تقع الأهرامات في الجيزة قرب القاهرة في مصر وقد بنيت منذ عدة قرون، وقيل إنها كانت قبورا للفراعنة وتم بناؤها بعملية هندسية رائعة واستقدمت حجارتها من جبل المقطم وتم نقلها بالسفن أو على الرمل، وما تزال شامخة ويقصدها السياح من كافة أرجاء المعمورة.`, + ], + ], + [ + "text-generation", + [ + `إسمي محمد وأحب أن`, + `دع المكارم لا ترحل لبغيتها - واقعد فإنك أنت الطاعم الكاسي.`, + `لماذا نحن هنا؟`, + `القدس مدينة تاريخية، بناها الكنعانيون في`, + `كان يا ما كان في قديم الزمان`, + ], + ], + ["fill-mask", [`باريس فرنسا.`, `فلسفة الحياة هي .`]], + [ + "sentence-similarity", + [ + { + source_sentence: "هذا شخص سعيد", + sentences: ["هذا كلب سعيد", "هذا شخص سعيد جدا", "اليوم هو يوم مشمس"], + }, + ], + ], +]); +const MAPPING_BN = new Map([ + ["text-classification", [`বাঙালির ঘরে ঘরে আজ নবান্ন উৎসব।`]], + [ + "token-classification", + [`আমার নাম জাহিদ এবং আমি ঢাকায় বাস করি।`, `তিনি গুগলে চাকরী করেন।`, `আমার নাম সুস্মিতা এবং আমি কলকাতায় বাস করি।`], + ], + ["translation", [`আমার নাম জাহিদ, আমি রংপুরে বাস করি।`, `আপনি কী আজকে বাসায় আসবেন?`]], + [ + "summarization", + [ + `‘ইকোনমিস্ট’ লিখেছে, অ্যান্টিবডির চার মাস স্থায়ী হওয়ার খবরটি দুই কারণে আনন্দের। অ্যান্টিবডি যত দিন পর্যন্ত শরীরে টিকবে, তত দিন সংক্রমণ থেকে সুরক্ষিত থাকা সম্ভব। অর্থাৎ, এমন এক টিকার প্রয়োজন হবে, যা অ্যান্টিবডির উত্পাদনকে প্ররোচিত করতে পারে এবং দীর্ঘস্থায়ী সুরক্ষা দিতে পারে। এগুলো খুঁজে বের করাও সহজ। এটি আভাস দেয়, ব্যাপক হারে অ্যান্টিবডি শনাক্তকরণ ফলাফল মোটামুটি নির্ভুল হওয়া উচিত। দ্বিতীয় আরেকটি গবেষণার নেতৃত্ব দিয়েছেন যুক্তরাজ্যের মেডিকেল রিসার্চ কাউন্সিলের (এমআরসি) ইমিউনোলজিস্ট তাও দং। তিনি টি-সেল শনাক্তকরণে কাজ করেছেন। টি-সেল শনাক্তকরণের প্রক্রিয়া অবশ্য অ্যান্টিবডির মতো এত আলোচিত নয়। তবে সংক্রমণের বিরুদ্ধে লড়াই এবং দীর্ঘমেয়াদি সুরক্ষায় সমান গুরুত্বপূর্ণ ভূমিকা পালন করে। গবেষণাসংক্রান্ত নিবন্ধ প্রকাশিত হয়েছে ‘নেচার ইমিউনোলজি’ সাময়িকীতে। তাঁরা বলছেন, গবেষণার ক্ষেত্রে কোভিড-১৯ মৃদু সংক্রমণের শিকার ২৮ ব্যক্তির রক্তের নমুনা, ১৪ জন গুরুতর অসুস্থ ও ১৬ জন সুস্থ ব্যক্তির রক্তের নমুনা পরীক্ষা করেছেন। গবেষণা নিবন্ধে বলা হয়, সংক্রমিত ব্যক্তিদের ক্ষেত্রে টি-সেলের তীব্র প্রতিক্রিয়া তাঁরা দেখেছেন। এ ক্ষেত্রে মৃদু ও গুরুতর অসুস্থ ব্যক্তিদের ক্ষেত্রে প্রতিক্রিয়ার ভিন্নতা পাওয়া গেছে।`, + ], + ], + ["text-generation", [`আমি রতন এবং আমি`, `তুমি যদি চাও তবে`, `মিথিলা আজকে বড্ড`]], + ["fill-mask", [`আমি বাংলায় গাই।`, `আমি খুব ভালোবাসি। `]], + [ + "question-answering", + [ + { + text: `প্রথম এশিয়া কাপ ক্রিকেট টুর্নামেন্ট কোথায় অনুষ্ঠিত হয় ?`, + context: `প্রথম টুর্নামেন্ট অনুষ্ঠিত হয় ১৯৮৪ সালে সংযুক্ত আরব আমিরাত এর শারজাহ তে যেখানে কাউন্সিলের মূল অফিস ছিল (১৯৯৫ পর্যন্ত)। ভারত শ্রীলঙ্কার সাথে আন্তরিকতাহীন ক্রিকেট সম্পর্কের কারণে ১৯৮৬ সালের টুর্নামেন্ট বর্জন করে। ১৯৯৩ সালে ভারত ও পাকিস্তান এর মধ্যে রাজনৈতিক অস্থিরতার কারণে এটি বাতিল হয়ে যায়। শ্রীলঙ্কা এশিয়া কাপ শুরু থেকে অংশ গ্রহণ করে আসছে। আন্তর্জাতিক ক্রিকেট কাউন্সিল নিয়ম করে দিয়েছে যে এশিয়া কাপের সকল খেলা অনুষ্ঠিত হবে অফিসিয়াল একদিনের আন্তর্জাতিক ক্রিকেট হিসেবে। এসিসি ঘোষনা অনুযায়ী প্রতি দুই বছর পর পর টুর্নামেন্ট অনুষ্ঠিত হয় ২০০৮ সাল থেকে।`, + }, + { + text: `ভারতীয় বাঙালি কথাসাহিত্যিক মহাশ্বেতা দেবীর মৃত্যু কবে হয় ?`, + context: `২০১৬ সালের ২৩ জুলাই হৃদরোগে আক্রান্ত হয়ে মহাশ্বেতা দেবী কলকাতার বেল ভিউ ক্লিনিকে ভর্তি হন। সেই বছরই ২৮ জুলাই একাধিক অঙ্গ বিকল হয়ে তাঁর মৃত্যু ঘটে। তিনি মধুমেহ, সেপ্টিসেমিয়া ও মূত্র সংক্রমণ রোগেও ভুগছিলেন।`, + }, + { + text: `মাস্টারদা সূর্যকুমার সেনের বাবার নাম কী ছিল ?`, + context: `সূর্য সেন ১৮৯৪ সালের ২২ মার্চ চট্টগ্রামের রাউজান থানার নোয়াপাড়ায় অর্থনৈতিক ভাবে অস্বচ্ছল পরিবারে জন্মগ্রহণ করেন। তাঁর পিতার নাম রাজমনি সেন এবং মাতার নাম শশী বালা সেন। রাজমনি সেনের দুই ছেলে আর চার মেয়ে। সূর্য সেন তাঁদের পরিবারের চতুর্থ সন্তান। দুই ছেলের নাম সূর্য ও কমল। চার মেয়ের নাম বরদাসুন্দরী, সাবিত্রী, ভানুমতী ও প্রমিলা। শৈশবে পিতা মাতাকে হারানো সূর্য সেন কাকা গৌরমনি সেনের কাছে মানুষ হয়েছেন। সূর্য সেন ছেলেবেলা থেকেই খুব মনোযোগী ভাল ছাত্র ছিলেন এবং ধর্মভাবাপন্ন গম্ভীর প্রকৃতির ছিলেন।`, + }, + ], + ], + [ + "sentence-similarity", + [ + { + source_sentence: "সে একজন সুখী ব্যক্তি", + sentences: ["সে হ্যাপি কুকুর", "সে খুব সুখী মানুষ", "আজ একটি রৌদ্রোজ্জ্বল দিন"], + }, + ], + ], +]); +const MAPPING_MN = new Map([ + ["text-classification", [`Би чамд хайртай`]], + [ + "token-classification", + [ + `Намайг Дорж гэдэг. Би Улаанбаатарт амьдардаг.`, + `Намайг Ганбат гэдэг. Би Увс аймагт төрсөн.`, + `Манай улс таван хошуу малтай.`, + ], + ], + [ + "question-answering", + [ + { + text: `Та хаана амьдардаг вэ?`, + context: `Намайг Дорж гэдэг. Би Улаанбаатарт амьдардаг.`, + }, + { + text: `Таныг хэн гэдэг вэ?`, + context: `Намайг Дорж гэдэг. Би Улаанбаатарт амьдардаг.`, + }, + { + text: `Миний нэрийг хэн гэдэг вэ?`, + context: `Намайг Ганбат гэдэг. Би Увс аймагт төрсөн.`, + }, + ], + ], + ["translation", [`Намайг Дорж гэдэг. Би Улаанбаатарт амьдардаг.`, `Намайг Ганбат гэдэг. Би Увс аймагт төрсөн.`]], + [ + "summarization", + [ + `Монгол Улс (1992 оноос хойш) — дорно болон төв Азид оршдог бүрэн эрхт улс. Хойд талаараа Орос, бусад талаараа Хятад улстай хиллэдэг далайд гарцгүй орон. Нийслэл — Улаанбаатар хот. Алтайн нуруунаас Хянган, Соёноос Говь хүрсэн 1 сая 566 мянган км2 уудам нутагтай, дэлхийд нутаг дэвсгэрийн хэмжээгээр 19-рт жагсдаг. 2015 оны эхэнд Монгол Улсын хүн ам 3 сая хүрсэн (135-р олон). Үндсэндээ монгол үндэстэн (95 хувь), мөн хасаг, тува хүн байна. 16-р зуунаас хойш буддын шашин, 20-р зуунаас шашингүй байдал дэлгэрсэн ба албан хэрэгт монгол хэлээр харилцана.`, + ], + ], + [ + "text-generation", + [`Намайг Дорж гэдэг. Би`, `Хамгийн сайн дуучин бол`, `Миний дуртай хамтлаг бол`, `Эрт урьдын цагт`], + ], + ["fill-mask", [`Монгол улсын Улаанбаатар хотоос ярьж байна.`, `Миний амьдралын зорилго бол .`]], + [ + "automatic-speech-recognition", + [ + { + label: `Common Voice Train Example`, + src: `https://cdn-media.huggingface.co/common_voice/train/common_voice_mn_18577472.wav`, + }, + { + label: `Common Voice Test Example`, + src: `https://cdn-media.huggingface.co/common_voice/test/common_voice_mn_18577346.wav`, + }, + ], + ], + [ + "text-to-speech", + [ + `Би Монгол улсын иргэн.`, + `Энэхүү жишээ нь цаанаа ямар ч утга агуулаагүй болно`, + `Сар шинэдээ сайхан шинэлэж байна уу?`, + ], + ], + [ + "sentence-similarity", + [ + { + source_sentence: "Энэ бол аз жаргалтай хүн юм", + sentences: ["Энэ бол аз жаргалтай нохой юм", "Энэ бол маш их аз жаргалтай хүн юм", "Өнөөдөр нарлаг өдөр байна"], + }, + ], + ], +]); +const MAPPING_SI = new Map([ + ["translation", [`සිංහල ඉතා අලංකාර භාෂාවකි.`, `මෙම තාක්ෂණය භාවිතා කරන ඔබට ස්තූතියි.`]], + ["fill-mask", [`මම ගෙදර .`, ` ඉගෙනීමට ගියාය.`]], +]); +const MAPPING_DE = new Map([ + [ + "question-answering", + [ + { + text: `Wo wohne ich?`, + context: `Mein Name ist Wolfgang und ich lebe in Berlin`, + }, + { + text: `Welcher Name wird auch verwendet, um den Amazonas-Regenwald auf Englisch zu beschreiben?`, + context: `Der Amazonas-Regenwald, auf Englisch auch als Amazonien oder Amazonas-Dschungel bekannt, ist ein feuchter Laubwald, der den größten Teil des Amazonas-Beckens Südamerikas bedeckt. Dieses Becken umfasst 7.000.000 Quadratkilometer (2.700.000 Quadratmeilen), von denen 5.500.000 Quadratkilometer (2.100.000 Quadratmeilen) vom Regenwald bedeckt sind. Diese Region umfasst Gebiete von neun Nationen. Der größte Teil des Waldes befindet sich in Brasilien mit 60% des Regenwaldes, gefolgt von Peru mit 13%, Kolumbien mit 10% und geringen Mengen in Venezuela, Ecuador, Bolivien, Guyana, Suriname und Französisch-Guayana. Staaten oder Abteilungen in vier Nationen enthalten "Amazonas" in ihren Namen. Der Amazonas repräsentiert mehr als die Hälfte der verbleibenden Regenwälder des Planeten und umfasst den größten und artenreichsten tropischen Regenwald der Welt mit geschätzten 390 Milliarden Einzelbäumen, die in 16.000 Arten unterteilt sind.`, + }, + ], + ], + [ + "sentence-similarity", + [ + { + source_sentence: "Das ist eine glückliche Person", + sentences: [ + "Das ist ein glücklicher Hund", + "Das ist eine sehr glückliche Person", + "Heute ist ein sonniger Tag", + ], + }, + ], + ], +]); +const MAPPING_DV = new Map([ + ["text-classification", [`އަހަރެން ގަޔާވޭ. އަހަރެން ލޯބިވޭ`]], + [ + "token-classification", + [`އަހަރެންގެ ނަމަކީ އަހުމަދު އަދި އަހަރެން ދިރިއުޅެނީ މާލޭގަ`, `އަހަރެންގެ ނަމަކީ ސާރާ އަދި އަހަރެން ދިރިއުޅެނީ އުތީމުގަ`, `އަހަރެންގެ ނަމަކީ އައިޝާ އަދި އަހަރެން ދިރިއުޅެނީ ފޭދޫ، އައްޑޫގަ`], + ], + [ + "question-answering", + [ + { + text: `އަހަރެން ދިރިއުޅެނީ ކޮންތާކު؟`, + context: `އަހަރެންގެ ނަމަކީ އަހުމަދު އަދި އަހަރެން ދިރިއުޅެނީ މާލޭގަ`, + }, + { + text: `އަހަރެން ދިރިއުޅެނީ ކޮންތާކު؟`, + context: `އަހަރެންގެ ނަމަކީ ސާރާ އަދި އަހަރެން ދިރިއުޅެނީ އުތީމުގަ`, + }, + { + text: `އަހަރެންގެ ނަމަކީ ކޮބާ؟`, + context: `އަހަރެންގެ ނަމަކީ އައިޝާ އަދި އަހަރެން ދިރިއުޅެނީ ފޭދޫގަ`, + }, + { + text: `އެމޭޒަން ރެއިންފޮރެސްޓް ސިފަކޮށްދިނުމަށް އިނގިރޭސި ބަހުން ބޭނުންކުރާނީ ކޮންނަމެއް؟`, + context: `އެމޭޒަން ރެއިންފޮރެސްޓް (ޕޯޗުޖީޒް: ފްލޮރެސްޓާ އެމަސޮނިކާ ނުވަތަ އެމަސޮނިއާ؛ ސްޕެނިޝް: ސެލްވާ އެމަސޮނިކާ, އެމަސޮނިއާ ނޫނީ އާންމުކޮށް އެމަޒޯނިއާ؛ ފްރެންޗް: ފޮރޭ އެމެޒޮނިއެން؛ ޑަޗް: އެމެޒޯންރޭގެވައުޑް)، އިގިރޭސި ބަހުން ބުނާ އެމެޒޯނިއާ ނުވަތަ ދަ އެމޭޒަން ޖަންގަލް އަކީ, ސައުތު އެމެރިކާގެ އެމޭޒަން ބޭސިން ސަރަހައްދުގެ ބޮޑުބައެއްގައި ހިމެނޭ މޮއިސްޓް ބޮރޯޑްލީފް ފޮރެސްޓެއެކެވެ. އެމޭޒަން ބޭސިން ސަރަހައްދުގެ ބޮޑު މިނަކީ 7 މިލިއަން އަކަ ކިލޯމީޓަރ (2.7 މިލިއަން އަކަ މައިލް(. މީގެ ތެރެއިން 5.5 މިލިއަން އަކަ ކިލޯމީޓަރ (2.1 މިލިއަން އަކަ މައިލް) އަކީ މި ފޮރެސްޓެވެ. މި ސަރަހައްދުގައި 9 ގައުމަކަށް ނިސްބަތްވާ ޓެރިޓަރީ ހިމެނެއެވެ. 60% އާއިއެކެ އެންމެ ބޮޑު ބައެއް ނިސްބަތްވަނީ ބްރެޒިލްއަށެވެ. އޭގެ ފަހުތުން 13% އާއެކު ޕެރޫ އާއި 10% އާއެކު ކޮލަމްބިއާ އަދި ކުޑަ ބައެއް ހިމެނޭ ގޮތުން ވެނެޒުއެލާ, އެކްއަޑޯ, ބޮލިވިއާ, ގުޔާނާ, ސުރިނާމް އަދި ފްރެންޗް ގްއާނާ އަށް ވެސް ނިސްބަތްވެއެވެ. މީގެ ތެރެއިން 4 ގައުމެއްގައި "އެމެޒޮނާސް" ހިމަނައިގެން ސްޓޭޓް ނުވަތަ ޑިޕާޓްމަންޓް އަކަށް ނަންދީފައިވެއެވެ. މުޅި ދުނިޔޭގައި ބާކީ ހުރި ރެއިންފޮރެސްޓްގެ ތެރެއިން ދެބައިކުޅަ އެއްބަޔަށްވުރެބޮޑުވަރެއް އެމޭޒޮން ރެއިންފޮރެސްޓް ހިއްސާކުރެއެވެ. މިއީ މުޅި ދުނިޔެއިން އެންމޮ ބޮޑު އަދި އެންމެ ބައޮޑައިވަރސް ރެއިންފޮރެސްޓް ޓްރެކްޓެވެ. ލަފާކުރެވޭ ގޮތުން 16 ހާސް ސްޕީޝީސްއަށް ބެހިގެންވާ 390 މިލިއަން ވައްތަރުގެ ގަސް މިތާގައި ހިމެނެއެވެ`, + }, + ], + ], + ["translation", [`އަހަރެންގެ ނަމަކީ އަހުމަދު އަދި އަހަރެން ދިރިއުޅެނީ މާލޭގަ`, `އަހަރެންގެ ނަމަކީ ސާރާ އަދި އަހަރެން ދިރިއުޅެނީ އުތީމުގަ`]], + [ + "summarization", + [ + `ޓަވަރުގެ އުސްމިނަކީ 324 މީޓަރު، އެއީ ގާތްގަނޑަކަށް 81 ބުރީގެ އިމާރާތަކާއި އެއްވަރެވެ. އެއީ ޕެރިސްގައި ހުރި އެންމެ އުސް އިމާރާތެވެ. އޭގެ ހަތަރެސްކަނަށް ހުރި ބުޑުގެ ދިގުމިނަކީ ކޮންމެ ފަރާތަކުން 125 މީޓަރެވެ. (410 ފޫޓު) އައިފިލް ޓަވަރު ބިނާކުރި އިރު، ވޮޝިންގްޓަން މޮނިއުމެންޓްގެ އުސްމިން ފަހަނައަޅާ ގޮސް، ދުނިޔޭގައި މީހުން އުފެއްދި ތަންތަނުގެ ތެރެއިން އެންމެ އުސް ތަނުގެ ލަގަބު ލިބުނެވެ. އަދި 1930 ގައި ނިއު ޔޯކްގެ ކްރައިސްލަރ ބިލްޑިންގް ބިނާކުރުމާއި ހަމައަށް 41 އަހަރު ވަންދެން މިލަގަބު ހިފެހެއްޓިއެވެ. މިއީ 300 މީޓަރަށް ވުރެ އުސްކޮށް އިމާރާތްކުރެވުނު ފުރަތަމަ ތަނެވެ. 1957 ގައި ޓަވަރުގެ އެންމެ މަތީގައި ހަރުކުރެވުނު ބްރޯޑްކާސްޓިންގ އޭރިއަލްގެ ސަބަބުން މިހާރު މި ޓަވަރު ކްރައިސްލަރ ބިލްޑިންގއަށް ވުރެ 5.2 މީޓަރ (17 ފޫޓު) އުހެވެ. މި ޓްރާންސްމިޓަރު ނުލާ، އައިފިލް ޓަވަރަކީ، މިލާއު ވިއާޑަކްޓަށް ފަހު ފްރާންސްގައި ހުރި 2 ވަނައަށް އެންމެ އުސް ފްރީސްޓޭންޑިންގ އިމާރާތެވެ`, + ], + ], + [ + "text-generation", + [`އަހަރެންގެ ނަމަކީ ޔޫސުފް އަދި އަހަރެންގެ މައިގަނޑު`, `އަހަރެންގެ ނަމަކީ މަރިއަމް، އަހަރެން އެންމެ ގަޔާވާ`, `އަހަރެންގެ ނަމަކީ ފާތުމަތު އަދި އަހަރެން`, `،އެއް ޒަމާނެއްގައި`], + ], + ["fill-mask", [`. މާލެ އަކީ ދިވެހިރާއްޖޭގެ`, `ގަރުދިޔައަކީ ދިވެހިންގެ މެދުގައި ކެއުމެއް.`]], +]); +exports.MAPPING_DEFAULT_WIDGET = new Map([ + ["en", MAPPING_EN], + ["zh", MAPPING_ZH], + ["fr", MAPPING_FR], + ["es", MAPPING_ES], + ["ru", MAPPING_RU], + ["uk", MAPPING_UK], + ["it", MAPPING_IT], + ["fa", MAPPING_FA], + ["ar", MAPPING_AR], + ["bn", MAPPING_BN], + ["mn", MAPPING_MN], + ["si", MAPPING_SI], + ["de", MAPPING_DE], + ["dv", MAPPING_DV], +]); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/gguf.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/gguf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..90e342694ceda830a8652107c75bb5783899d89f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/gguf.d.ts @@ -0,0 +1,87 @@ +export declare enum GGMLFileQuantizationType { + F32 = 0, + F16 = 1, + Q4_0 = 2, + Q4_1 = 3, + Q4_1_SOME_F16 = 4, + Q4_2 = 5, + Q4_3 = 6, + Q8_0 = 7, + Q5_0 = 8, + Q5_1 = 9, + Q2_K = 10, + Q3_K_S = 11, + Q3_K_M = 12, + Q3_K_L = 13, + Q4_K_S = 14, + Q4_K_M = 15, + Q5_K_S = 16, + Q5_K_M = 17, + Q6_K = 18, + IQ2_XXS = 19, + IQ2_XS = 20, + Q2_K_S = 21, + IQ3_XS = 22, + IQ3_XXS = 23, + IQ1_S = 24, + IQ4_NL = 25, + IQ3_S = 26, + IQ3_M = 27, + IQ2_S = 28, + IQ2_M = 29, + IQ4_XS = 30, + IQ1_M = 31, + BF16 = 32, + Q4_0_4_4 = 33, + Q4_0_4_8 = 34, + Q4_0_8_8 = 35, + TQ1_0 = 36, + TQ2_0 = 37, + MXFP4_MOE = 38, + Q2_K_XL = 1000, + Q3_K_XL = 1001, + Q4_K_XL = 1002, + Q5_K_XL = 1003, + Q6_K_XL = 1004, + Q8_K_XL = 1005 +} +export declare const GGUF_QUANT_RE: RegExp; +export declare const GGUF_QUANT_RE_GLOBAL: RegExp; +export declare function parseGGUFQuantLabel(fname: string): string | undefined; +export declare const GGUF_QUANT_ORDER: GGMLFileQuantizationType[]; +export declare function findNearestQuantType(quant: GGMLFileQuantizationType, availableQuants: GGMLFileQuantizationType[]): GGMLFileQuantizationType | undefined; +export declare enum GGMLQuantizationType { + F32 = 0, + F16 = 1, + Q4_0 = 2, + Q4_1 = 3, + Q5_0 = 6, + Q5_1 = 7, + Q8_0 = 8, + Q8_1 = 9, + Q2_K = 10, + Q3_K = 11, + Q4_K = 12, + Q5_K = 13, + Q6_K = 14, + Q8_K = 15, + IQ2_XXS = 16, + IQ2_XS = 17, + IQ3_XXS = 18, + IQ1_S = 19, + IQ4_NL = 20, + IQ3_S = 21, + IQ2_S = 22, + IQ4_XS = 23, + I8 = 24, + I16 = 25, + I32 = 26, + I64 = 27, + F64 = 28, + IQ1_M = 29, + BF16 = 30, + TQ1_0 = 34, + TQ2_0 = 35, + MXFP4 = 39 +} +//# sourceMappingURL=gguf.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/gguf.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/gguf.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1931652bbe61f8cca5ed3cd57b8c7e9303553975 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/gguf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gguf.d.ts","sourceRoot":"","sources":["../../src/gguf.ts"],"names":[],"mappings":"AAGA,oBAAY,wBAAw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IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,EAAE,KAAK;IACP,GAAG,KAAK;IACR,GAAG,KAAK;IACR,GAAG,KAAK;IACR,GAAG,KAAK;IACR,KAAK,KAAK;IACV,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;CACV"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/gguf.js b/node_modules/@huggingface/tasks/dist/commonjs/gguf.js new file mode 100644 index 0000000000000000000000000000000000000000..74679ed2f6a57eb83c1f5a5ad48d894b0c87b68f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/gguf.js @@ -0,0 +1,190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GGMLQuantizationType = exports.GGUF_QUANT_ORDER = exports.GGUF_QUANT_RE_GLOBAL = exports.GGUF_QUANT_RE = exports.GGMLFileQuantizationType = void 0; +exports.parseGGUFQuantLabel = parseGGUFQuantLabel; +exports.findNearestQuantType = findNearestQuantType; +// This list is copied from gguf/types.ts, but will all types available (for backward compatibility) +// NOT to be confused with GGMLQuantizationType, a FileQuantization can contain multiple GGMLQuantizationType +// For example, Q4_K_M model can contains Q4_K and Q6_K tensors +var GGMLFileQuantizationType; +(function (GGMLFileQuantizationType) { + GGMLFileQuantizationType[GGMLFileQuantizationType["F32"] = 0] = "F32"; + GGMLFileQuantizationType[GGMLFileQuantizationType["F16"] = 1] = "F16"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_0"] = 2] = "Q4_0"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_1"] = 3] = "Q4_1"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_1_SOME_F16"] = 4] = "Q4_1_SOME_F16"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_2"] = 5] = "Q4_2"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_3"] = 6] = "Q4_3"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q8_0"] = 7] = "Q8_0"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q5_0"] = 8] = "Q5_0"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q5_1"] = 9] = "Q5_1"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q2_K"] = 10] = "Q2_K"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q3_K_S"] = 11] = "Q3_K_S"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q3_K_M"] = 12] = "Q3_K_M"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q3_K_L"] = 13] = "Q3_K_L"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_K_S"] = 14] = "Q4_K_S"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_K_M"] = 15] = "Q4_K_M"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q5_K_S"] = 16] = "Q5_K_S"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q5_K_M"] = 17] = "Q5_K_M"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q6_K"] = 18] = "Q6_K"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ2_XXS"] = 19] = "IQ2_XXS"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ2_XS"] = 20] = "IQ2_XS"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q2_K_S"] = 21] = "Q2_K_S"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ3_XS"] = 22] = "IQ3_XS"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ3_XXS"] = 23] = "IQ3_XXS"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ1_S"] = 24] = "IQ1_S"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ4_NL"] = 25] = "IQ4_NL"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ3_S"] = 26] = "IQ3_S"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ3_M"] = 27] = "IQ3_M"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ2_S"] = 28] = "IQ2_S"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ2_M"] = 29] = "IQ2_M"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ4_XS"] = 30] = "IQ4_XS"; + GGMLFileQuantizationType[GGMLFileQuantizationType["IQ1_M"] = 31] = "IQ1_M"; + GGMLFileQuantizationType[GGMLFileQuantizationType["BF16"] = 32] = "BF16"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_0_4_4"] = 33] = "Q4_0_4_4"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_0_4_8"] = 34] = "Q4_0_4_8"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_0_8_8"] = 35] = "Q4_0_8_8"; + GGMLFileQuantizationType[GGMLFileQuantizationType["TQ1_0"] = 36] = "TQ1_0"; + GGMLFileQuantizationType[GGMLFileQuantizationType["TQ2_0"] = 37] = "TQ2_0"; + GGMLFileQuantizationType[GGMLFileQuantizationType["MXFP4_MOE"] = 38] = "MXFP4_MOE"; + // custom quants used by unsloth + // they are not officially a scheme enum value in GGUF, but only here for naming + GGMLFileQuantizationType[GGMLFileQuantizationType["Q2_K_XL"] = 1000] = "Q2_K_XL"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q3_K_XL"] = 1001] = "Q3_K_XL"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q4_K_XL"] = 1002] = "Q4_K_XL"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q5_K_XL"] = 1003] = "Q5_K_XL"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q6_K_XL"] = 1004] = "Q6_K_XL"; + GGMLFileQuantizationType[GGMLFileQuantizationType["Q8_K_XL"] = 1005] = "Q8_K_XL"; +})(GGMLFileQuantizationType || (exports.GGMLFileQuantizationType = GGMLFileQuantizationType = {})); +const ggufQuants = Object.values(GGMLFileQuantizationType).filter((v) => typeof v === "string"); +exports.GGUF_QUANT_RE = new RegExp("(?UD-)?" + `(?${ggufQuants.join("|")})` + "(_(?[A-Z]+))?"); +exports.GGUF_QUANT_RE_GLOBAL = new RegExp(exports.GGUF_QUANT_RE, "g"); +function parseGGUFQuantLabel(fname) { + const quantLabel = fname.toUpperCase().match(exports.GGUF_QUANT_RE_GLOBAL)?.at(-1); // if there is multiple quant substrings in a name, we prefer the last one + return quantLabel; +} +// order of quantization, from biggest to smallest +// this list must be in sync with the order in GGMLFileQuantizationType +// the gguf.spec.ts tests are using verify if the order is correct +exports.GGUF_QUANT_ORDER = [ + GGMLFileQuantizationType.F32, + GGMLFileQuantizationType.BF16, + GGMLFileQuantizationType.F16, + GGMLFileQuantizationType.Q8_K_XL, + GGMLFileQuantizationType.Q8_0, + // 6-bit quantizations + GGMLFileQuantizationType.Q6_K_XL, + GGMLFileQuantizationType.Q6_K, + // 5-bit quantizations + GGMLFileQuantizationType.Q5_K_XL, + GGMLFileQuantizationType.Q5_K_M, + GGMLFileQuantizationType.Q5_K_S, + GGMLFileQuantizationType.Q5_0, + GGMLFileQuantizationType.Q5_1, + // 4-bit quantizations + GGMLFileQuantizationType.Q4_K_XL, + GGMLFileQuantizationType.Q4_K_M, + GGMLFileQuantizationType.Q4_K_S, + GGMLFileQuantizationType.IQ4_NL, + GGMLFileQuantizationType.IQ4_XS, + GGMLFileQuantizationType.Q4_0_4_4, + GGMLFileQuantizationType.Q4_0_4_8, + GGMLFileQuantizationType.Q4_0_8_8, + GGMLFileQuantizationType.Q4_1_SOME_F16, + GGMLFileQuantizationType.Q4_0, + GGMLFileQuantizationType.Q4_1, + GGMLFileQuantizationType.Q4_2, + GGMLFileQuantizationType.Q4_3, + GGMLFileQuantizationType.MXFP4_MOE, + // 3-bit quantizations + GGMLFileQuantizationType.Q3_K_XL, + GGMLFileQuantizationType.Q3_K_L, + GGMLFileQuantizationType.Q3_K_M, + GGMLFileQuantizationType.Q3_K_S, + GGMLFileQuantizationType.IQ3_M, + GGMLFileQuantizationType.IQ3_S, + GGMLFileQuantizationType.IQ3_XS, + GGMLFileQuantizationType.IQ3_XXS, + // 2-bit quantizations + GGMLFileQuantizationType.Q2_K_XL, + GGMLFileQuantizationType.Q2_K, + GGMLFileQuantizationType.Q2_K_S, + GGMLFileQuantizationType.IQ2_M, + GGMLFileQuantizationType.IQ2_S, + GGMLFileQuantizationType.IQ2_XS, + GGMLFileQuantizationType.IQ2_XXS, + // 1-bit quantizations + GGMLFileQuantizationType.IQ1_S, + GGMLFileQuantizationType.IQ1_M, + GGMLFileQuantizationType.TQ1_0, + GGMLFileQuantizationType.TQ2_0, +]; +// This function finds the nearest quantization type that is less than or equal to the given quantization type. +// It returns undefined if no such quantization type is found. +function findNearestQuantType(quant, availableQuants) { + // Create a map for quick index lookup from the defined order + const orderMap = new Map(); + exports.GGUF_QUANT_ORDER.forEach((q, index) => { + orderMap.set(q, index); + }); + const targetIndex = orderMap.get(quant) ?? 0; // the 0 case should never happen + // Filter the available quantizations to include only those defined in the order map, + // then sort them according to the GGUF_QUANT_ORDER (from largest/index 0 to smallest/highest index). + const sortedAvailable = availableQuants + .filter((q) => orderMap.has(q)) + .sort((a, b) => (orderMap.get(a) ?? Infinity) - (orderMap.get(b) ?? Infinity)); + // If no valid quantizations are available after filtering + if (sortedAvailable.length === 0) { + return undefined; + } + // Iterate through the sorted available quantizations (largest to smallest). + // Find the first one whose order index is >= the target index. + // This means finding the largest quantization that is smaller than or equal to the target. + for (const availableQuant of sortedAvailable) { + // We know the key exists due to the filter above. + const availableIndex = orderMap.get(availableQuant) ?? 0; + if (availableIndex >= targetIndex) { + return availableQuant; + } + } + // If the loop completes, it means all available quantizations are larger (have a smaller index) + // than the target quantization. In this case, return the "smallest" available quantization, + // which is the last element in the sorted list (highest index among available). + return sortedAvailable[sortedAvailable.length - 1]; +} +// This list is only used to calculate the size of the model, NOT to be confused with the quantization FILE type +var GGMLQuantizationType; +(function (GGMLQuantizationType) { + GGMLQuantizationType[GGMLQuantizationType["F32"] = 0] = "F32"; + GGMLQuantizationType[GGMLQuantizationType["F16"] = 1] = "F16"; + GGMLQuantizationType[GGMLQuantizationType["Q4_0"] = 2] = "Q4_0"; + GGMLQuantizationType[GGMLQuantizationType["Q4_1"] = 3] = "Q4_1"; + GGMLQuantizationType[GGMLQuantizationType["Q5_0"] = 6] = "Q5_0"; + GGMLQuantizationType[GGMLQuantizationType["Q5_1"] = 7] = "Q5_1"; + GGMLQuantizationType[GGMLQuantizationType["Q8_0"] = 8] = "Q8_0"; + GGMLQuantizationType[GGMLQuantizationType["Q8_1"] = 9] = "Q8_1"; + GGMLQuantizationType[GGMLQuantizationType["Q2_K"] = 10] = "Q2_K"; + GGMLQuantizationType[GGMLQuantizationType["Q3_K"] = 11] = "Q3_K"; + GGMLQuantizationType[GGMLQuantizationType["Q4_K"] = 12] = "Q4_K"; + GGMLQuantizationType[GGMLQuantizationType["Q5_K"] = 13] = "Q5_K"; + GGMLQuantizationType[GGMLQuantizationType["Q6_K"] = 14] = "Q6_K"; + GGMLQuantizationType[GGMLQuantizationType["Q8_K"] = 15] = "Q8_K"; + GGMLQuantizationType[GGMLQuantizationType["IQ2_XXS"] = 16] = "IQ2_XXS"; + GGMLQuantizationType[GGMLQuantizationType["IQ2_XS"] = 17] = "IQ2_XS"; + GGMLQuantizationType[GGMLQuantizationType["IQ3_XXS"] = 18] = "IQ3_XXS"; + GGMLQuantizationType[GGMLQuantizationType["IQ1_S"] = 19] = "IQ1_S"; + GGMLQuantizationType[GGMLQuantizationType["IQ4_NL"] = 20] = "IQ4_NL"; + GGMLQuantizationType[GGMLQuantizationType["IQ3_S"] = 21] = "IQ3_S"; + GGMLQuantizationType[GGMLQuantizationType["IQ2_S"] = 22] = "IQ2_S"; + GGMLQuantizationType[GGMLQuantizationType["IQ4_XS"] = 23] = "IQ4_XS"; + GGMLQuantizationType[GGMLQuantizationType["I8"] = 24] = "I8"; + GGMLQuantizationType[GGMLQuantizationType["I16"] = 25] = "I16"; + GGMLQuantizationType[GGMLQuantizationType["I32"] = 26] = "I32"; + GGMLQuantizationType[GGMLQuantizationType["I64"] = 27] = "I64"; + GGMLQuantizationType[GGMLQuantizationType["F64"] = 28] = "F64"; + GGMLQuantizationType[GGMLQuantizationType["IQ1_M"] = 29] = "IQ1_M"; + GGMLQuantizationType[GGMLQuantizationType["BF16"] = 30] = "BF16"; + GGMLQuantizationType[GGMLQuantizationType["TQ1_0"] = 34] = "TQ1_0"; + GGMLQuantizationType[GGMLQuantizationType["TQ2_0"] = 35] = "TQ2_0"; + GGMLQuantizationType[GGMLQuantizationType["MXFP4"] = 39] = "MXFP4"; +})(GGMLQuantizationType || (exports.GGMLQuantizationType = GGMLQuantizationType = {})); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/hardware.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/hardware.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c1419ca46c648d52da1655bdff3f9b8f1fa92aa --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/hardware.d.ts @@ -0,0 +1,807 @@ +/** + * Biden AI Executive Order (since revoked by President Trump): + * https://web.archive.org/web/20250105222429/https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/ + */ +export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL: number; +export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY: number; +export declare const TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER: number; +/** + * EU AI Act + * https://ec.europa.eu/commission/presscorner/detail/en/qanda_21_1683 + */ +export declare const TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL: number; +export interface HardwareSpec { + /** + * Approximate value, in FP16 whenever possible for GPUs and FP32 for CPUs. + * This is only approximate/theoretical and shouldn't be taken too seriously. + * Currently the CPU values are from cpu-monkey.com + * while the GPU values are from techpowerup.com + * + * Note to reviewers: I got fed up with data entry, + * and HuggingChat running Llama3 with Web search was failing a bit, + * so some of those values might be slightly inaccurate. Forgive me and please feel free to improve. + */ + tflops: number; + /** + * If an array is specified, options of memory size (can be VRAM, unified RAM) + * e.g. an A100 exists in 40 or 80 GB. + */ + memory?: number[]; +} +export declare const DEFAULT_MEMORY_OPTIONS: number[]; +export declare const SKUS: { + GPU: { + NVIDIA: { + B200: { + tflops: number; + memory: number[]; + }; + H200: { + tflops: number; + memory: number[]; + }; + H100: { + tflops: number; + memory: number[]; + }; + L40s: { + tflops: number; + memory: number[]; + }; + L40: { + tflops: number; + memory: number[]; + }; + L20: { + tflops: number; + memory: number[]; + }; + L4: { + tflops: number; + memory: number[]; + }; + GB10: { + tflops: number; + memory: number[]; + }; + "RTX PRO 6000 WS": { + tflops: number; + memory: number[]; + }; + "RTX PRO 6000 Max-Q": { + tflops: number; + memory: number[]; + }; + "RTX 6000 Ada": { + tflops: number; + memory: number[]; + }; + "RTX 5880 Ada": { + tflops: number; + memory: number[]; + }; + "RTX 5000 Ada": { + tflops: number; + memory: number[]; + }; + "RTX 4500 Ada": { + tflops: number; + memory: number[]; + }; + "RTX 4000 Ada": { + tflops: number; + memory: number[]; + }; + "RTX 4000 SFF Ada": { + tflops: number; + memory: number[]; + }; + "RTX 2000 Ada": { + tflops: number; + memory: number[]; + }; + "RTX A6000": { + tflops: number; + memory: number[]; + }; + "RTX A5000": { + tflops: number; + memory: number[]; + }; + "RTX A5000 Max-Q": { + tflops: number; + memory: number[]; + }; + "RTX A5000 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX A4000": { + tflops: number; + memory: number[]; + }; + "RTX A4000 Max-Q": { + tflops: number; + memory: number[]; + }; + "RTX A4000 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX A3000 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX A2000": { + tflops: number; + memory: number[]; + }; + "RTX A2000 Embedded": { + tflops: number; + memory: number[]; + }; + "RTX A2000 Max-Q": { + tflops: number; + memory: number[]; + }; + "RTX A2000 Mobile": { + tflops: number; + memory: number[]; + }; + A100: { + tflops: number; + memory: number[]; + }; + A40: { + tflops: number; + memory: number[]; + }; + A30: { + tflops: number; + memory: number[]; + }; + A10: { + tflops: number; + memory: number[]; + }; + A2: { + tflops: number; + memory: number[]; + }; + "RTX 5090": { + tflops: number; + memory: number[]; + }; + "RTX 5090 D": { + tflops: number; + memory: number[]; + }; + "RTX 5080": { + tflops: number; + memory: number[]; + }; + "RTX 5080 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 5070": { + tflops: number; + memory: number[]; + }; + "RTX 5070 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 5070 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 5060 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 5060": { + tflops: number; + memory: number[]; + }; + "RTX 4090": { + tflops: number; + memory: number[]; + }; + "RTX 4090D": { + tflops: number; + memory: number[]; + }; + "RTX 4090 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 4080 SUPER": { + tflops: number; + memory: number[]; + }; + "RTX 4080": { + tflops: number; + memory: number[]; + }; + "RTX 4080 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 4070": { + tflops: number; + memory: number[]; + }; + "RTX 4070 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 4070 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 4070 Super": { + tflops: number; + memory: number[]; + }; + "RTX 4070 Ti Super": { + tflops: number; + memory: number[]; + }; + "RTX 4060": { + tflops: number; + memory: number[]; + }; + "RTX 4060 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 4090 Laptop": { + tflops: number; + memory: number[]; + }; + "RTX 4080 Laptop": { + tflops: number; + memory: number[]; + }; + "RTX 4070 Laptop": { + tflops: number; + memory: number[]; + }; + "RTX 4060 Laptop": { + tflops: number; + memory: number[]; + }; + "RTX 4050 Laptop": { + tflops: number; + memory: number[]; + }; + "RTX 3090": { + tflops: number; + memory: number[]; + }; + "RTX 3090 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 3080": { + tflops: number; + memory: number[]; + }; + "RTX 3080 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 3080 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 3070": { + tflops: number; + memory: number[]; + }; + "RTX 3070 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 3070 Ti Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 3060 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 3060": { + tflops: number; + memory: number[]; + }; + "RTX 2080 Ti": { + tflops: number; + memory: number[]; + }; + "RTX 2080": { + tflops: number; + memory: number[]; + }; + "RTX 2070": { + tflops: number; + memory: number[]; + }; + "RTX 2070 SUPER Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 2070 SUPER": { + tflops: number; + memory: number[]; + }; + "RTX 3060 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 3050 Mobile": { + tflops: number; + memory: number[]; + }; + "RTX 2060": { + tflops: number; + memory: number[]; + }; + "RTX 2060 12GB": { + tflops: number; + memory: number[]; + }; + "RTX 2060 Mobile": { + tflops: number; + memory: number[]; + }; + "GTX 1080 Ti": { + tflops: number; + memory: number[]; + }; + "GTX 1070 Ti": { + tflops: number; + memory: number[]; + }; + "GTX 1060": { + tflops: number; + memory: number[]; + }; + "GTX 1050 Ti": { + tflops: number; + memory: number[]; + }; + "RTX Titan": { + tflops: number; + memory: number[]; + }; + "GTX 1660": { + tflops: number; + memory: number[]; + }; + "GTX 1650 Mobile": { + tflops: number; + memory: number[]; + }; + T4: { + tflops: number; + memory: number[]; + }; + T10: { + tflops: number; + memory: number[]; + }; + V100: { + tflops: number; + memory: number[]; + }; + "Quadro P6000": { + tflops: number; + memory: number[]; + }; + P40: { + tflops: number; + memory: number[]; + }; + P100: { + tflops: number; + memory: number[]; + }; + "Jetson AGX Orin 64GB": { + tflops: number; + memory: number[]; + }; + "Jetson AGX Orin 32GB": { + tflops: number; + memory: number[]; + }; + "Jetson Orin NX 16GB": { + tflops: number; + memory: number[]; + }; + "Jetson Orin NX 8GB": { + tflops: number; + memory: number[]; + }; + "Jetson Orin Nano 8GB": { + tflops: number; + memory: number[]; + }; + "Jetson Orin Nano 4GB": { + tflops: number; + memory: number[]; + }; + "Jetson AGX Xavier": { + tflops: number; + memory: number[]; + }; + "Jetson Xavier NX": { + tflops: number; + memory: number[]; + }; + "Jetson TX2": { + tflops: number; + memory: number[]; + }; + "Jetson Nano": { + tflops: number; + memory: number[]; + }; + }; + AMD: { + MI300: { + tflops: number; + memory: number[]; + }; + MI250: { + tflops: number; + memory: number[]; + }; + MI210: { + tflops: number; + memory: number[]; + }; + MI100: { + tflops: number; + memory: number[]; + }; + MI60: { + tflops: number; + memory: number[]; + }; + MI50: { + tflops: number; + memory: number[]; + }; + "R9700 PRO": { + tflops: number; + memory: number[]; + }; + "RX 9070 XT": { + tflops: number; + memory: number[]; + }; + "RX 9070": { + tflops: number; + memory: number[]; + }; + "RX 7900 XTX": { + tflops: number; + memory: number[]; + }; + "RX 7900 XT": { + tflops: number; + memory: number[]; + }; + "RX 7900 GRE": { + tflops: number; + memory: number[]; + }; + "RX 7800 XT": { + tflops: number; + memory: number[]; + }; + "RX 7700 XT": { + tflops: number; + memory: number[]; + }; + "RX 7600 XT": { + tflops: number; + memory: number[]; + }; + "RX 6950 XT": { + tflops: number; + memory: number[]; + }; + "RX 6800": { + tflops: number; + memory: number[]; + }; + "RX 6700 XT": { + tflops: number; + memory: number[]; + }; + "RX 6700": { + tflops: number; + memory: number[]; + }; + "RX 6650 XT": { + tflops: number; + memory: number[]; + }; + "RX 6600 XT": { + tflops: number; + memory: number[]; + }; + "RX 6600": { + tflops: number; + memory: number[]; + }; + "Radeon Pro VII": { + tflops: number; + memory: number[]; + }; + }; + INTEL: { + "Arc A750": { + tflops: number; + memory: number[]; + }; + "Arc A770": { + tflops: number; + memory: number[]; + }; + "Arc B570": { + tflops: number; + memory: number[]; + }; + "Arc B580": { + tflops: number; + memory: number[]; + }; + "Arc B50": { + tflops: number; + memory: number[]; + }; + "Arc B60": { + tflops: number; + memory: number[]; + }; + }; + QUALCOMM: { + "Snapdragon X Elite X1E-00-1DE": { + tflops: number; + }; + "Snapdragon X Elite X1E-84-100": { + tflops: number; + }; + "Snapdragon X Elite X1E-80-100": { + tflops: number; + }; + "Snapdragon X Elite X1E-78-100": { + tflops: number; + }; + "Snapdragon X Plus X1P-64-100": { + tflops: number; + }; + }; + }; + CPU: { + Intel: { + "Xeon 4th Generation (Sapphire Rapids)": { + tflops: number; + }; + "Xeon 3th Generation (Ice Lake)": { + tflops: number; + }; + "Xeon 2th Generation (Cascade Lake)": { + tflops: number; + }; + "Xeon E5v4 (Broadwell)": { + tflops: number; + }; + "Xeon E5v3 (Haswell)": { + tflops: number; + }; + "Xeon E5v2 (Ivy Bridge)": { + tflops: number; + }; + "Intel Core Ultra 7 265KF": { + tflops: number; + }; + "Intel Core 14th Generation (i7)": { + tflops: number; + }; + "Intel Core 13th Generation (i9)": { + tflops: number; + }; + "Intel Core 13th Generation (i7)": { + tflops: number; + }; + "Intel Core 13th Generation (i5)": { + tflops: number; + }; + "Intel Core 13th Generation (i3)": { + tflops: number; + }; + "Intel Core 12th Generation (i9)": { + tflops: number; + }; + "Intel Core 12th Generation (i7)": { + tflops: number; + }; + "Intel Core 12th Generation (i5)": { + tflops: number; + }; + "Intel Core 12th Generation (i3)": { + tflops: number; + }; + "Intel Core 11th Generation (i9)": { + tflops: number; + }; + "Intel Core 11th Generation (i7)": { + tflops: number; + }; + "Intel Core 11th Generation (i5)": { + tflops: number; + }; + "Intel Core 11th Generation (i3)": { + tflops: number; + }; + "Intel Core 10th Generation (i9)": { + tflops: number; + }; + "Intel Core 10th Generation (i7)": { + tflops: number; + }; + "Intel Core 10th Generation (i5)": { + tflops: number; + }; + "Intel Core 10th Generation (i3)": { + tflops: number; + }; + }; + AMD: { + "EPYC 5th Generation Zen 5 (Turin)": { + tflops: number; + }; + "EPYC 4th Generation Zen 4 (Genoa)": { + tflops: number; + }; + "EPYC 3th Generation Zen 3 (Milan)": { + tflops: number; + }; + "EPYC 2th Generation Zen 2 (Rome)": { + tflops: number; + }; + "EPYC 1st Generation Zen (Naples)": { + tflops: number; + }; + "Ryzen Threadripper Zen 5 9000 (Shimada Peak)": { + tflops: number; + }; + "Ryzen Threadripper Zen 4 7000 (Storm Peak)": { + tflops: number; + }; + "Ryzen Threadripper Zen 3 5000 (Chagall)": { + tflops: number; + }; + "Ryzen Threadripper Zen 2 3000 (Castle Peak)": { + tflops: number; + }; + "Ryzen Threadripper Zen 1000 (Whitehaven)": { + tflops: number; + }; + "Ryzen Zen 5 9000 (Ryzen 9)": { + tflops: number; + }; + "Ryzen Zen 5 9000 (Ryzen 7)": { + tflops: number; + }; + "Ryzen Zen 5 9000 (Ryzen 5)": { + tflops: number; + }; + "Ryzen Zen 4 7000 (Ryzen 9)": { + tflops: number; + }; + "Ryzen Zen 4 7000 (Ryzen 7)": { + tflops: number; + }; + "Ryzen Zen 4 7000 (Ryzen 5)": { + tflops: number; + }; + "Ryzen Zen 3 5000 (Ryzen 9)": { + tflops: number; + }; + "Ryzen Zen 3 5000 (Ryzen 7)": { + tflops: number; + }; + "Ryzen Zen 3 5000 (Ryzen 5)": { + tflops: number; + }; + "Ryzen Zen 2 3000 (Ryzen 9)": { + tflops: number; + }; + "Ryzen Zen 2 3000 (Ryzen 7)": { + tflops: number; + }; + "Ryzen Zen 2 3000 (Ryzen 5)": { + tflops: number; + }; + "Ryzen Zen 2 3000 (Ryzen 3)": { + tflops: number; + }; + }; + }; + "Apple Silicon": { + "-": { + "Apple M1": { + tflops: number; + memory: number[]; + }; + "Apple M1 Pro": { + tflops: number; + memory: number[]; + }; + "Apple M1 Max": { + tflops: number; + memory: number[]; + }; + "Apple M1 Ultra": { + tflops: number; + memory: number[]; + }; + "Apple M2": { + tflops: number; + memory: number[]; + }; + "Apple M2 Pro": { + tflops: number; + memory: number[]; + }; + "Apple M2 Max": { + tflops: number; + memory: number[]; + }; + "Apple M2 Ultra": { + tflops: number; + memory: number[]; + }; + "Apple M3": { + tflops: number; + memory: number[]; + }; + "Apple M3 Pro": { + tflops: number; + memory: number[]; + }; + "Apple M3 Max": { + tflops: number; + memory: number[]; + }; + "Apple M3 Ultra": { + tflops: number; + memory: number[]; + }; + "Apple M4": { + tflops: number; + memory: number[]; + }; + "Apple M4 Pro": { + tflops: number; + memory: number[]; + }; + "Apple M4 Max": { + tflops: number; + memory: number[]; + }; + "Apple M5": { + tflops: number; + memory: number[]; + }; + }; + }; +}; +export type SkuType = keyof typeof SKUS; +//# sourceMappingURL=hardware.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/hardware.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/hardware.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..712802baac234d70812debd66c9dc7d0643422c5 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/hardware.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/hardware.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iDAAiD,QAAW,CAAC;AAC1E,eAAO,MAAM,yDAAyD,QAAW,CAAC;AAClF,eAAO,MAAM,oCAAoC,QAAU,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,+CAA+C,QAAW,CAAC;AAExE,MAAM,WAAW,YAAY;IAC5B;;;;;;;;;OASG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,UAElC,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqwBuD,CAAC;AAEzE,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/hardware.js b/node_modules/@huggingface/tasks/dist/commonjs/hardware.js new file mode 100644 index 0000000000000000000000000000000000000000..784bce014378bb12a1c54c69ed6bef2e3cd9f871 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/hardware.js @@ -0,0 +1,792 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SKUS = exports.DEFAULT_MEMORY_OPTIONS = exports.TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL = exports.TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER = exports.TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = exports.TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = void 0; +/** + * Biden AI Executive Order (since revoked by President Trump): + * https://web.archive.org/web/20250105222429/https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/ + */ +exports.TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = 10 ** 14; +exports.TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = 10 ** 11; +exports.TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER = 10 ** 8; +/** + * EU AI Act + * https://ec.europa.eu/commission/presscorner/detail/en/qanda_21_1683 + */ +exports.TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL = 10 ** 13; +exports.DEFAULT_MEMORY_OPTIONS = [ + 8, 16, 24, 32, 40, 48, 64, 80, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, +]; +exports.SKUS = { + GPU: { + NVIDIA: { + B200: { + tflops: 496.6, + memory: [192], + }, + H200: { + tflops: 241.3, + memory: [141], + }, + H100: { + tflops: 267.6, + memory: [80], + }, + L40s: { + tflops: 91.61, + memory: [48], + }, + L40: { + tflops: 90.52, + memory: [48], + }, + L20: { + tflops: 59.35, + memory: [48], + }, + L4: { + tflops: 30.29, + memory: [24], + }, + GB10: { + tflops: 29.71, + memory: [128], + }, + "RTX PRO 6000 WS": { + tflops: 126, + memory: [96], + }, + "RTX PRO 6000 Max-Q": { + tflops: 116, + memory: [96], + }, + "RTX 6000 Ada": { + tflops: 91.1, + memory: [48], + }, + "RTX 5880 Ada": { + tflops: 69.3, + memory: [48], + }, + "RTX 5000 Ada": { + tflops: 65.3, + memory: [32], + }, + "RTX 4500 Ada": { + tflops: 39.6, + memory: [24], + }, + "RTX 4000 Ada": { + tflops: 26.7, + memory: [20], + }, + "RTX 4000 SFF Ada": { + tflops: 19.2, + memory: [20], + }, + "RTX 2000 Ada": { + tflops: 12.0, + memory: [16], + }, + "RTX A6000": { + tflops: 38.7, + memory: [48], + }, + "RTX A5000": { + tflops: 27.77, + memory: [8, 12, 24], + }, + "RTX A5000 Max-Q": { + tflops: 16.59, + memory: [16], + }, + "RTX A5000 Mobile": { + tflops: 19.35, + memory: [16], + }, + "RTX A4000": { + tflops: 19.17, + memory: [16], + }, + "RTX A4000 Max-Q": { + tflops: 14.28, + memory: [8], + }, + "RTX A4000 Mobile": { + tflops: 17.2, + memory: [8], + }, + "RTX A3000 Mobile": { + tflops: 10.9, + memory: [6, 12], + }, + "RTX A2000": { + tflops: 7.987, + memory: [6, 12], + }, + "RTX A2000 Embedded": { + tflops: 6.026, + memory: [4], + }, + "RTX A2000 Max-Q": { + tflops: 6.1, + memory: [4, 8], + }, + "RTX A2000 Mobile": { + tflops: 8.4, + memory: [4, 8], + }, + A100: { + tflops: 77.97, + memory: [80, 40], + }, + A40: { + tflops: 37.42, + memory: [48], + }, + A30: { + tflops: 10.32, + memory: [24], + }, + A10: { + tflops: 31.24, + memory: [24], + }, + A2: { + tflops: 4.531, // source: https://www.techpowerup.com/gpu-specs/a2.c3848 + memory: [16], + }, + "RTX 5090": { + tflops: 104.8, + memory: [32], + }, + "RTX 5090 D": { + tflops: 104.8, + memory: [32], + }, + "RTX 5080": { + tflops: 56.28, + memory: [16], + }, + "RTX 5080 Mobile": { + tflops: 24.58, + memory: [16], + }, + "RTX 5070": { + tflops: 30.84, + memory: [12], + }, + "RTX 5070 Mobile": { + tflops: 23.22, + memory: [8], + }, + "RTX 5070 Ti": { + tflops: 43.94, + memory: [16], + }, + "RTX 5060 Ti": { + tflops: 23.7, // source https://www.techpowerup.com/gpu-specs/geforce-rtx-5060-ti.c4246 + memory: [16, 8], + }, + "RTX 5060": { + tflops: 19.18, // source https://www.techpowerup.com/gpu-specs/geforce-rtx-5060.c4219 + memory: [8], + }, + "RTX 4090": { + tflops: 82.58, + memory: [24], + }, + "RTX 4090D": { + tflops: 79.49, + memory: [24, 48], + }, + "RTX 4090 Mobile": { + tflops: 32.98, + memory: [16], + }, + "RTX 4080 SUPER": { + tflops: 52.2, + memory: [16], + }, + "RTX 4080": { + tflops: 48.7, + memory: [16], + }, + "RTX 4080 Mobile": { + tflops: 24.72, + memory: [12], + }, + "RTX 4070": { + tflops: 29.15, + memory: [12], + }, + "RTX 4070 Mobile": { + tflops: 15.62, + memory: [8], + }, + "RTX 4070 Ti": { + tflops: 40.09, + memory: [12], + }, + "RTX 4070 Super": { + tflops: 35.48, + memory: [12], + }, + "RTX 4070 Ti Super": { + tflops: 44.1, + memory: [16], + }, + "RTX 4060": { + tflops: 15.11, + memory: [8], + }, + "RTX 4060 Ti": { + tflops: 22.06, + memory: [8, 16], + }, + "RTX 4090 Laptop": { + tflops: 32.98, + memory: [16], + }, + "RTX 4080 Laptop": { + tflops: 24.72, + memory: [12], + }, + "RTX 4070 Laptop": { + tflops: 15.62, + memory: [8], + }, + "RTX 4060 Laptop": { + tflops: 11.61, + memory: [8], + }, + "RTX 4050 Laptop": { + tflops: 8.9, + memory: [6], + }, + "RTX 3090": { + tflops: 35.58, + memory: [24], + }, + "RTX 3090 Ti": { + tflops: 40, + memory: [24], + }, + "RTX 3080": { + tflops: 30.6, + memory: [12, 10], + }, + "RTX 3080 Ti": { + tflops: 34.1, + memory: [12], + }, + "RTX 3080 Mobile": { + tflops: 18.98, + memory: [8], + }, + "RTX 3070": { + tflops: 20.31, + memory: [8], + }, + "RTX 3070 Ti": { + tflops: 21.75, + memory: [8], + }, + "RTX 3070 Ti Mobile": { + tflops: 16.6, + memory: [8], + }, + "RTX 3060 Ti": { + tflops: 16.2, + memory: [8], + }, + "RTX 3060": { + tflops: 12.74, + memory: [12, 8], + }, + "RTX 2080 Ti": { + tflops: 26.9, + memory: [11, 22], // 22GB: modded 2080ti + }, + "RTX 2080": { + tflops: 20.14, + memory: [8], + }, + "RTX 2070": { + tflops: 14.93, + memory: [8], + }, + "RTX 2070 SUPER Mobile": { + tflops: 14.13, + memory: [8], + }, + "RTX 2070 SUPER": { + tflops: 18.12, + memory: [8], + }, + "RTX 3060 Mobile": { + tflops: 10.94, + memory: [6], + }, + "RTX 3050 Mobile": { + tflops: 7.639, + memory: [4, 6], + }, + "RTX 2060": { + tflops: 12.9, + memory: [6], + }, + "RTX 2060 12GB": { + tflops: 14.36, + memory: [12], + }, + "RTX 2060 Mobile": { + tflops: 9.22, + memory: [6], + }, + "GTX 1080 Ti": { + tflops: 11.34, // float32 (GPU does not support native float16) + memory: [11], + }, + "GTX 1070 Ti": { + tflops: 8.2, // float32 (GPU does not support native float16) + memory: [8], + }, + "GTX 1060": { + tflops: 3.9, // float32 (GPU does not support native float16) + memory: [3, 6], + }, + "GTX 1050 Ti": { + tflops: 2.1, // float32 (GPU does not support native float16) + memory: [4], + }, + "RTX Titan": { + tflops: 32.62, + memory: [24], + }, + "GTX 1660": { + tflops: 10.05, + memory: [6], + }, + "GTX 1650 Mobile": { + tflops: 6.39, + memory: [4], + }, + T4: { + tflops: 65.13, + memory: [16], + }, + T10: { + tflops: 20.0, + memory: [16], + }, + V100: { + tflops: 28.26, + memory: [32, 16], + }, + "Quadro P6000": { + tflops: 12.63, // float32 (GPU does not support native float16) + memory: [24], + }, + P40: { + tflops: 11.76, // float32 (GPU does not support native float16) + memory: [24], + }, + P100: { + tflops: 19.05, + memory: [16], + }, + "Jetson AGX Orin 64GB": { + tflops: 10.65, + memory: [64], + }, + "Jetson AGX Orin 32GB": { + tflops: 6.66, + memory: [32], + }, + "Jetson Orin NX 16GB": { + tflops: 3.76, + memory: [16], + }, + "Jetson Orin NX 8GB": { + tflops: 3.13, + memory: [8], + }, + "Jetson Orin Nano 8GB": { + tflops: 2.56, + memory: [8], + }, + "Jetson Orin Nano 4GB": { + tflops: 1.28, + memory: [4], + }, + "Jetson AGX Xavier": { + tflops: 2.82, + memory: [32, 64], + }, + "Jetson Xavier NX": { + tflops: 1.69, + memory: [8, 16], + }, + "Jetson TX2": { + tflops: 1.33, + memory: [4, 8], + }, + "Jetson Nano": { + tflops: 0.47, + memory: [4], + }, + }, + AMD: { + MI300: { + tflops: 383.0, + memory: [192], + }, + MI250: { + tflops: 362.1, + memory: [128], + }, + MI210: { + tflops: 181.0, + memory: [64], + }, + MI100: { + tflops: 184.6, + memory: [32], + }, + MI60: { + tflops: 29.5, + memory: [32], + }, + MI50: { + tflops: 26.5, + memory: [16, 32], + }, + "R9700 PRO": { + tflops: 95.7, + memory: [32], + }, + "RX 9070 XT": { + tflops: 97.32, + memory: [16], + }, + "RX 9070": { + tflops: 72.25, + memory: [16], + }, + "RX 7900 XTX": { + tflops: 122.8, + memory: [24], + }, + "RX 7900 XT": { + tflops: 103.0, + memory: [20], + }, + "RX 7900 GRE": { + tflops: 91.96, + memory: [16], + }, + "RX 7800 XT": { + tflops: 74.65, + memory: [16], + }, + "RX 7700 XT": { + tflops: 70.34, + memory: [12], + }, + "RX 7600 XT": { + tflops: 45.14, + memory: [16, 8], + }, + "RX 6950 XT": { + tflops: 47.31, + memory: [16], + }, + "RX 6800": { + tflops: 32.33, + memory: [16], + }, + "RX 6700 XT": { + tflops: 26.43, + memory: [12], + }, + "RX 6700": { + tflops: 22.58, + memory: [10], + }, + "RX 6650 XT": { + tflops: 21.59, + memory: [8], + }, + "RX 6600 XT": { + tflops: 21.21, + memory: [8], + }, + "RX 6600": { + tflops: 17.86, + memory: [8], + }, + "Radeon Pro VII": { + tflops: 26.11, + memory: [16, 32], + }, + }, + INTEL: { + "Arc A750": { + tflops: 34.41, + memory: [8], + }, + "Arc A770": { + tflops: 39.32, + memory: [8, 16], + }, + "Arc B570": { + tflops: 23.04, + memory: [10], + }, + "Arc B580": { + tflops: 27.34, + memory: [12], + }, + "Arc B50": { + tflops: 21.3, + memory: [16], + }, + "Arc B60": { + tflops: 24.58, + memory: [24, 48], + }, + }, + QUALCOMM: { + "Snapdragon X Elite X1E-00-1DE": { + tflops: 4.6, + }, + "Snapdragon X Elite X1E-84-100": { + tflops: 4.6, + }, + "Snapdragon X Elite X1E-80-100": { + tflops: 3.8, + }, + "Snapdragon X Elite X1E-78-100": { + tflops: 3.8, + }, + "Snapdragon X Plus X1P-64-100": { + tflops: 3.8, + }, + }, + }, + CPU: { + Intel: { + "Xeon 4th Generation (Sapphire Rapids)": { + tflops: 1.3, + }, + "Xeon 3th Generation (Ice Lake)": { + tflops: 0.8, + }, + "Xeon 2th Generation (Cascade Lake)": { + tflops: 0.55, + }, + "Xeon E5v4 (Broadwell)": { + tflops: 0.25, + }, + "Xeon E5v3 (Haswell)": { + tflops: 0.2, + }, + "Xeon E5v2 (Ivy Bridge)": { + tflops: 0.15, + }, + "Intel Core Ultra 7 265KF": { + tflops: 1.53, + }, + "Intel Core 14th Generation (i7)": { + tflops: 0.8, + }, + "Intel Core 13th Generation (i9)": { + tflops: 0.85, + }, + "Intel Core 13th Generation (i7)": { + tflops: 0.82, + }, + "Intel Core 13th Generation (i5)": { + tflops: 0.68, + }, + "Intel Core 13th Generation (i3)": { + tflops: 0.57, + }, + "Intel Core 12th Generation (i9)": { + tflops: 0.79, + }, + "Intel Core 12th Generation (i7)": { + tflops: 0.77, + }, + "Intel Core 12th Generation (i5)": { + tflops: 0.65, + }, + "Intel Core 12th Generation (i3)": { + tflops: 0.53, + }, + "Intel Core 11th Generation (i9)": { + tflops: 0.7, + }, + "Intel Core 11th Generation (i7)": { + tflops: 0.6, + }, + "Intel Core 11th Generation (i5)": { + tflops: 0.5, + }, + "Intel Core 11th Generation (i3)": { + tflops: 0.35, + }, + "Intel Core 10th Generation (i9)": { + tflops: 0.46, + }, + "Intel Core 10th Generation (i7)": { + tflops: 0.46, + }, + "Intel Core 10th Generation (i5)": { + tflops: 0.46, + }, + "Intel Core 10th Generation (i3)": { + tflops: 0.44, + }, + }, + AMD: { + "EPYC 5th Generation Zen 5 (Turin)": { + tflops: 13.8, + }, + "EPYC 4th Generation Zen 4 (Genoa)": { + tflops: 5, + }, + "EPYC 3th Generation Zen 3 (Milan)": { + tflops: 2.4, + }, + "EPYC 2th Generation Zen 2 (Rome)": { + tflops: 0.6, + }, + "EPYC 1st Generation Zen (Naples)": { + tflops: 0.6, + }, + "Ryzen Threadripper Zen 5 9000 (Shimada Peak)": { + tflops: 14.0, + }, + "Ryzen Threadripper Zen 4 7000 (Storm Peak)": { + tflops: 10.0, + }, + "Ryzen Threadripper Zen 3 5000 (Chagall)": { + tflops: 4.6, + }, + "Ryzen Threadripper Zen 2 3000 (Castle Peak)": { + tflops: 3.2, + }, + "Ryzen Threadripper Zen 1000 (Whitehaven)": { + tflops: 0.6, + }, + "Ryzen Zen 5 9000 (Ryzen 9)": { + tflops: 0.56, + }, + "Ryzen Zen 5 9000 (Ryzen 7)": { + tflops: 0.56, + }, + "Ryzen Zen 5 9000 (Ryzen 5)": { + tflops: 0.56, + }, + "Ryzen Zen 4 7000 (Ryzen 9)": { + tflops: 0.56, + }, + "Ryzen Zen 4 7000 (Ryzen 7)": { + tflops: 0.56, + }, + "Ryzen Zen 4 7000 (Ryzen 5)": { + tflops: 0.56, + }, + "Ryzen Zen 3 5000 (Ryzen 9)": { + tflops: 1.33, + }, + "Ryzen Zen 3 5000 (Ryzen 7)": { + tflops: 1.33, + }, + "Ryzen Zen 3 5000 (Ryzen 5)": { + tflops: 0.72, + }, + "Ryzen Zen 2 3000 (Ryzen 9)": { + tflops: 0.72, + }, + "Ryzen Zen 2 3000 (Ryzen 7)": { + tflops: 0.72, + }, + "Ryzen Zen 2 3000 (Ryzen 5)": { + tflops: 0.72, + }, + "Ryzen Zen 2 3000 (Ryzen 3)": { + tflops: 0.72, + }, + }, + }, + "Apple Silicon": { + "-": { + "Apple M1": { + tflops: 2.6, + memory: [8, 16], + }, + "Apple M1 Pro": { + tflops: 5.2, + memory: [16, 24, 32], + }, + "Apple M1 Max": { + tflops: 10.4, + memory: [16, 24, 32, 64], + }, + "Apple M1 Ultra": { + tflops: 21, + memory: [16, 24, 32, 64, 96, 128], + }, + "Apple M2": { + tflops: 3.6, + memory: [8, 16, 24], + }, + "Apple M2 Pro": { + tflops: 6.8, + memory: [16, 24, 32], + }, + "Apple M2 Max": { + tflops: 13.49, + memory: [32, 64, 96], + }, + "Apple M2 Ultra": { + tflops: 27.2, + memory: [64, 96, 128, 192], + }, + "Apple M3": { + tflops: 4.1, + memory: [8, 16, 24], + }, + "Apple M3 Pro": { + tflops: 7.4, + memory: [18, 36], + }, + "Apple M3 Max": { + tflops: 14.2, + memory: [36, 48, 64, 96, 128], + }, + "Apple M3 Ultra": { + tflops: 28.4, + memory: [96, 256, 512], + }, + "Apple M4": { + tflops: 4.6, + memory: [16, 24, 32], + }, + "Apple M4 Pro": { + tflops: 9.2, + memory: [24, 48, 64], + }, + "Apple M4 Max": { + tflops: 18.4, + memory: [36, 48, 64, 96, 128, 256, 512], + }, + "Apple M5": { + tflops: 5.7, + memory: [16, 24, 32], + }, + }, + }, +}; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/index.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a1ea3ff735b220e671819ffb534060242f880c8 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/index.d.ts @@ -0,0 +1,21 @@ +export { LIBRARY_TASK_MAPPING } from "./library-to-tasks.js"; +export { MAPPING_DEFAULT_WIDGET } from "./default-widget-inputs.js"; +export type { TaskData, TaskDemo, TaskDemoEntry, ExampleRepo } from "./tasks/index.js"; +export * from "./tasks/index.js"; +export { PIPELINE_DATA, PIPELINE_TYPES, type WidgetType, type PipelineType, type PipelineData, type Modality, MODALITIES, MODALITY_LABELS, SUBTASK_TYPES, PIPELINE_TYPES_SET, } from "./pipelines.js"; +export { ALL_DISPLAY_MODEL_LIBRARY_KEYS, ALL_MODEL_LIBRARY_KEYS, MODEL_LIBRARIES_UI_ELEMENTS, } from "./model-libraries.js"; +export type { LibraryUiElement, ModelLibraryKey } from "./model-libraries.js"; +export type { ModelData, TransformersInfo } from "./model-data.js"; +export type { AddedToken, SpecialTokensMap, TokenizerConfig } from "./tokenizer-data.js"; +export type { WidgetExample, WidgetExampleAttribute, WidgetExampleAssetAndPromptInput, WidgetExampleAssetAndTextInput, WidgetExampleAssetAndZeroShotInput, WidgetExampleAssetInput, WidgetExampleChatInput, WidgetExampleSentenceSimilarityInput, WidgetExampleStructuredDataInput, WidgetExampleTableDataInput, WidgetExampleTextAndContextInput, WidgetExampleTextAndTableInput, WidgetExampleTextInput, WidgetExampleZeroShotTextInput, WidgetExampleOutput, WidgetExampleOutputUrl, WidgetExampleOutputLabels, WidgetExampleOutputAnswerScore, WidgetExampleOutputText, } from "./widget-example.js"; +export { SPECIAL_TOKENS_ATTRIBUTES } from "./tokenizer-data.js"; +export * from "./gguf.js"; +export { type InferenceSnippet, type InferenceSnippetLanguage, type ModelDataMinimal, inferenceSnippetLanguages, stringifyGenerationConfig, stringifyMessages, getModelInputSnippet, } from "./snippets/index.js"; +export { SKUS, DEFAULT_MEMORY_OPTIONS } from "./hardware.js"; +export type { HardwareSpec, SkuType } from "./hardware.js"; +export { LOCAL_APPS } from "./local-apps.js"; +export type { LocalApp, LocalAppKey, LocalAppSnippet } from "./local-apps.js"; +export { DATASET_LIBRARIES_UI_ELEMENTS } from "./dataset-libraries.js"; +export type { DatasetLibraryUiElement, DatasetLibraryKey } from "./dataset-libraries.js"; +export * from "./inference-providers.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/index.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..af56501b974888c5c157cacae63063d3f76e67cb --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvF,cAAc,kBAAkB,CAAC;AACjC,OAAO,EACN,aAAa,EACb,cAAc,EACd,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,UAAU,EACV,eAAe,EACf,aAAa,EACb,kBAAkB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,8BAA8B,EAC9B,sBAAsB,EACtB,2BAA2B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC9E,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzF,YAAY,EACX,aAAa,EACb,sBAAsB,EACtB,gCAAgC,EAChC,8BAA8B,EAC9B,kCAAkC,EAClC,uBAAuB,EACvB,sBAAsB,EACtB,oCAAoC,EACpC,gCAAgC,EAChC,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,8BAA8B,EAC9B,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,cAAc,WAAW,CAAC;AAE1B,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,YAAY,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEzF,cAAc,0BAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/index.js b/node_modules/@huggingface/tasks/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6624140e511d714175462c923ca16b42eb58a93a --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/index.js @@ -0,0 +1,49 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DATASET_LIBRARIES_UI_ELEMENTS = exports.LOCAL_APPS = exports.DEFAULT_MEMORY_OPTIONS = exports.SKUS = exports.getModelInputSnippet = exports.stringifyMessages = exports.stringifyGenerationConfig = exports.inferenceSnippetLanguages = exports.SPECIAL_TOKENS_ATTRIBUTES = exports.MODEL_LIBRARIES_UI_ELEMENTS = exports.ALL_MODEL_LIBRARY_KEYS = exports.ALL_DISPLAY_MODEL_LIBRARY_KEYS = exports.PIPELINE_TYPES_SET = exports.SUBTASK_TYPES = exports.MODALITY_LABELS = exports.MODALITIES = exports.PIPELINE_TYPES = exports.PIPELINE_DATA = exports.MAPPING_DEFAULT_WIDGET = exports.LIBRARY_TASK_MAPPING = void 0; +var library_to_tasks_js_1 = require("./library-to-tasks.js"); +Object.defineProperty(exports, "LIBRARY_TASK_MAPPING", { enumerable: true, get: function () { return library_to_tasks_js_1.LIBRARY_TASK_MAPPING; } }); +var default_widget_inputs_js_1 = require("./default-widget-inputs.js"); +Object.defineProperty(exports, "MAPPING_DEFAULT_WIDGET", { enumerable: true, get: function () { return default_widget_inputs_js_1.MAPPING_DEFAULT_WIDGET; } }); +__exportStar(require("./tasks/index.js"), exports); +var pipelines_js_1 = require("./pipelines.js"); +Object.defineProperty(exports, "PIPELINE_DATA", { enumerable: true, get: function () { return pipelines_js_1.PIPELINE_DATA; } }); +Object.defineProperty(exports, "PIPELINE_TYPES", { enumerable: true, get: function () { return pipelines_js_1.PIPELINE_TYPES; } }); +Object.defineProperty(exports, "MODALITIES", { enumerable: true, get: function () { return pipelines_js_1.MODALITIES; } }); +Object.defineProperty(exports, "MODALITY_LABELS", { enumerable: true, get: function () { return pipelines_js_1.MODALITY_LABELS; } }); +Object.defineProperty(exports, "SUBTASK_TYPES", { enumerable: true, get: function () { return pipelines_js_1.SUBTASK_TYPES; } }); +Object.defineProperty(exports, "PIPELINE_TYPES_SET", { enumerable: true, get: function () { return pipelines_js_1.PIPELINE_TYPES_SET; } }); +var model_libraries_js_1 = require("./model-libraries.js"); +Object.defineProperty(exports, "ALL_DISPLAY_MODEL_LIBRARY_KEYS", { enumerable: true, get: function () { return model_libraries_js_1.ALL_DISPLAY_MODEL_LIBRARY_KEYS; } }); +Object.defineProperty(exports, "ALL_MODEL_LIBRARY_KEYS", { enumerable: true, get: function () { return model_libraries_js_1.ALL_MODEL_LIBRARY_KEYS; } }); +Object.defineProperty(exports, "MODEL_LIBRARIES_UI_ELEMENTS", { enumerable: true, get: function () { return model_libraries_js_1.MODEL_LIBRARIES_UI_ELEMENTS; } }); +var tokenizer_data_js_1 = require("./tokenizer-data.js"); +Object.defineProperty(exports, "SPECIAL_TOKENS_ATTRIBUTES", { enumerable: true, get: function () { return tokenizer_data_js_1.SPECIAL_TOKENS_ATTRIBUTES; } }); +__exportStar(require("./gguf.js"), exports); +var index_js_1 = require("./snippets/index.js"); +Object.defineProperty(exports, "inferenceSnippetLanguages", { enumerable: true, get: function () { return index_js_1.inferenceSnippetLanguages; } }); +Object.defineProperty(exports, "stringifyGenerationConfig", { enumerable: true, get: function () { return index_js_1.stringifyGenerationConfig; } }); +Object.defineProperty(exports, "stringifyMessages", { enumerable: true, get: function () { return index_js_1.stringifyMessages; } }); +Object.defineProperty(exports, "getModelInputSnippet", { enumerable: true, get: function () { return index_js_1.getModelInputSnippet; } }); +var hardware_js_1 = require("./hardware.js"); +Object.defineProperty(exports, "SKUS", { enumerable: true, get: function () { return hardware_js_1.SKUS; } }); +Object.defineProperty(exports, "DEFAULT_MEMORY_OPTIONS", { enumerable: true, get: function () { return hardware_js_1.DEFAULT_MEMORY_OPTIONS; } }); +var local_apps_js_1 = require("./local-apps.js"); +Object.defineProperty(exports, "LOCAL_APPS", { enumerable: true, get: function () { return local_apps_js_1.LOCAL_APPS; } }); +var dataset_libraries_js_1 = require("./dataset-libraries.js"); +Object.defineProperty(exports, "DATASET_LIBRARIES_UI_ELEMENTS", { enumerable: true, get: function () { return dataset_libraries_js_1.DATASET_LIBRARIES_UI_ELEMENTS; } }); +__exportStar(require("./inference-providers.js"), exports); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..29f4bb45c802aec12d780f4cd3bf823ac8b1aa89 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.d.ts @@ -0,0 +1,11 @@ +declare const INFERENCE_PROVIDERS: readonly ["cerebras", "cohere", "fal-ai", "fireworks-ai", "hf-inference", "hyperbolic", "ovhcloud", "replicate", "sambanova", "together"]; +export type SnippetInferenceProvider = (typeof INFERENCE_PROVIDERS)[number] | string; +export declare const HF_HUB_INFERENCE_PROXY_TEMPLATE = "https://router.huggingface.co/{{PROVIDER}}"; +/** + * URL to set as baseUrl in the OpenAI SDK. + * + * TODO(Expose this from InferenceClient in the future?) + */ +export declare function openAIbaseUrl(provider: SnippetInferenceProvider): string; +export {}; +//# sourceMappingURL=inference-providers.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..45c66ab5b1890751d025c7847da9c744299bf5e0 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference-providers.d.ts","sourceRoot":"","sources":["../../src/inference-providers.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,mBAAmB,2IAWf,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAErF,eAAO,MAAM,+BAA+B,+CAA+C,CAAC;AAE5F;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,wBAAwB,GAAG,MAAM,CAGxE"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.js b/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.js new file mode 100644 index 0000000000000000000000000000000000000000..0a716b661bd9a999207342707622f65abd59dcd6 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/inference-providers.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HF_HUB_INFERENCE_PROXY_TEMPLATE = void 0; +exports.openAIbaseUrl = openAIbaseUrl; +/// This list is for illustration purposes only. +/// in the `tasks` sub-package, we do not need actual strong typing of the inference providers. +const INFERENCE_PROVIDERS = [ + "cerebras", + "cohere", + "fal-ai", + "fireworks-ai", + "hf-inference", + "hyperbolic", + "ovhcloud", + "replicate", + "sambanova", + "together", +]; +exports.HF_HUB_INFERENCE_PROXY_TEMPLATE = `https://router.huggingface.co/{{PROVIDER}}`; +/** + * URL to set as baseUrl in the OpenAI SDK. + * + * TODO(Expose this from InferenceClient in the future?) + */ +function openAIbaseUrl(provider) { + const url = exports.HF_HUB_INFERENCE_PROXY_TEMPLATE.replace("{{PROVIDER}}", provider); + return provider === "hf-inference" ? `${url}/v1` : url; +} diff --git a/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..61ffd282076871d1b86f92570b95e9a44cded208 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.d.ts @@ -0,0 +1,12 @@ +import type { ModelLibraryKey } from "./model-libraries.js"; +import type { PipelineType } from "./pipelines.js"; +/** + * Mapping from library name to its supported tasks. + * HF-Inference API (serverless) should be disabled for all other (library, task) pairs beyond this mapping. + * This mapping is partially generated automatically by "python-api-export-tasks" action in + * huggingface/api-inference-community repo upon merge. For transformers, the mapping is manually + * based on api-inference (hf_types.rs). + */ +export declare const LIBRARY_TASK_MAPPING: Partial>; +export declare const REMOVED_IN_V5_TRANSFORMERS_PIPELINES: PipelineType[]; +//# sourceMappingURL=library-to-tasks.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8b35f76b24f02a9f3c534de64d33fe47930cb7ae --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"library-to-tasks.d.ts","sourceRoot":"","sources":["../../src/library-to-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,CAAC,CA6DjF,CAAC;AAGF,eAAO,MAAM,oCAAoC,EAAE,YAAY,EAAsD,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.js b/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.js new file mode 100644 index 0000000000000000000000000000000000000000..6d6ac94d7f1082c4b2216f1f722ec0808c551204 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/library-to-tasks.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.REMOVED_IN_V5_TRANSFORMERS_PIPELINES = exports.LIBRARY_TASK_MAPPING = void 0; +/** + * Mapping from library name to its supported tasks. + * HF-Inference API (serverless) should be disabled for all other (library, task) pairs beyond this mapping. + * This mapping is partially generated automatically by "python-api-export-tasks" action in + * huggingface/api-inference-community repo upon merge. For transformers, the mapping is manually + * based on api-inference (hf_types.rs). + */ +exports.LIBRARY_TASK_MAPPING = { + "adapter-transformers": ["question-answering", "text-classification", "token-classification"], + allennlp: ["question-answering"], + asteroid: [ + // "audio-source-separation", + "audio-to-audio", + ], + bertopic: ["text-classification"], + diffusers: ["image-to-image", "text-to-image"], + doctr: ["object-detection"], + espnet: ["text-to-speech", "automatic-speech-recognition"], + fairseq: ["text-to-speech", "audio-to-audio"], + fastai: ["image-classification"], + fasttext: ["feature-extraction", "text-classification"], + flair: ["token-classification"], + k2: ["automatic-speech-recognition"], + keras: ["image-classification"], + nemo: ["automatic-speech-recognition"], + open_clip: ["zero-shot-classification", "zero-shot-image-classification"], + paddlenlp: ["fill-mask", "summarization", "zero-shot-classification"], + peft: ["text-generation"], + "pyannote-audio": ["automatic-speech-recognition"], + "sentence-transformers": ["feature-extraction", "sentence-similarity"], + setfit: ["text-classification"], + sklearn: ["tabular-classification", "tabular-regression", "text-classification"], + spacy: ["token-classification", "text-classification", "sentence-similarity"], + "span-marker": ["token-classification"], + speechbrain: ["audio-classification", "audio-to-audio", "automatic-speech-recognition", "text-to-speech"], + stanza: ["token-classification"], + timm: ["image-classification", "image-feature-extraction"], + transformers: [ + "audio-classification", + "automatic-speech-recognition", + "depth-estimation", + "document-question-answering", + "feature-extraction", + "fill-mask", + "image-classification", + "image-feature-extraction", + "image-segmentation", + "image-to-image", + "image-to-text", + "image-text-to-text", + "mask-generation", + "object-detection", + "question-answering", + "summarization", + "table-question-answering", + "text-classification", + "text-generation", + "text-to-audio", + "text-to-speech", + "token-classification", + "translation", + "video-classification", + "visual-question-answering", + "zero-shot-classification", + "zero-shot-image-classification", + "zero-shot-object-detection", + ], + mindspore: ["image-classification"], +}; +// Pipeline types that were supported in legacy transformers versions (<5.0.0) +exports.REMOVED_IN_V5_TRANSFORMERS_PIPELINES = ["image-to-text", "summarization", "translation"]; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/local-apps.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..03410adca8cb77bb0d1c9b6328d1276d98ac5309 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.d.ts @@ -0,0 +1,218 @@ +import type { ModelData } from "./model-data.js"; +import type { PipelineType } from "./pipelines.js"; +export interface LocalAppSnippet { + /** + * Title of the snippet + */ + title: string; + /** + * Optional setup guide + */ + setup?: string; + /** + * Content (or command) to be run + */ + content: string | string[]; +} +/** + * Elements configurable by a local app. + */ +export type LocalApp = { + /** + * Name that appears in buttons + */ + prettyLabel: string; + /** + * Link to get more info about a local app (website etc) + */ + docsUrl: string; + /** + * main category of app + */ + mainTask: PipelineType; + /** + * Whether to display a pill "macOS-only" + */ + macOSOnly?: boolean; + comingSoon?: boolean; + /** + * IMPORTANT: function to figure out whether to display the button on a model page's main "Use this model" dropdown. + */ + displayOnModelPage: (model: ModelData) => boolean; +} & ({ + /** + * If the app supports deeplink, URL to open. + */ + deeplink: (model: ModelData, filepath?: string) => URL; +} | { + /** + * And if not (mostly llama.cpp), snippet to copy/paste in your terminal + * Support the placeholder {{GGUF_FILE}} that will be replaced by the gguf file path or the list of available files. + * Support the placeholder {{QUANT_TAG}} that will be replaced by the list of available quant tags or will be removed if there are no multiple quant files in a same repo. + */ + snippet: (model: ModelData, filepath?: string) => string | string[] | LocalAppSnippet | LocalAppSnippet[]; +}); +declare function isTgiModel(model: ModelData): boolean; +declare function isLlamaCppGgufModel(model: ModelData): boolean; +declare function isVllmModel(model: ModelData): boolean; +declare function isDockerModelRunnerModel(model: ModelData): boolean; +/** + * Add your new local app here. + * + * This is open to new suggestions and awesome upcoming apps. + * + * /!\ IMPORTANT + * + * If possible, you need to support deeplinks and be as cross-platform as possible. + * + * Ping the HF team if we can help with anything! + */ +export declare const LOCAL_APPS: { + "llama.cpp": { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isLlamaCppGgufModel; + snippet: (model: ModelData, filepath?: string) => LocalAppSnippet[]; + }; + "node-llama-cpp": { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isLlamaCppGgufModel; + snippet: (model: ModelData, filepath?: string) => LocalAppSnippet[]; + }; + vllm: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isVllmModel; + snippet: (model: ModelData) => LocalAppSnippet[]; + }; + sglang: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: (model: ModelData) => boolean; + snippet: (model: ModelData) => LocalAppSnippet[]; + }; + "mlx-lm": { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: (model: ModelData) => boolean; + snippet: (model: ModelData) => LocalAppSnippet[]; + }; + tgi: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isTgiModel; + snippet: (model: ModelData) => LocalAppSnippet[]; + }; + lmstudio: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: (model: ModelData) => boolean; + deeplink: (model: ModelData, filepath: string | undefined) => URL; + }; + localai: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isLlamaCppGgufModel; + snippet: (model: ModelData, filepath?: string) => LocalAppSnippet[]; + }; + jan: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isLlamaCppGgufModel; + deeplink: (model: ModelData) => URL; + }; + backyard: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isLlamaCppGgufModel; + deeplink: (model: ModelData) => URL; + }; + sanctum: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isLlamaCppGgufModel; + deeplink: (model: ModelData) => URL; + }; + jellybox: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: (model: ModelData) => boolean; + deeplink: (model: ModelData) => URL; + }; + msty: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isLlamaCppGgufModel; + deeplink: (model: ModelData) => URL; + }; + recursechat: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + macOSOnly: true; + displayOnModelPage: typeof isLlamaCppGgufModel; + deeplink: (model: ModelData) => URL; + }; + drawthings: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-to-image"; + macOSOnly: true; + displayOnModelPage: (model: ModelData) => boolean; + deeplink: (model: ModelData) => URL; + }; + diffusionbee: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-to-image"; + macOSOnly: true; + displayOnModelPage: (model: ModelData) => boolean; + deeplink: (model: ModelData) => URL; + }; + joyfusion: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-to-image"; + macOSOnly: true; + displayOnModelPage: (model: ModelData) => boolean; + deeplink: (model: ModelData) => URL; + }; + ollama: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isLlamaCppGgufModel; + snippet: (model: ModelData, filepath?: string) => string; + }; + "docker-model-runner": { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: typeof isDockerModelRunnerModel; + snippet: (model: ModelData, filepath?: string) => string; + }; + lemonade: { + prettyLabel: string; + docsUrl: string; + mainTask: "text-generation"; + displayOnModelPage: (model: ModelData) => boolean; + snippet: (model: ModelData, filepath?: string) => LocalAppSnippet[]; + }; +}; +export type LocalAppKey = keyof typeof LOCAL_APPS; +export {}; +//# sourceMappingURL=local-apps.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/local-apps.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..63aabe7d48b4022235d4c32a812f773b37b9f53d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBA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C,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;yBAyC3D,SAAS,KAAG,eAAe,EAAE;;;;;;oCAkQ3B,SAAS;yBA5MT,SAAS,KAAG,eAAe,EAAE;;;;;;;yBAoF9B,SAAS,KAAG,eAAe,EAAE;;;;;;;yBA7B/B,SAAS,KAAG,eAAe,EAAE;;;;;;;;;;;;;;yBApIzB,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAJjD,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAwM1B,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAM9C,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;CAiO5C,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/local-apps.js b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.js new file mode 100644 index 0000000000000000000000000000000000000000..de564c85c4eca7351513b8447a6905c4359f1e4f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.js @@ -0,0 +1,526 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LOCAL_APPS = void 0; +const gguf_js_1 = require("./gguf.js"); +const common_js_1 = require("./snippets/common.js"); +const inputs_js_1 = require("./snippets/inputs.js"); +function isAwqModel(model) { + return model.config?.quantization_config?.quant_method === "awq"; +} +function isGptqModel(model) { + return model.config?.quantization_config?.quant_method === "gptq"; +} +function isAqlmModel(model) { + return model.config?.quantization_config?.quant_method === "aqlm"; +} +function isMarlinModel(model) { + return model.config?.quantization_config?.quant_method === "marlin"; +} +function isTransformersModel(model) { + return model.tags.includes("transformers"); +} +function isTgiModel(model) { + return model.tags.includes("text-generation-inference"); +} +function isLlamaCppGgufModel(model) { + return !!model.gguf?.context_length; +} +function isVllmModel(model) { + return ((isAwqModel(model) || + isGptqModel(model) || + isAqlmModel(model) || + isMarlinModel(model) || + isLlamaCppGgufModel(model) || + isTransformersModel(model)) && + (model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text")); +} +function isDockerModelRunnerModel(model) { + return isLlamaCppGgufModel(model) || isVllmModel(model); +} +function isAmdRyzenModel(model) { + return model.tags.includes("ryzenai-hybrid") || model.tags.includes("ryzenai-npu"); +} +function isMlxModel(model) { + return model.tags.includes("mlx"); +} +function getQuantTag(filepath) { + const defaultTag = ":{{QUANT_TAG}}"; + if (!filepath) { + return defaultTag; + } + const quantLabel = (0, gguf_js_1.parseGGUFQuantLabel)(filepath); + return quantLabel ? `:${quantLabel}` : defaultTag; +} +const snippetLlamacpp = (model, filepath) => { + const serverCommand = (binary) => { + const snippet = [ + "# Start a local OpenAI-compatible server with a web UI:", + `${binary} -hf ${model.id}${getQuantTag(filepath)}`, + ]; + return snippet.join("\n"); + }; + const cliCommand = (binary) => { + const snippet = ["# Run inference directly in the terminal:", `${binary} -hf ${model.id}${getQuantTag(filepath)}`]; + return snippet.join("\n"); + }; + return [ + { + title: "Install from brew", + setup: "brew install llama.cpp", + content: [serverCommand("llama-server"), cliCommand("llama-cli")], + }, + { + title: "Install from WinGet (Windows)", + setup: "winget install llama.cpp", + content: [serverCommand("llama-server"), cliCommand("llama-cli")], + }, + { + title: "Use pre-built binary", + setup: [ + // prettier-ignore + "# Download pre-built binary from:", + "# https://github.com/ggerganov/llama.cpp/releases", + ].join("\n"), + content: [serverCommand("./llama-server"), cliCommand("./llama-cli")], + }, + { + title: "Build from source code", + setup: [ + "git clone https://github.com/ggerganov/llama.cpp.git", + "cd llama.cpp", + "cmake -B build", + "cmake --build build -j --target llama-server llama-cli", + ].join("\n"), + content: [serverCommand("./build/bin/llama-server"), cliCommand("./build/bin/llama-cli")], + }, + { + title: "Use Docker", + content: snippetDockerModelRunner(model, filepath), + }, + ]; +}; +const snippetNodeLlamaCppCli = (model, filepath) => { + const tagName = getQuantTag(filepath); + return [ + { + title: "Chat with the model", + content: `npx -y node-llama-cpp chat hf:${model.id}${tagName}`, + }, + { + title: "Estimate the model compatibility with your hardware", + content: `npx -y node-llama-cpp inspect estimate hf:${model.id}${tagName}`, + }, + ]; +}; +const snippetOllama = (model, filepath) => { + return `ollama run hf.co/${model.id}${getQuantTag(filepath)}`; +}; +const snippetLocalAI = (model, filepath) => { + const command = (binary) => ["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n"); + return [ + { + title: "Install from binary", + setup: "curl https://localai.io/install.sh | sh", + content: command("local-ai run"), + }, + { + title: "Use Docker images", + setup: [ + // prettier-ignore + "# Pull the image:", + "docker pull localai/localai:latest-cpu", + ].join("\n"), + content: command("docker run -p 8080:8080 --name localai -v $PWD/models:/build/models localai/localai:latest-cpu"), + }, + ]; +}; +const snippetVllm = (model) => { + const messages = (0, inputs_js_1.getModelInputSnippet)(model); + const isMistral = model.tags.includes("mistral-common"); + const mistralFlags = isMistral + ? " --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice" + : ""; + const setup = isMistral + ? [ + "# Install vLLM from pip:", + "pip install vllm", + "# Install mistral-common:", + "pip install --upgrade mistral-common", + ].join("\n") + : ["# Install vLLM from pip:", "pip install vllm"].join("\n"); + const serverCommand = `# Start the vLLM server: +vllm serve "${model.id}"${mistralFlags}`; + const runCommandInstruct = `# Call the server using curl (OpenAI-compatible API): +curl -X POST "http://localhost:8000/v1/chat/completions" \\ + -H "Content-Type: application/json" \\ + --data '{ + "model": "${model.id}", + "messages": ${(0, common_js_1.stringifyMessages)(messages, { + indent: "\t\t", + attributeKeyQuotes: true, + customContentEscaper: (str) => str.replace(/'/g, "'\\''"), + })} + }'`; + const runCommandNonInstruct = `# Call the server using curl (OpenAI-compatible API): +curl -X POST "http://localhost:8000/v1/completions" \\ + -H "Content-Type: application/json" \\ + --data '{ + "model": "${model.id}", + "prompt": "Once upon a time,", + "max_tokens": 512, + "temperature": 0.5 + }'`; + const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct; + return [ + { + title: "Install from pip and serve model", + setup: setup, + content: [serverCommand, runCommand], + }, + { + title: "Use Docker", + content: snippetDockerModelRunner(model), + }, + ]; +}; +const snippetSglang = (model) => { + const messages = (0, inputs_js_1.getModelInputSnippet)(model); + const setup = ["# Install SGLang from pip:", "pip install sglang"].join("\n"); + const serverCommand = `# Start the SGLang server: +python3 -m sglang.launch_server \\ + --model-path "${model.id}" \\ + --host 0.0.0.0 \\ + --port 30000`; + const dockerCommand = `docker run --gpus all \\ + --shm-size 32g \\ + -p 30000:30000 \\ + -v ~/.cache/huggingface:/root/.cache/huggingface \\ + --env "HF_TOKEN=" \\ + --ipc=host \\ + lmsysorg/sglang:latest \\ + python3 -m sglang.launch_server \\ + --model-path "${model.id}" \\ + --host 0.0.0.0 \\ + --port 30000`; + const runCommandInstruct = `# Call the server using curl (OpenAI-compatible API): +curl -X POST "http://localhost:30000/v1/chat/completions" \\ + -H "Content-Type: application/json" \\ + --data '{ + "model": "${model.id}", + "messages": ${(0, common_js_1.stringifyMessages)(messages, { + indent: "\t\t", + attributeKeyQuotes: true, + customContentEscaper: (str) => str.replace(/'/g, "'\\''"), + })} + }'`; + const runCommandNonInstruct = `# Call the server using curl (OpenAI-compatible API): +curl -X POST "http://localhost:30000/v1/completions" \\ + -H "Content-Type: application/json" \\ + --data '{ + "model": "${model.id}", + "prompt": "Once upon a time,", + "max_tokens": 512, + "temperature": 0.5 + }'`; + const runCommand = model.tags.includes("conversational") ? runCommandInstruct : runCommandNonInstruct; + return [ + { + title: "Install from pip and serve model", + setup: setup, + content: [serverCommand, runCommand], + }, + { + title: "Use Docker images", + setup: dockerCommand, + content: [runCommand], + }, + ]; +}; +const snippetTgi = (model) => { + const runCommand = [ + "# Call the server using curl:", + `curl -X POST "http://localhost:8000/v1/chat/completions" \\`, + ` -H "Content-Type: application/json" \\`, + ` --data '{`, + ` "model": "${model.id}",`, + ` "messages": [`, + ` {"role": "user", "content": "What is the capital of France?"}`, + ` ]`, + ` }'`, + ]; + return [ + { + title: "Use Docker images", + setup: [ + "# Deploy with docker on Linux:", + `docker run --gpus all \\`, + ` -v ~/.cache/huggingface:/root/.cache/huggingface \\`, + ` -e HF_TOKEN="" \\`, + ` -p 8000:80 \\`, + ` ghcr.io/huggingface/text-generation-inference:latest \\`, + ` --model-id ${model.id}`, + ].join("\n"), + content: [runCommand.join("\n")], + }, + ]; +}; +const snippetMlxLm = (model) => { + const openaiCurl = [ + "# Calling the OpenAI-compatible server with curl", + `curl -X POST "http://localhost:8000/v1/chat/completions" \\`, + ` -H "Content-Type: application/json" \\`, + ` --data '{`, + ` "model": "${model.id}",`, + ` "messages": [`, + ` {"role": "user", "content": "Hello"}`, + ` ]`, + ` }'`, + ]; + return [ + { + title: "Generate or start a chat session", + setup: ["# Install MLX LM", "uv tool install mlx-lm"].join("\n"), + content: [ + ...(model.tags.includes("conversational") + ? ["# Interactive chat REPL", `mlx_lm.chat --model "${model.id}"`] + : ["# Generate some text", `mlx_lm.generate --model "${model.id}" --prompt "Once upon a time"`]), + ].join("\n"), + }, + ...(model.tags.includes("conversational") + ? [ + { + title: "Run an OpenAI-compatible server", + setup: ["# Install MLX LM", "uv tool install mlx-lm"].join("\n"), + content: ["# Start the server", `mlx_lm.server --model "${model.id}"`, ...openaiCurl].join("\n"), + }, + ] + : []), + ]; +}; +const snippetDockerModelRunner = (model, filepath) => { + // Only add quant tag for GGUF models, not safetensors + const quantTag = isLlamaCppGgufModel(model) ? getQuantTag(filepath) : ""; + return `docker model run hf.co/${model.id}${quantTag}`; +}; +const snippetLemonade = (model, filepath) => { + const tagName = getQuantTag(filepath); + const modelName = model.id.includes("/") ? model.id.split("/")[1] : model.id; + // Get recipe according to model type + let simplifiedModelName; + let recipe; + let checkpoint; + let requirements; + if (model.tags.some((tag) => ["ryzenai-npu", "ryzenai-hybrid"].includes(tag))) { + recipe = model.tags.includes("ryzenai-npu") ? "oga-npu" : "oga-hybrid"; + checkpoint = model.id; + requirements = " (requires RyzenAI 300 series)"; + simplifiedModelName = modelName.split("-awq-")[0]; + simplifiedModelName += recipe === "oga-npu" ? "-NPU" : "-Hybrid"; + } + else { + recipe = "llamacpp"; + checkpoint = `${model.id}${tagName}`; + requirements = ""; + simplifiedModelName = modelName; + } + return [ + { + title: "Pull the model", + setup: "# Download Lemonade from https://lemonade-server.ai/", + content: [ + `lemonade-server pull user.${simplifiedModelName} --checkpoint ${checkpoint} --recipe ${recipe}`, + "# Note: If you installed from source, use the lemonade-server-dev command instead.", + ].join("\n"), + }, + { + title: `Run and chat with the model${requirements}`, + content: `lemonade-server run user.${simplifiedModelName}`, + }, + { + title: "List all available models", + content: "lemonade-server list", + }, + ]; +}; +/** + * Add your new local app here. + * + * This is open to new suggestions and awesome upcoming apps. + * + * /!\ IMPORTANT + * + * If possible, you need to support deeplinks and be as cross-platform as possible. + * + * Ping the HF team if we can help with anything! + */ +exports.LOCAL_APPS = { + "llama.cpp": { + prettyLabel: "llama.cpp", + docsUrl: "https://github.com/ggerganov/llama.cpp", + mainTask: "text-generation", + displayOnModelPage: isLlamaCppGgufModel, + snippet: snippetLlamacpp, + }, + "node-llama-cpp": { + prettyLabel: "node-llama-cpp", + docsUrl: "https://node-llama-cpp.withcat.ai", + mainTask: "text-generation", + displayOnModelPage: isLlamaCppGgufModel, + snippet: snippetNodeLlamaCppCli, + }, + vllm: { + prettyLabel: "vLLM", + docsUrl: "https://docs.vllm.ai", + mainTask: "text-generation", + displayOnModelPage: isVllmModel, + snippet: snippetVllm, + }, + sglang: { + prettyLabel: "SGLang", + docsUrl: "https://docs.sglang.io", + mainTask: "text-generation", + displayOnModelPage: (model) => (isAwqModel(model) || + isGptqModel(model) || + isAqlmModel(model) || + isMarlinModel(model) || + isTransformersModel(model)) && + (model.pipeline_tag === "text-generation" || model.pipeline_tag === "image-text-to-text"), + snippet: snippetSglang, + }, + "mlx-lm": { + prettyLabel: "MLX LM", + docsUrl: "https://github.com/ml-explore/mlx-lm", + mainTask: "text-generation", + displayOnModelPage: (model) => model.pipeline_tag === "text-generation" && isMlxModel(model), + snippet: snippetMlxLm, + }, + tgi: { + prettyLabel: "TGI", + docsUrl: "https://huggingface.co/docs/text-generation-inference/", + mainTask: "text-generation", + displayOnModelPage: isTgiModel, + snippet: snippetTgi, + }, + lmstudio: { + prettyLabel: "LM Studio", + docsUrl: "https://lmstudio.ai", + mainTask: "text-generation", + displayOnModelPage: (model) => isLlamaCppGgufModel(model) || isMlxModel(model), + deeplink: (model, filepath) => new URL(`lmstudio://open_from_hf?model=${model.id}${filepath ? `&file=${filepath}` : ""}`), + }, + localai: { + prettyLabel: "LocalAI", + docsUrl: "https://github.com/mudler/LocalAI", + mainTask: "text-generation", + displayOnModelPage: isLlamaCppGgufModel, + snippet: snippetLocalAI, + }, + jan: { + prettyLabel: "Jan", + docsUrl: "https://jan.ai", + mainTask: "text-generation", + displayOnModelPage: isLlamaCppGgufModel, + deeplink: (model) => new URL(`jan://models/huggingface/${model.id}`), + }, + backyard: { + prettyLabel: "Backyard AI", + docsUrl: "https://backyard.ai", + mainTask: "text-generation", + displayOnModelPage: isLlamaCppGgufModel, + deeplink: (model) => new URL(`https://backyard.ai/hf/model/${model.id}`), + }, + sanctum: { + prettyLabel: "Sanctum", + docsUrl: "https://sanctum.ai", + mainTask: "text-generation", + displayOnModelPage: isLlamaCppGgufModel, + deeplink: (model) => new URL(`sanctum://open_from_hf?model=${model.id}`), + }, + jellybox: { + prettyLabel: "Jellybox", + docsUrl: "https://jellybox.com", + mainTask: "text-generation", + displayOnModelPage: (model) => isLlamaCppGgufModel(model) || + (model.library_name === "diffusers" && + model.tags.includes("safetensors") && + (model.pipeline_tag === "text-to-image" || model.tags.includes("lora"))), + deeplink: (model) => { + if (isLlamaCppGgufModel(model)) { + return new URL(`jellybox://llm/models/huggingface/LLM/${model.id}`); + } + else if (model.tags.includes("lora")) { + return new URL(`jellybox://image/models/huggingface/ImageLora/${model.id}`); + } + else { + return new URL(`jellybox://image/models/huggingface/Image/${model.id}`); + } + }, + }, + msty: { + prettyLabel: "Msty", + docsUrl: "https://msty.app", + mainTask: "text-generation", + displayOnModelPage: isLlamaCppGgufModel, + deeplink: (model) => new URL(`msty://models/search/hf/${model.id}`), + }, + recursechat: { + prettyLabel: "RecurseChat", + docsUrl: "https://recurse.chat", + mainTask: "text-generation", + macOSOnly: true, + displayOnModelPage: isLlamaCppGgufModel, + deeplink: (model) => new URL(`recursechat://new-hf-gguf-model?hf-model-id=${model.id}`), + }, + drawthings: { + prettyLabel: "Draw Things", + docsUrl: "https://drawthings.ai", + mainTask: "text-to-image", + macOSOnly: true, + displayOnModelPage: (model) => model.library_name === "diffusers" && (model.pipeline_tag === "text-to-image" || model.tags.includes("lora")), + deeplink: (model) => { + if (model.tags.includes("lora")) { + return new URL(`https://drawthings.ai/import/diffusers/pipeline.load_lora_weights?repo_id=${model.id}`); + } + else { + return new URL(`https://drawthings.ai/import/diffusers/pipeline.from_pretrained?repo_id=${model.id}`); + } + }, + }, + diffusionbee: { + prettyLabel: "DiffusionBee", + docsUrl: "https://diffusionbee.com", + mainTask: "text-to-image", + macOSOnly: true, + displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image", + deeplink: (model) => new URL(`https://diffusionbee.com/huggingface_import?model_id=${model.id}`), + }, + joyfusion: { + prettyLabel: "JoyFusion", + docsUrl: "https://joyfusion.app", + mainTask: "text-to-image", + macOSOnly: true, + displayOnModelPage: (model) => model.tags.includes("coreml") && model.tags.includes("joyfusion") && model.pipeline_tag === "text-to-image", + deeplink: (model) => new URL(`https://joyfusion.app/import_from_hf?repo_id=${model.id}`), + }, + ollama: { + prettyLabel: "Ollama", + docsUrl: "https://ollama.com", + mainTask: "text-generation", + displayOnModelPage: isLlamaCppGgufModel, + snippet: snippetOllama, + }, + "docker-model-runner": { + prettyLabel: "Docker Model Runner", + docsUrl: "https://docs.docker.com/ai/model-runner/", + mainTask: "text-generation", + displayOnModelPage: isDockerModelRunnerModel, + snippet: snippetDockerModelRunner, + }, + lemonade: { + prettyLabel: "Lemonade", + docsUrl: "https://lemonade-server.ai", + mainTask: "text-generation", + displayOnModelPage: (model) => isLlamaCppGgufModel(model) || isAmdRyzenModel(model), + snippet: snippetLemonade, + }, +}; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b894adb772fca8fe09665082d1611092f3acc156 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=local-apps.spec.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..dc8a5d8f78e2829b7e3a97d27fe96149050c6a7b --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"local-apps.spec.d.ts","sourceRoot":"","sources":["../../src/local-apps.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.js b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..e2284fe14ab3e901ca5fbe3705489726caebedc7 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/local-apps.spec.js @@ -0,0 +1,126 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const vitest_1 = require("vitest"); +const local_apps_js_1 = require("./local-apps.js"); +(0, vitest_1.describe)("local-apps", () => { + (0, vitest_1.it)("llama.cpp conversational", async () => { + const { snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS["llama.cpp"]; + const model = { + id: "bartowski/Llama-3.2-3B-Instruct-GGUF", + tags: ["conversational"], + inference: "", + }; + const snippet = snippetFunc(model); + (0, vitest_1.expect)(snippet[0].content).toEqual([ + `# Start a local OpenAI-compatible server with a web UI: +llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`, + `# Run inference directly in the terminal: +llama-cli -hf bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`, + ]); + }); + (0, vitest_1.it)("llama.cpp non-conversational", async () => { + const { snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS["llama.cpp"]; + const model = { + id: "mlabonne/gemma-2b-GGUF", + tags: [], + inference: "", + }; + const snippet = snippetFunc(model); + (0, vitest_1.expect)(snippet[0].content).toEqual([ + `# Start a local OpenAI-compatible server with a web UI: +llama-server -hf mlabonne/gemma-2b-GGUF:{{QUANT_TAG}}`, + `# Run inference directly in the terminal: +llama-cli -hf mlabonne/gemma-2b-GGUF:{{QUANT_TAG}}`, + ]); + }); + (0, vitest_1.it)("vLLM conversational llm", async () => { + const { snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS["vllm"]; + const model = { + id: "meta-llama/Llama-3.2-3B-Instruct", + pipeline_tag: "text-generation", + tags: ["conversational"], + inference: "", + }; + const snippet = snippetFunc(model); + (0, vitest_1.expect)(snippet[0].content.join("\n")).toEqual(`# Start the vLLM server: +vllm serve "meta-llama/Llama-3.2-3B-Instruct" +# Call the server using curl (OpenAI-compatible API): +curl -X POST "http://localhost:8000/v1/chat/completions" \\ + -H "Content-Type: application/json" \\ + --data '{ + "model": "meta-llama/Llama-3.2-3B-Instruct", + "messages": [ + { + "role": "user", + "content": "What is the capital of France?" + } + ] + }'`); + }); + (0, vitest_1.it)("vLLM non-conversational llm", async () => { + const { snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS["vllm"]; + const model = { + id: "meta-llama/Llama-3.2-3B", + tags: [""], + inference: "", + }; + const snippet = snippetFunc(model); + (0, vitest_1.expect)(snippet[0].content.join("\n")).toEqual(`# Start the vLLM server: +vllm serve "meta-llama/Llama-3.2-3B" +# Call the server using curl (OpenAI-compatible API): +curl -X POST "http://localhost:8000/v1/completions" \\ + -H "Content-Type: application/json" \\ + --data '{ + "model": "meta-llama/Llama-3.2-3B", + "prompt": "Once upon a time,", + "max_tokens": 512, + "temperature": 0.5 + }'`); + }); + (0, vitest_1.it)("vLLM conversational vlm", async () => { + const { snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS["vllm"]; + const model = { + id: "meta-llama/Llama-3.2-11B-Vision-Instruct", + pipeline_tag: "image-text-to-text", + tags: ["conversational"], + inference: "", + }; + const snippet = snippetFunc(model); + (0, vitest_1.expect)(snippet[0].content.join("\n")).toEqual(`# Start the vLLM server: +vllm serve "meta-llama/Llama-3.2-11B-Vision-Instruct" +# Call the server using curl (OpenAI-compatible API): +curl -X POST "http://localhost:8000/v1/chat/completions" \\ + -H "Content-Type: application/json" \\ + --data '{ + "model": "meta-llama/Llama-3.2-11B-Vision-Instruct", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "Describe this image in one sentence." + }, + { + "type": "image_url", + "image_url": { + "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" + } + } + ] + } + ] + }'`); + }); + (0, vitest_1.it)("docker model runner", async () => { + const { snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS["docker-model-runner"]; + const model = { + id: "bartowski/Llama-3.2-3B-Instruct-GGUF", + tags: ["conversational"], + gguf: { total: 1, context_length: 4096 }, + inference: "", + }; + const snippet = snippetFunc(model); + (0, vitest_1.expect)(snippet).toEqual(`docker model run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`); + }); +}); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/model-data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6f47e9e8338b5525b236ea8d48626d44f80639d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-data.d.ts @@ -0,0 +1,153 @@ +import type { PipelineType } from "./pipelines.js"; +import type { WidgetExample } from "./widget-example.js"; +import type { TokenizerConfig } from "./tokenizer-data.js"; +/** + * Public interface for model metadata + */ +export interface ModelData { + /** + * id of model (e.g. 'user/repo_name') + */ + id: string; + /** + * Whether or not to enable inference widget for this model + * TODO(type it) + */ + inference: string; + /** + * is this model private? + */ + private?: boolean; + /** + * this dictionary has useful information about the model configuration + */ + config?: { + architectures?: string[]; + /** + * Dict of AutoModel or Auto… class name to local import path in the repo + */ + auto_map?: { + /** + * String Property + */ + [x: string]: string; + }; + model_type?: string; + quantization_config?: { + bits?: number; + load_in_4bit?: boolean; + load_in_8bit?: boolean; + /** + * awq, gptq, aqlm, marlin, … Used by vLLM + */ + quant_method?: string; + }; + tokenizer_config?: TokenizerConfig; + processor_config?: { + chat_template?: string; + }; + chat_template_jinja?: string; + adapter_transformers?: { + model_name?: string; + model_class?: string; + }; + diffusers?: { + _class_name?: string; + }; + sklearn?: { + model?: { + file?: string; + }; + model_format?: string; + }; + speechbrain?: { + speechbrain_interface?: string; + vocoder_interface?: string; + vocoder_model_id?: string; + }; + peft?: { + base_model_name_or_path?: string; + task_type?: string; + }; + keras_hub?: { + tasks?: string[]; + }; + }; + /** + * all the model tags + */ + tags: string[]; + /** + * transformers-specific info to display in the code sample. + */ + transformersInfo?: TransformersInfo; + /** + * Pipeline type + */ + pipeline_tag?: PipelineType | undefined; + /** + * for relevant models, get mask token + */ + mask_token?: string | undefined; + /** + * Example data that will be fed into the widget. + * + * can be set in the model card metadata (under `widget`), + * or by default in `DefaultWidget.ts` + */ + widgetData?: WidgetExample[] | undefined; + /** + * Parameters that will be used by the widget when calling Inference API (serverless) + * https://huggingface.co/docs/api-inference/detailed_parameters + * + * can be set in the model card metadata (under `inference/parameters`) + * Example: + * inference: + * parameters: + * key: val + */ + cardData?: { + inference?: boolean | { + parameters?: Record; + }; + base_model?: string | string[]; + instance_prompt?: string | null; + }; + /** + * Library name + * Example: transformers, SpeechBrain, Stanza, etc. + */ + library_name?: string; + safetensors?: { + parameters: Record; + total: number; + sharded: boolean; + }; + gguf?: { + total: number; + architecture?: string; + context_length?: number; + }; +} +/** + * transformers-specific info to display in the code sample. + */ +export interface TransformersInfo { + /** + * e.g. AutoModelForSequenceClassification + */ + auto_model: string; + /** + * if set in config.json's auto_map + */ + custom_class?: string; + /** + * e.g. text-classification + */ + pipeline_tag?: PipelineType; + /** + * e.g. "AutoTokenizer" | "AutoFeatureExtractor" | "AutoProcessor" + */ + processor?: string; +} +//# sourceMappingURL=model-data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/model-data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..32013744b0b1191db6f0d60a34969368dd52bb1b --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"model-data.d.ts","sourceRoot":"","sources":["../../src/model-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE;QACR,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB;;WAEG;QACH,QAAQ,CAAC,EAAE;YACV;;eAEG;YACH,CAAC,CA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,GAAG,SAAS,CAAC;IACxC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IACzC;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE;QACV,SAAS,CAAC,EACP,OAAO,GACP;YACA,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SACpC,CAAC;QACL,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC/B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAChC,CAAC;IACF;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE;QACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;KACjB,CAAC;IACF,IAAI,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-data.js b/node_modules/@huggingface/tasks/dist/commonjs/model-data.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-data.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2068624044fa42a89cd7889633465fa802c9ac71 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.d.ts @@ -0,0 +1,18 @@ +/** + * This file contains the (simplified) types used + * to represent queries that are made to Elastic + * in order to count number of model downloads + * + * Read this doc about download stats on the Hub: + * + * https://huggingface.co/docs/hub/models-download-stats + * Available fields: + * - path: the complete file path (relative) (e.g: "prefix/file.extension") + * - path_prefix: the prefix of the file path (e.g: "prefix/", empty if no prefix) + * - path_extension: the extension of the file path (e.g: "extension") + * - path_filename: the name of the file path (e.g: "file") + * see also: + * https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html + */ +export type ElasticSearchQuery = string; +//# sourceMappingURL=model-libraries-downloads.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..f0a63c2eda1c1650a18fb8060e9cf6fb53c7c272 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"model-libraries-downloads.d.ts","sourceRoot":"","sources":["../../src/model-libraries-downloads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.js b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.js new file mode 100644 index 0000000000000000000000000000000000000000..4302a1ec670e4500a6a71f2dd5dd7f14582d40ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-downloads.js @@ -0,0 +1,18 @@ +"use strict"; +/** + * This file contains the (simplified) types used + * to represent queries that are made to Elastic + * in order to count number of model downloads + * + * Read this doc about download stats on the Hub: + * + * https://huggingface.co/docs/hub/models-download-stats + * Available fields: + * - path: the complete file path (relative) (e.g: "prefix/file.extension") + * - path_prefix: the prefix of the file path (e.g: "prefix/", empty if no prefix) + * - path_extension: the extension of the file path (e.g: "extension") + * - path_filename: the name of the file path (e.g: "file") + * see also: + * https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html + */ +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40352519b23b773f90d9391050a292f317c10b26 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.d.ts @@ -0,0 +1,113 @@ +import type { ModelData } from "./model-data.js"; +export declare const adapters: (model: ModelData) => string[]; +export declare const allennlp: (model: ModelData) => string[]; +export declare const araclip: (model: ModelData) => string[]; +export declare const asteroid: (model: ModelData) => string[]; +export declare const audioseal: (model: ModelData) => string[]; +export declare const ben2: (model: ModelData) => string[]; +export declare const bertopic: (model: ModelData) => string[]; +export declare const bm25s: (model: ModelData) => string[]; +export declare const chatterbox: () => string[]; +export declare const chronos_forecasting: (model: ModelData) => string[]; +export declare const colipri: (model: ModelData) => string[]; +export declare const sap_rpt_one_oss: () => string[]; +export declare const cxr_foundation: () => string[]; +export declare const depth_anything_v2: (model: ModelData) => string[]; +export declare const depth_pro: (model: ModelData) => string[]; +export declare const derm_foundation: () => string[]; +export declare const dia: (model: ModelData) => string[]; +export declare const dia2: (model: ModelData) => string[]; +export declare const describe_anything: (model: ModelData) => string[]; +export declare const diffusers: (model: ModelData) => string[]; +export declare const diffusionkit: (model: ModelData) => string[]; +export declare const cartesia_pytorch: (model: ModelData) => string[]; +export declare const cartesia_mlx: (model: ModelData) => string[]; +export declare const edsnlp: (model: ModelData) => string[]; +export declare const espnetTTS: (model: ModelData) => string[]; +export declare const espnetASR: (model: ModelData) => string[]; +export declare const espnet: (model: ModelData) => string[]; +export declare const fairseq: (model: ModelData) => string[]; +export declare const flair: (model: ModelData) => string[]; +export declare const gliner: (model: ModelData) => string[]; +export declare const gliner2: (model: ModelData) => string[]; +export declare const indextts: (model: ModelData) => string[]; +export declare const htrflow: (model: ModelData) => string[]; +export declare const keras: (model: ModelData) => string[]; +export declare const keras_hub: (model: ModelData) => string[]; +export declare const kernels: (model: ModelData) => string[]; +export declare const kimi_audio: (model: ModelData) => string[]; +export declare const kittentts: (model: ModelData) => string[]; +export declare const lightning_ir: (model: ModelData) => string[]; +export declare const llama_cpp_python: (model: ModelData) => string[]; +export declare const lerobot: (model: ModelData) => string[]; +export declare const tf_keras: (model: ModelData) => string[]; +export declare const mamba_ssm: (model: ModelData) => string[]; +export declare const mars5_tts: (model: ModelData) => string[]; +export declare const matanyone: (model: ModelData) => string[]; +export declare const mesh_anything: () => string[]; +export declare const open_clip: (model: ModelData) => string[]; +export declare const paddlenlp: (model: ModelData) => string[]; +export declare const paddleocr: (model: ModelData) => string[]; +export declare const perception_encoder: (model: ModelData) => string[]; +export declare const phantom_wan: (model: ModelData) => string[]; +export declare const pocket_tts: (model: ModelData) => string[]; +export declare const pyannote_audio_pipeline: (model: ModelData) => string[]; +export declare const pyannote_audio: (model: ModelData) => string[]; +export declare const relik: (model: ModelData) => string[]; +export declare const renderformer: (model: ModelData) => string[]; +export declare const tensorflowtts: (model: ModelData) => string[]; +export declare const timm: (model: ModelData) => string[]; +export declare const saelens: () => string[]; +export declare const seed_story: () => string[]; +export declare const sklearn: (model: ModelData) => string[]; +export declare const stable_audio_tools: (model: ModelData) => string[]; +export declare const fastai: (model: ModelData) => string[]; +export declare const sam2: (model: ModelData) => string[]; +export declare const sam_3d_objects: (model: ModelData) => string[]; +export declare const sam_3d_body: (model: ModelData) => string[]; +export declare const sampleFactory: (model: ModelData) => string[]; +export declare const sentenceTransformers: (model: ModelData) => string[]; +export declare const setfit: (model: ModelData) => string[]; +export declare const spacy: (model: ModelData) => string[]; +export declare const span_marker: (model: ModelData) => string[]; +export declare const stanza: (model: ModelData) => string[]; +export declare const speechbrain: (model: ModelData) => string[]; +export declare const terratorch: (model: ModelData) => string[]; +export declare const transformers: (model: ModelData) => string[]; +export declare const transformersJS: (model: ModelData) => string[]; +export declare const peft: (model: ModelData) => string[]; +export declare const fasttext: (model: ModelData) => string[]; +export declare const stableBaselines3: (model: ModelData) => string[]; +export declare const mlAgents: (model: ModelData) => string[]; +export declare const sentis: () => string[]; +export declare const sana: (model: ModelData) => string[]; +export declare const vibevoice: (model: ModelData) => string[]; +export declare const videoprism: (model: ModelData) => string[]; +export declare const vfimamba: (model: ModelData) => string[]; +export declare const lvface: (model: ModelData) => string[]; +export declare const voicecraft: (model: ModelData) => string[]; +export declare const voxcpm: (model: ModelData) => string[]; +export declare const vui: () => string[]; +export declare const chattts: () => string[]; +export declare const ultralytics: (model: ModelData) => string[]; +export declare const birefnet: (model: ModelData) => string[]; +export declare const supertonic: () => string[]; +export declare const swarmformer: (model: ModelData) => string[]; +export declare const univa: (model: ModelData) => string[]; +export declare const mlxim: (model: ModelData) => string[]; +export declare const mlx: (model: ModelData) => string[]; +export declare const model2vec: (model: ModelData) => string[]; +export declare const pruna: (model: ModelData) => string[]; +export declare const nemo: (model: ModelData) => string[]; +export declare const outetts: (model: ModelData) => string[]; +export declare const pxia: (model: ModelData) => string[]; +export declare const pythae: (model: ModelData) => string[]; +export declare const qwen3_tts: (model: ModelData) => string[]; +export declare const anemoi: (model: ModelData) => string[]; +export declare const audiocraft: (model: ModelData) => string[]; +export declare const whisperkit: () => string[]; +export declare const threedtopia_xl: (model: ModelData) => string[]; +export declare const hezar: (model: ModelData) => string[]; +export declare const zonos: (model: ModelData) => string[]; +export declare const moshi: (model: ModelData) => string[]; +//# sourceMappingURL=model-libraries-snippets.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..56312f57de93f434f8f74e80ebee737de323b8cd --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"model-libraries-snippets.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAkBjD,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAKjD,CAAC;AAkBF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAKjD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,KAAG,MAAM,EAIhD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,KAAG,MAAM,EAkBlD,CAAC;AAaF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,KAAG,MAAM,EAY7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,KAAG,MAAM,EAIjD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,MAAM,EAenC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,SAAS,KAAG,MAAM,EAsB5D,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,SAAS,KAAG,MAAM,EAkBhD,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,MAAM,EAmDxC,CAAC;AAEF,eAAO,MAAM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,eAAO,MAAM,UAAU,GAAI,OAAO,SAAS,KAAG,MAAM,EAUnD,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,MAAM,EAYnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,SAAS,KAAG,MAAM,EAKvD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAI9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAiB9C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,SAAS,KAAG,MAAM,EAgD9C,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.js b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.js new file mode 100644 index 0000000000000000000000000000000000000000..d244a3329a991622be9c971f4023d92a61519f31 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.js @@ -0,0 +1,2311 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.perception_encoder = exports.paddleocr = exports.paddlenlp = exports.open_clip = exports.mesh_anything = exports.matanyone = exports.mars5_tts = exports.mamba_ssm = exports.tf_keras = exports.lerobot = exports.llama_cpp_python = exports.lightning_ir = exports.kittentts = exports.kimi_audio = exports.kernels = exports.keras_hub = exports.keras = exports.htrflow = exports.indextts = exports.gliner2 = exports.gliner = exports.flair = exports.fairseq = exports.espnet = exports.espnetASR = exports.espnetTTS = exports.edsnlp = exports.cartesia_mlx = exports.cartesia_pytorch = exports.diffusionkit = exports.diffusers = exports.describe_anything = exports.dia2 = exports.dia = exports.derm_foundation = exports.depth_pro = exports.depth_anything_v2 = exports.cxr_foundation = exports.sap_rpt_one_oss = exports.colipri = exports.chronos_forecasting = exports.chatterbox = exports.bm25s = exports.bertopic = exports.ben2 = exports.audioseal = exports.asteroid = exports.araclip = exports.allennlp = exports.adapters = void 0; +exports.nemo = exports.pruna = exports.model2vec = exports.mlx = exports.mlxim = exports.univa = exports.swarmformer = exports.supertonic = exports.birefnet = exports.ultralytics = exports.chattts = exports.vui = exports.voxcpm = exports.voicecraft = exports.lvface = exports.vfimamba = exports.videoprism = exports.vibevoice = exports.sana = exports.sentis = exports.mlAgents = exports.stableBaselines3 = exports.fasttext = exports.peft = exports.transformersJS = exports.transformers = exports.terratorch = exports.speechbrain = exports.stanza = exports.span_marker = exports.spacy = exports.setfit = exports.sentenceTransformers = exports.sampleFactory = exports.sam_3d_body = exports.sam_3d_objects = exports.sam2 = exports.fastai = exports.stable_audio_tools = exports.sklearn = exports.seed_story = exports.saelens = exports.timm = exports.tensorflowtts = exports.renderformer = exports.relik = exports.pyannote_audio = exports.pyannote_audio_pipeline = exports.pocket_tts = exports.phantom_wan = void 0; +exports.moshi = exports.zonos = exports.hezar = exports.threedtopia_xl = exports.whisperkit = exports.audiocraft = exports.anemoi = exports.qwen3_tts = exports.pythae = exports.pxia = exports.outetts = void 0; +const library_to_tasks_js_1 = require("./library-to-tasks.js"); +const inputs_js_1 = require("./snippets/inputs.js"); +const common_js_1 = require("./snippets/common.js"); +const TAG_CUSTOM_CODE = "custom_code"; +function nameWithoutNamespace(modelId) { + const splitted = modelId.split("/"); + return splitted.length === 1 ? splitted[0] : splitted[1]; +} +const escapeStringForJson = (str) => JSON.stringify(str).slice(1, -1); // slice is needed to remove surrounding quotes added by JSON.stringify +//#region snippets +const adapters = (model) => [ + `from adapters import AutoAdapterModel + +model = AutoAdapterModel.from_pretrained("${model.config?.adapter_transformers?.model_name}") +model.load_adapter("${model.id}", set_active=True)`, +]; +exports.adapters = adapters; +const allennlpUnknown = (model) => [ + `import allennlp_models +from allennlp.predictors.predictor import Predictor + +predictor = Predictor.from_path("hf://${model.id}")`, +]; +const allennlpQuestionAnswering = (model) => [ + `import allennlp_models +from allennlp.predictors.predictor import Predictor + +predictor = Predictor.from_path("hf://${model.id}") +predictor_input = {"passage": "My name is Wolfgang and I live in Berlin", "question": "Where do I live?"} +predictions = predictor.predict_json(predictor_input)`, +]; +const allennlp = (model) => { + if (model.tags.includes("question-answering")) { + return allennlpQuestionAnswering(model); + } + return allennlpUnknown(model); +}; +exports.allennlp = allennlp; +const araclip = (model) => [ + `from araclip import AraClip + +model = AraClip.from_pretrained("${model.id}")`, +]; +exports.araclip = araclip; +const asteroid = (model) => [ + `from asteroid.models import BaseModel + +model = BaseModel.from_pretrained("${model.id}")`, +]; +exports.asteroid = asteroid; +const audioseal = (model) => { + const watermarkSnippet = `# Watermark Generator +from audioseal import AudioSeal + +model = AudioSeal.load_generator("${model.id}") +# pass a tensor (tensor_wav) of shape (batch, channels, samples) and a sample rate +wav, sr = tensor_wav, 16000 + +watermark = model.get_watermark(wav, sr) +watermarked_audio = wav + watermark`; + const detectorSnippet = `# Watermark Detector +from audioseal import AudioSeal + +detector = AudioSeal.load_detector("${model.id}") + +result, message = detector.detect_watermark(watermarked_audio, sr)`; + return [watermarkSnippet, detectorSnippet]; +}; +exports.audioseal = audioseal; +function get_base_diffusers_model(model) { + return model.cardData?.base_model?.toString() ?? "fill-in-base-model"; +} +function get_prompt_from_diffusers_model(model) { + const prompt = model.widgetData?.[0]?.text ?? model.cardData?.instance_prompt; + if (prompt) { + return escapeStringForJson(prompt); + } +} +const ben2 = (model) => [ + `import requests +from PIL import Image +from ben2 import AutoModel + +url = "https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg" +image = Image.open(requests.get(url, stream=True).raw) + +model = AutoModel.from_pretrained("${model.id}") +model.to("cuda").eval() +foreground = model.inference(image) +`, +]; +exports.ben2 = ben2; +const bertopic = (model) => [ + `from bertopic import BERTopic + +model = BERTopic.load("${model.id}")`, +]; +exports.bertopic = bertopic; +const bm25s = (model) => [ + `from bm25s.hf import BM25HF + +retriever = BM25HF.load_from_hub("${model.id}")`, +]; +exports.bm25s = bm25s; +const chatterbox = () => [ + `# pip install chatterbox-tts +import torchaudio as ta +from chatterbox.tts import ChatterboxTTS + +model = ChatterboxTTS.from_pretrained(device="cuda") + +text = "Ezreal and Jinx teamed up with Ahri, Yasuo, and Teemo to take down the enemy's Nexus in an epic late-game pentakill." +wav = model.generate(text) +ta.save("test-1.wav", wav, model.sr) + +# If you want to synthesize with a different voice, specify the audio prompt +AUDIO_PROMPT_PATH="YOUR_FILE.wav" +wav = model.generate(text, audio_prompt_path=AUDIO_PROMPT_PATH) +ta.save("test-2.wav", wav, model.sr)`, +]; +exports.chatterbox = chatterbox; +const chronos_forecasting = (model) => { + const installSnippet = `pip install chronos-forecasting`; + const exampleSnippet = `import pandas as pd +from chronos import BaseChronosPipeline + +pipeline = BaseChronosPipeline.from_pretrained("${model.id}", device_map="cuda") + +# Load historical data +context_df = pd.read_csv("https://autogluon.s3.us-west-2.amazonaws.com/datasets/timeseries/misc/AirPassengers.csv") + +# Generate predictions +pred_df = pipeline.predict_df( + context_df, + prediction_length=36, # Number of steps to forecast + quantile_levels=[0.1, 0.5, 0.9], # Quantiles for probabilistic forecast + id_column="item_id", # Column identifying different time series + timestamp_column="Month", # Column with datetime information + target="#Passengers", # Column(s) with time series values to predict +)`; + return [installSnippet, exampleSnippet]; +}; +exports.chronos_forecasting = chronos_forecasting; +const colipri = (model) => { + const installSnippet = `pip install colipri`; + const exampleSnippet = `from colipri import get_model +from colipri import get_processor +from colipri import load_sample_ct +from colipri import ZeroShotImageClassificationPipeline + +model = get_model().cuda() +processor = get_processor() +pipeline = ZeroShotImageClassificationPipeline("${model.id}", processor) + +image = load_sample_ct() + +pipeline(image, ["No lung nodules", "Lung nodules"]) +`; + return [installSnippet, exampleSnippet]; +}; +exports.colipri = colipri; +const sap_rpt_one_oss = () => { + const installSnippet = `pip install git+https://github.com/SAP-samples/sap-rpt-1-oss`; + const classificationSnippet = `# Run a classification task +from sklearn.datasets import load_breast_cancer +from sklearn.metrics import accuracy_score +from sklearn.model_selection import train_test_split + +from sap_rpt_oss import SAP_RPT_OSS_Classifier + +# Load sample data +X, y = load_breast_cancer(return_X_y=True) +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42) + +# Initialize a classifier, 8k context and 8-fold bagging gives best performance, reduce if running out of memory +clf = SAP_RPT_OSS_Classifier(max_context_size=8192, bagging=8) + +clf.fit(X_train, y_train) + +# Predict probabilities +prediction_probabilities = clf.predict_proba(X_test) +# Predict labels +predictions = clf.predict(X_test) +print("Accuracy", accuracy_score(y_test, predictions))`; + const regressionsSnippet = `# Run a regression task +from sklearn.datasets import fetch_openml +from sklearn.metrics import r2_score +from sklearn.model_selection import train_test_split + +from sap_rpt_oss import SAP_RPT_OSS_Regressor + +# Load sample data +df = fetch_openml(data_id=531, as_frame=True) +X = df.data +y = df.target.astype(float) + +# Train-test split +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42) + +# Initialize the regressor, 8k context and 8-fold bagging gives best performance, reduce if running out of memory +regressor = SAP_RPT_OSS_Regressor(max_context_size=8192, bagging=8) + +regressor.fit(X_train, y_train) + +# Predict on the test set +predictions = regressor.predict(X_test) + +r2 = r2_score(y_test, predictions) +print("R² Score:", r2)`; + return [installSnippet, classificationSnippet, regressionsSnippet]; +}; +exports.sap_rpt_one_oss = sap_rpt_one_oss; +const cxr_foundation = () => [ + `# pip install git+https://github.com/Google-Health/cxr-foundation.git#subdirectory=python + +# Load image as grayscale (Stillwaterising, CC0, via Wikimedia Commons) +import requests +from PIL import Image +from io import BytesIO +image_url = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Chest_Xray_PA_3-8-2010.png" +img = Image.open(requests.get(image_url, headers={'User-Agent': 'Demo'}, stream=True).raw).convert('L') + +# Run inference +from clientside.clients import make_hugging_face_client +cxr_client = make_hugging_face_client('cxr_model') +print(cxr_client.get_image_embeddings_from_images([img]))`, +]; +exports.cxr_foundation = cxr_foundation; +const depth_anything_v2 = (model) => { + let encoder; + let features; + let out_channels; + encoder = ""; + features = ""; + out_channels = ""; + if (model.id === "depth-anything/Depth-Anything-V2-Small") { + encoder = "vits"; + features = "64"; + out_channels = "[48, 96, 192, 384]"; + } + else if (model.id === "depth-anything/Depth-Anything-V2-Base") { + encoder = "vitb"; + features = "128"; + out_channels = "[96, 192, 384, 768]"; + } + else if (model.id === "depth-anything/Depth-Anything-V2-Large") { + encoder = "vitl"; + features = "256"; + out_channels = "[256, 512, 1024, 1024"; + } + return [ + ` +# Install from https://github.com/DepthAnything/Depth-Anything-V2 + +# Load the model and infer depth from an image +import cv2 +import torch + +from depth_anything_v2.dpt import DepthAnythingV2 + +# instantiate the model +model = DepthAnythingV2(encoder="${encoder}", features=${features}, out_channels=${out_channels}) + +# load the weights +filepath = hf_hub_download(repo_id="${model.id}", filename="depth_anything_v2_${encoder}.pth", repo_type="model") +state_dict = torch.load(filepath, map_location="cpu") +model.load_state_dict(state_dict).eval() + +raw_img = cv2.imread("your/image/path") +depth = model.infer_image(raw_img) # HxW raw depth map in numpy + `, + ]; +}; +exports.depth_anything_v2 = depth_anything_v2; +const depth_pro = (model) => { + const installSnippet = `# Download checkpoint +pip install huggingface-hub +huggingface-cli download --local-dir checkpoints ${model.id}`; + const inferenceSnippet = `import depth_pro + +# Load model and preprocessing transform +model, transform = depth_pro.create_model_and_transforms() +model.eval() + +# Load and preprocess an image. +image, _, f_px = depth_pro.load_rgb("example.png") +image = transform(image) + +# Run inference. +prediction = model.infer(image, f_px=f_px) + +# Results: 1. Depth in meters +depth = prediction["depth"] +# Results: 2. Focal length in pixels +focallength_px = prediction["focallength_px"]`; + return [installSnippet, inferenceSnippet]; +}; +exports.depth_pro = depth_pro; +const derm_foundation = () => [ + `from huggingface_hub import from_pretrained_keras +import tensorflow as tf, requests + +# Load and format input +IMAGE_URL = "https://storage.googleapis.com/dx-scin-public-data/dataset/images/3445096909671059178.png" +input_tensor = tf.train.Example( + features=tf.train.Features( + feature={ + "image/encoded": tf.train.Feature( + bytes_list=tf.train.BytesList(value=[requests.get(IMAGE_URL, stream=True).content]) + ) + } + ) +).SerializeToString() + +# Load model and run inference +loaded_model = from_pretrained_keras("google/derm-foundation") +infer = loaded_model.signatures["serving_default"] +print(infer(inputs=tf.constant([input_tensor])))`, +]; +exports.derm_foundation = derm_foundation; +const dia = (model) => [ + `import soundfile as sf +from dia.model import Dia + +model = Dia.from_pretrained("${model.id}") +text = "[S1] Dia is an open weights text to dialogue model. [S2] You get full control over scripts and voices. [S1] Wow. Amazing. (laughs) [S2] Try it now on Git hub or Hugging Face." +output = model.generate(text) + +sf.write("simple.mp3", output, 44100)`, +]; +exports.dia = dia; +const dia2 = (model) => [ + `from dia2 import Dia2, GenerationConfig, SamplingConfig + +dia = Dia2.from_repo("${model.id}", device="cuda", dtype="bfloat16") +config = GenerationConfig( + cfg_scale=2.0, + audio=SamplingConfig(temperature=0.8, top_k=50), + use_cuda_graph=True, +) +result = dia.generate("[S1] Hello Dia2!", config=config, output_wav="hello.wav", verbose=True) +`, +]; +exports.dia2 = dia2; +const describe_anything = (model) => [ + `# pip install git+https://github.com/NVlabs/describe-anything +from huggingface_hub import snapshot_download +from dam import DescribeAnythingModel + +snapshot_download(${model.id}, local_dir="checkpoints") + +dam = DescribeAnythingModel( + model_path="checkpoints", + conv_mode="v1", + prompt_mode="focal_prompt", +)`, +]; +exports.describe_anything = describe_anything; +const diffusers_install = "pip install -U diffusers transformers accelerate"; +const diffusersDefaultPrompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"; +const diffusersImg2ImgDefaultPrompt = "Turn this cat into a dog"; +const diffusersVideoDefaultPrompt = "A man with short gray hair plays a red electric guitar."; +const diffusers_default = (model) => [ + `import torch +from diffusers import DiffusionPipeline + +# switch to "mps" for apple devices +pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda") + +prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}" +image = pipe(prompt).images[0]`, +]; +const diffusers_image_to_image = (model) => [ + `import torch +from diffusers import DiffusionPipeline +from diffusers.utils import load_image + +# switch to "mps" for apple devices +pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda") + +prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}" +input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") + +image = pipe(image=input_image, prompt=prompt).images[0]`, +]; +const diffusers_image_to_video = (model) => [ + `import torch +from diffusers import DiffusionPipeline +from diffusers.utils import load_image, export_to_video + +# switch to "mps" for apple devices +pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda") +pipe.to("cuda") + +prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}" +image = load_image( + "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" +) + +output = pipe(image=image, prompt=prompt).frames[0] +export_to_video(output, "output.mp4")`, +]; +const diffusers_controlnet = (model) => [ + `from diffusers import ControlNetModel, StableDiffusionControlNetPipeline + +controlnet = ControlNetModel.from_pretrained("${model.id}") +pipe = StableDiffusionControlNetPipeline.from_pretrained( + "${get_base_diffusers_model(model)}", controlnet=controlnet +)`, +]; +const diffusers_lora = (model) => [ + `import torch +from diffusers import DiffusionPipeline + +# switch to "mps" for apple devices +pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda") +pipe.load_lora_weights("${model.id}") + +prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}" +image = pipe(prompt).images[0]`, +]; +const diffusers_lora_image_to_image = (model) => [ + `import torch +from diffusers import DiffusionPipeline +from diffusers.utils import load_image + +# switch to "mps" for apple devices +pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda") +pipe.load_lora_weights("${model.id}") + +prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}" +input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") + +image = pipe(image=input_image, prompt=prompt).images[0]`, +]; +const diffusers_lora_text_to_video = (model) => [ + `import torch +from diffusers import DiffusionPipeline +from diffusers.utils import export_to_video + +# switch to "mps" for apple devices +pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda") +pipe.load_lora_weights("${model.id}") + +prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}" + +output = pipe(prompt=prompt).frames[0] +export_to_video(output, "output.mp4")`, +]; +const diffusers_lora_image_to_video = (model) => [ + `import torch +from diffusers import DiffusionPipeline +from diffusers.utils import load_image, export_to_video + +# switch to "mps" for apple devices +pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda") +pipe.load_lora_weights("${model.id}") + +prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}" +input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png") + +image = pipe(image=input_image, prompt=prompt).frames[0] +export_to_video(output, "output.mp4")`, +]; +const diffusers_textual_inversion = (model) => [ + `import torch +from diffusers import DiffusionPipeline + +# switch to "mps" for apple devices +pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda") +pipe.load_textual_inversion("${model.id}")`, +]; +const diffusers_flux_fill = (model) => [ + `import torch +from diffusers import FluxFillPipeline +from diffusers.utils import load_image + +image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png") +mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png") + +# switch to "mps" for apple devices +pipe = FluxFillPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda") +image = pipe( + prompt="a white paper cup", + image=image, + mask_image=mask, + height=1632, + width=1232, + guidance_scale=30, + num_inference_steps=50, + max_sequence_length=512, + generator=torch.Generator("cpu").manual_seed(0) +).images[0] +image.save(f"flux-fill-dev.png")`, +]; +const diffusers_inpainting = (model) => [ + `import torch +from diffusers import AutoPipelineForInpainting +from diffusers.utils import load_image + +# switch to "mps" for apple devices +pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", dtype=torch.float16, variant="fp16", device_map="cuda") + +img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" +mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" + +image = load_image(img_url).resize((1024, 1024)) +mask_image = load_image(mask_url).resize((1024, 1024)) + +prompt = "a tiger sitting on a park bench" +generator = torch.Generator(device="cuda").manual_seed(0) + +image = pipe( + prompt=prompt, + image=image, + mask_image=mask_image, + guidance_scale=8.0, + num_inference_steps=20, # steps between 15 and 30 work well for us + strength=0.99, # make sure to use \`strength\` below 1.0 + generator=generator, +).images[0]`, +]; +const diffusers = (model) => { + let codeSnippets; + if (model.tags.includes("StableDiffusionInpaintPipeline") || + model.tags.includes("StableDiffusionXLInpaintPipeline")) { + codeSnippets = diffusers_inpainting(model); + } + else if (model.tags.includes("controlnet")) { + codeSnippets = diffusers_controlnet(model); + } + else if (model.tags.includes("lora")) { + if (model.pipeline_tag === "image-to-image") { + codeSnippets = diffusers_lora_image_to_image(model); + } + else if (model.pipeline_tag === "image-to-video") { + codeSnippets = diffusers_lora_image_to_video(model); + } + else if (model.pipeline_tag === "text-to-video") { + codeSnippets = diffusers_lora_text_to_video(model); + } + else { + codeSnippets = diffusers_lora(model); + } + } + else if (model.tags.includes("textual_inversion")) { + codeSnippets = diffusers_textual_inversion(model); + } + else if (model.tags.includes("FluxFillPipeline")) { + codeSnippets = diffusers_flux_fill(model); + } + else if (model.pipeline_tag === "image-to-video") { + codeSnippets = diffusers_image_to_video(model); + } + else if (model.pipeline_tag === "image-to-image") { + codeSnippets = diffusers_image_to_image(model); + } + else { + codeSnippets = diffusers_default(model); + } + return [diffusers_install, ...codeSnippets]; +}; +exports.diffusers = diffusers; +const diffusionkit = (model) => { + const sd3Snippet = `# Pipeline for Stable Diffusion 3 +from diffusionkit.mlx import DiffusionPipeline + +pipeline = DiffusionPipeline( + shift=3.0, + use_t5=False, + model_version=${model.id}, + low_memory_mode=True, + a16=True, + w16=True, +)`; + const fluxSnippet = `# Pipeline for Flux +from diffusionkit.mlx import FluxPipeline + +pipeline = FluxPipeline( + shift=1.0, + model_version=${model.id}, + low_memory_mode=True, + a16=True, + w16=True, +)`; + const generateSnippet = `# Image Generation +HEIGHT = 512 +WIDTH = 512 +NUM_STEPS = ${model.tags.includes("flux") ? 4 : 50} +CFG_WEIGHT = ${model.tags.includes("flux") ? 0 : 5} + +image, _ = pipeline.generate_image( + "a photo of a cat", + cfg_weight=CFG_WEIGHT, + num_steps=NUM_STEPS, + latent_size=(HEIGHT // 8, WIDTH // 8), +)`; + const pipelineSnippet = model.tags.includes("flux") ? fluxSnippet : sd3Snippet; + return [pipelineSnippet, generateSnippet]; +}; +exports.diffusionkit = diffusionkit; +const cartesia_pytorch = (model) => [ + `# pip install --no-binary :all: cartesia-pytorch +from cartesia_pytorch import ReneLMHeadModel +from transformers import AutoTokenizer + +model = ReneLMHeadModel.from_pretrained("${model.id}") +tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-1B-hf") + +in_message = ["Rene Descartes was"] +inputs = tokenizer(in_message, return_tensors="pt") + +outputs = model.generate(inputs.input_ids, max_length=50, top_k=100, top_p=0.99) +out_message = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0] + +print(out_message) +)`, +]; +exports.cartesia_pytorch = cartesia_pytorch; +const cartesia_mlx = (model) => [ + `import mlx.core as mx +import cartesia_mlx as cmx + +model = cmx.from_pretrained("${model.id}") +model.set_dtype(mx.float32) + +prompt = "Rene Descartes was" + +for text in model.generate( + prompt, + max_tokens=500, + eval_every_n=5, + verbose=True, + top_p=0.99, + temperature=0.85, +): + print(text, end="", flush=True) +`, +]; +exports.cartesia_mlx = cartesia_mlx; +const edsnlp = (model) => { + const packageName = nameWithoutNamespace(model.id).replaceAll("-", "_"); + return [ + `# Load it from the Hub directly +import edsnlp +nlp = edsnlp.load("${model.id}") +`, + `# Or install it as a package +!pip install git+https://huggingface.co/${model.id} + +# and import it as a module +import ${packageName} + +nlp = ${packageName}.load() # or edsnlp.load("${packageName}") +`, + ]; +}; +exports.edsnlp = edsnlp; +const espnetTTS = (model) => [ + `from espnet2.bin.tts_inference import Text2Speech + +model = Text2Speech.from_pretrained("${model.id}") + +speech, *_ = model("text to generate speech from")`, +]; +exports.espnetTTS = espnetTTS; +const espnetASR = (model) => [ + `from espnet2.bin.asr_inference import Speech2Text + +model = Speech2Text.from_pretrained( + "${model.id}" +) + +speech, rate = soundfile.read("speech.wav") +text, *_ = model(speech)[0]`, +]; +exports.espnetASR = espnetASR; +const espnetUnknown = () => [`unknown model type (must be text-to-speech or automatic-speech-recognition)`]; +const espnet = (model) => { + if (model.tags.includes("text-to-speech")) { + return (0, exports.espnetTTS)(model); + } + else if (model.tags.includes("automatic-speech-recognition")) { + return (0, exports.espnetASR)(model); + } + return espnetUnknown(); +}; +exports.espnet = espnet; +const fairseq = (model) => [ + `from fairseq.checkpoint_utils import load_model_ensemble_and_task_from_hf_hub + +models, cfg, task = load_model_ensemble_and_task_from_hf_hub( + "${model.id}" +)`, +]; +exports.fairseq = fairseq; +const flair = (model) => [ + `from flair.models import SequenceTagger + +tagger = SequenceTagger.load("${model.id}")`, +]; +exports.flair = flair; +const gliner = (model) => [ + `from gliner import GLiNER + +model = GLiNER.from_pretrained("${model.id}")`, +]; +exports.gliner = gliner; +const gliner2 = (model) => [ + `from gliner2 import GLiNER2 + +model = GLiNER2.from_pretrained("${model.id}") + +# Extract entities +text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." +result = extractor.extract_entities(text, ["company", "person", "product", "location"]) + +print(result)`, +]; +exports.gliner2 = gliner2; +const indextts = (model) => [ + `# Download model +from huggingface_hub import snapshot_download + +snapshot_download(${model.id}, local_dir="checkpoints") + +from indextts.infer import IndexTTS + +# Ensure config.yaml is present in the checkpoints directory +tts = IndexTTS(model_dir="checkpoints", cfg_path="checkpoints/config.yaml") + +voice = "path/to/your/reference_voice.wav" # Path to the voice reference audio file +text = "Hello, how are you?" +output_path = "output_index.wav" + +tts.infer(voice, text, output_path)`, +]; +exports.indextts = indextts; +const htrflow = (model) => [ + `# CLI usage +# see docs: https://ai-riksarkivet.github.io/htrflow/latest/getting_started/quick_start.html +htrflow pipeline `, + `# Python usage +from htrflow.pipeline.pipeline import Pipeline +from htrflow.pipeline.steps import Task +from htrflow.models.framework.model import ModelClass + +pipeline = Pipeline( + [ + Task( + ModelClass, {"model": "${model.id}"}, {} + ), + ])`, +]; +exports.htrflow = htrflow; +const keras = (model) => [ + `# Available backend options are: "jax", "torch", "tensorflow". +import os +os.environ["KERAS_BACKEND"] = "jax" + +import keras + +model = keras.saving.load_model("hf://${model.id}") +`, +]; +exports.keras = keras; +const _keras_hub_causal_lm = (modelId) => ` +import keras_hub + +# Load CausalLM model (optional: use half precision for inference) +causal_lm = keras_hub.models.CausalLM.from_preset("hf://${modelId}", dtype="bfloat16") +causal_lm.compile(sampler="greedy") # (optional) specify a sampler + +# Generate text +causal_lm.generate("Keras: deep learning for", max_length=64) +`; +const _keras_hub_text_to_image = (modelId) => ` +import keras_hub + +# Load TextToImage model (optional: use half precision for inference) +text_to_image = keras_hub.models.TextToImage.from_preset("hf://${modelId}", dtype="bfloat16") + +# Generate images with a TextToImage model. +text_to_image.generate("Astronaut in a jungle") +`; +const _keras_hub_text_classifier = (modelId) => ` +import keras_hub + +# Load TextClassifier model +text_classifier = keras_hub.models.TextClassifier.from_preset( + "hf://${modelId}", + num_classes=2, +) +# Fine-tune +text_classifier.fit(x=["Thilling adventure!", "Total snoozefest."], y=[1, 0]) +# Classify text +text_classifier.predict(["Not my cup of tea."]) +`; +const _keras_hub_image_classifier = (modelId) => ` +import keras_hub +import keras + +# Load ImageClassifier model +image_classifier = keras_hub.models.ImageClassifier.from_preset( + "hf://${modelId}", + num_classes=2, +) +# Fine-tune +image_classifier.fit( + x=keras.random.randint((32, 64, 64, 3), 0, 256), + y=keras.random.randint((32, 1), 0, 2), +) +# Classify image +image_classifier.predict(keras.random.randint((1, 64, 64, 3), 0, 256)) +`; +const _keras_hub_tasks_with_example = { + CausalLM: _keras_hub_causal_lm, + TextToImage: _keras_hub_text_to_image, + TextClassifier: _keras_hub_text_classifier, + ImageClassifier: _keras_hub_image_classifier, +}; +const _keras_hub_task_without_example = (task, modelId) => ` +import keras_hub + +# Create a ${task} model +task = keras_hub.models.${task}.from_preset("hf://${modelId}") +`; +const _keras_hub_generic_backbone = (modelId) => ` +import keras_hub + +# Create a Backbone model unspecialized for any task +backbone = keras_hub.models.Backbone.from_preset("hf://${modelId}") +`; +const keras_hub = (model) => { + const modelId = model.id; + const tasks = model.config?.keras_hub?.tasks ?? []; + const snippets = []; + // First, generate tasks with examples + for (const [task, snippet] of Object.entries(_keras_hub_tasks_with_example)) { + if (tasks.includes(task)) { + snippets.push(snippet(modelId)); + } + } + // Then, add remaining tasks + for (const task of tasks) { + if (!Object.keys(_keras_hub_tasks_with_example).includes(task)) { + snippets.push(_keras_hub_task_without_example(task, modelId)); + } + } + // Finally, add generic backbone snippet + snippets.push(_keras_hub_generic_backbone(modelId)); + return snippets; +}; +exports.keras_hub = keras_hub; +const kernels = (model) => [ + `# !pip install kernels + +from kernels import get_kernel + +kernel = get_kernel("${model.id}")`, +]; +exports.kernels = kernels; +const kimi_audio = (model) => [ + `# Example usage for KimiAudio +# pip install git+https://github.com/MoonshotAI/Kimi-Audio.git + +from kimia_infer.api.kimia import KimiAudio + +model = KimiAudio(model_path="${model.id}", load_detokenizer=True) + +sampling_params = { + "audio_temperature": 0.8, + "audio_top_k": 10, + "text_temperature": 0.0, + "text_top_k": 5, +} + +# For ASR +asr_audio = "asr_example.wav" +messages_asr = [ + {"role": "user", "message_type": "text", "content": "Please transcribe the following audio:"}, + {"role": "user", "message_type": "audio", "content": asr_audio} +] +_, text = model.generate(messages_asr, **sampling_params, output_type="text") +print(text) + +# For Q&A +qa_audio = "qa_example.wav" +messages_conv = [{"role": "user", "message_type": "audio", "content": qa_audio}] +wav, text = model.generate(messages_conv, **sampling_params, output_type="both") +sf.write("output_audio.wav", wav.cpu().view(-1).numpy(), 24000) +print(text) +`, +]; +exports.kimi_audio = kimi_audio; +const kittentts = (model) => [ + `from kittentts import KittenTTS +m = KittenTTS("${model.id}") + +audio = m.generate("This high quality TTS model works without a GPU") + +# Save the audio +import soundfile as sf +sf.write('output.wav', audio, 24000)`, +]; +exports.kittentts = kittentts; +const lightning_ir = (model) => { + if (model.tags.includes("bi-encoder")) { + return [ + `#install from https://github.com/webis-de/lightning-ir + +from lightning_ir import BiEncoderModule +model = BiEncoderModule("${model.id}") + +model.score("query", ["doc1", "doc2", "doc3"])`, + ]; + } + else if (model.tags.includes("cross-encoder")) { + return [ + `#install from https://github.com/webis-de/lightning-ir + +from lightning_ir import CrossEncoderModule +model = CrossEncoderModule("${model.id}") + +model.score("query", ["doc1", "doc2", "doc3"])`, + ]; + } + return [ + `#install from https://github.com/webis-de/lightning-ir + +from lightning_ir import BiEncoderModule, CrossEncoderModule + +# depending on the model type, use either BiEncoderModule or CrossEncoderModule +model = BiEncoderModule("${model.id}") +# model = CrossEncoderModule("${model.id}") + +model.score("query", ["doc1", "doc2", "doc3"])`, + ]; +}; +exports.lightning_ir = lightning_ir; +const llama_cpp_python = (model) => { + const snippets = [ + `# !pip install llama-cpp-python + +from llama_cpp import Llama + +llm = Llama.from_pretrained( + repo_id="${model.id}", + filename="{{GGUF_FILE}}", +) +`, + ]; + if (model.tags.includes("conversational")) { + const messages = (0, inputs_js_1.getModelInputSnippet)(model); + snippets.push(`llm.create_chat_completion( + messages = ${(0, common_js_1.stringifyMessages)(messages, { attributeKeyQuotes: true, indent: "\t" })} +)`); + } + else { + snippets.push(`output = llm( + "Once upon a time,", + max_tokens=512, + echo=True +) +print(output)`); + } + return snippets; +}; +exports.llama_cpp_python = llama_cpp_python; +const lerobot = (model) => { + if (model.tags.includes("smolvla")) { + const smolvlaSnippets = [ + // Installation snippet + `# See https://github.com/huggingface/lerobot?tab=readme-ov-file#installation for more details +git clone https://github.com/huggingface/lerobot.git +cd lerobot +pip install -e .[smolvla]`, + // Finetune snippet + `# Launch finetuning on your dataset +python lerobot/scripts/train.py \\ +--policy.path=${model.id} \\ +--dataset.repo_id=lerobot/svla_so101_pickplace \\ +--batch_size=64 \\ +--steps=20000 \\ +--output_dir=outputs/train/my_smolvla \\ +--job_name=my_smolvla_training \\ +--policy.device=cuda \\ +--wandb.enable=true`, + ]; + if (model.id !== "lerobot/smolvla_base") { + // Inference snippet (only if not base model) + smolvlaSnippets.push(`# Run the policy using the record function +python -m lerobot.record \\ + --robot.type=so101_follower \\ + --robot.port=/dev/ttyACM0 \\ # <- Use your port + --robot.id=my_blue_follower_arm \\ # <- Use your robot id + --robot.cameras="{ front: {type: opencv, index_or_path: 8, width: 640, height: 480, fps: 30}}" \\ # <- Use your cameras + --dataset.single_task="Grasp a lego block and put it in the bin." \\ # <- Use the same task description you used in your dataset recording + --dataset.repo_id=HF_USER/dataset_name \\ # <- This will be the dataset name on HF Hub + --dataset.episode_time_s=50 \\ + --dataset.num_episodes=10 \\ + --policy.path=${model.id}`); + } + return smolvlaSnippets; + } + return []; +}; +exports.lerobot = lerobot; +const tf_keras = (model) => [ + `# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy) +# See https://github.com/keras-team/tf-keras for more details. +from huggingface_hub import from_pretrained_keras + +model = from_pretrained_keras("${model.id}") +`, +]; +exports.tf_keras = tf_keras; +const mamba_ssm = (model) => [ + `from mamba_ssm import MambaLMHeadModel + +model = MambaLMHeadModel.from_pretrained("${model.id}")`, +]; +exports.mamba_ssm = mamba_ssm; +const mars5_tts = (model) => [ + `# Install from https://github.com/Camb-ai/MARS5-TTS + +from inference import Mars5TTS +mars5 = Mars5TTS.from_pretrained("${model.id}")`, +]; +exports.mars5_tts = mars5_tts; +const matanyone = (model) => [ + `# Install from https://github.com/pq-yang/MatAnyone.git + +from matanyone.model.matanyone import MatAnyone +model = MatAnyone.from_pretrained("${model.id}")`, + ` +from matanyone import InferenceCore +processor = InferenceCore("${model.id}")`, +]; +exports.matanyone = matanyone; +const mesh_anything = () => [ + `# Install from https://github.com/buaacyw/MeshAnything.git + +from MeshAnything.models.meshanything import MeshAnything + +# refer to https://github.com/buaacyw/MeshAnything/blob/main/main.py#L91 on how to define args +# and https://github.com/buaacyw/MeshAnything/blob/main/app.py regarding usage +model = MeshAnything(args)`, +]; +exports.mesh_anything = mesh_anything; +const open_clip = (model) => [ + `import open_clip + +model, preprocess_train, preprocess_val = open_clip.create_model_and_transforms('hf-hub:${model.id}') +tokenizer = open_clip.get_tokenizer('hf-hub:${model.id}')`, +]; +exports.open_clip = open_clip; +const paddlenlp = (model) => { + if (model.config?.architectures?.[0]) { + const architecture = model.config.architectures[0]; + return [ + [ + `from paddlenlp.transformers import AutoTokenizer, ${architecture}`, + "", + `tokenizer = AutoTokenizer.from_pretrained("${model.id}", from_hf_hub=True)`, + `model = ${architecture}.from_pretrained("${model.id}", from_hf_hub=True)`, + ].join("\n"), + ]; + } + else { + return [ + [ + `# ⚠️ Type of model unknown`, + `from paddlenlp.transformers import AutoTokenizer, AutoModel`, + "", + `tokenizer = AutoTokenizer.from_pretrained("${model.id}", from_hf_hub=True)`, + `model = AutoModel.from_pretrained("${model.id}", from_hf_hub=True)`, + ].join("\n"), + ]; + } +}; +exports.paddlenlp = paddlenlp; +const paddleocr = (model) => { + const mapping = { + textline_detection: { className: "TextDetection" }, + textline_recognition: { className: "TextRecognition" }, + seal_text_detection: { className: "SealTextDetection" }, + doc_img_unwarping: { className: "TextImageUnwarping" }, + doc_img_orientation_classification: { className: "DocImgOrientationClassification" }, + textline_orientation_classification: { className: "TextLineOrientationClassification" }, + chart_parsing: { className: "ChartParsing" }, + formula_recognition: { className: "FormulaRecognition" }, + layout_detection: { className: "LayoutDetection" }, + table_cells_detection: { className: "TableCellsDetection" }, + wired_table_classification: { className: "TableClassification" }, + table_structure_recognition: { className: "TableStructureRecognition" }, + }; + if (model.tags.includes("doc_vlm")) { + return [ + `# 1. See https://www.paddlepaddle.org.cn/en/install to install paddlepaddle +# 2. pip install paddleocr + +from paddleocr import DocVLM +model = DocVLM(model_name="${nameWithoutNamespace(model.id)}") +output = model.predict( + input={"image": "path/to/image.png", "query": "Parsing this image and output the content in Markdown format."}, + batch_size=1 +) +for res in output: + res.print() + res.save_to_json(save_path="./output/res.json")`, + ]; + } + if (model.tags.includes("document-parse")) { + const rawVersion = model.id.replace("PaddlePaddle/PaddleOCR-VL-", "v"); + const version = rawVersion === "PaddlePaddle/PaddleOCR-VL" ? "v1" : rawVersion; + return [ + `# See https://www.paddleocr.ai/latest/version3.x/pipeline_usage/PaddleOCR-VL.html to installation + +from paddleocr import PaddleOCRVL +pipeline = PaddleOCRVL(pipeline_version="${version}") +output = pipeline.predict("path/to/document_image.png") +for res in output: + res.print() + res.save_to_json(save_path="output") + res.save_to_markdown(save_path="output")`, + ]; + } + for (const tag of model.tags) { + if (tag in mapping) { + const { className } = mapping[tag]; + return [ + `# 1. See https://www.paddlepaddle.org.cn/en/install to install paddlepaddle +# 2. pip install paddleocr + +from paddleocr import ${className} +model = ${className}(model_name="${nameWithoutNamespace(model.id)}") +output = model.predict(input="path/to/image.png", batch_size=1) +for res in output: + res.print() + res.save_to_img(save_path="./output/") + res.save_to_json(save_path="./output/res.json")`, + ]; + } + } + return [ + `# Please refer to the document for information on how to use the model. +# https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/module_usage/module_overview.html`, + ]; +}; +exports.paddleocr = paddleocr; +const perception_encoder = (model) => { + const clip_model = `# Use PE-Core models as CLIP models +import core.vision_encoder.pe as pe + +model = pe.CLIP.from_config("${model.id}", pretrained=True)`; + const vision_encoder = `# Use any PE model as a vision encoder +import core.vision_encoder.pe as pe + +model = pe.VisionTransformer.from_config("${model.id}", pretrained=True)`; + if (model.id.includes("Core")) { + return [clip_model, vision_encoder]; + } + else { + return [vision_encoder]; + } +}; +exports.perception_encoder = perception_encoder; +const phantom_wan = (model) => [ + `from huggingface_hub import snapshot_download +from phantom_wan import WANI2V, configs + +checkpoint_dir = snapshot_download("${model.id}") +wan_i2v = WanI2V( + config=configs.WAN_CONFIGS['i2v-14B'], + checkpoint_dir=checkpoint_dir, + ) + video = wan_i2v.generate(text_prompt, image_prompt)`, +]; +exports.phantom_wan = phantom_wan; +const pocket_tts = (model) => [ + `from pocket_tts import TTSModel +import scipy.io.wavfile + +tts_model = TTSModel.load_model("${model.id}") +voice_state = tts_model.get_state_for_audio_prompt( + "hf://kyutai/tts-voices/alba-mackenna/casual.wav" +) +audio = tts_model.generate_audio(voice_state, "Hello world, this is a test.") +# Audio is a 1D torch tensor containing PCM data. +scipy.io.wavfile.write("output.wav", tts_model.sample_rate, audio.numpy())`, +]; +exports.pocket_tts = pocket_tts; +const pyannote_audio_pipeline = (model) => [ + `from pyannote.audio import Pipeline + +pipeline = Pipeline.from_pretrained("${model.id}") + +# inference on the whole file +pipeline("file.wav") + +# inference on an excerpt +from pyannote.core import Segment +excerpt = Segment(start=2.0, end=5.0) + +from pyannote.audio import Audio +waveform, sample_rate = Audio().crop("file.wav", excerpt) +pipeline({"waveform": waveform, "sample_rate": sample_rate})`, +]; +exports.pyannote_audio_pipeline = pyannote_audio_pipeline; +const pyannote_audio_model = (model) => [ + `from pyannote.audio import Model, Inference + +model = Model.from_pretrained("${model.id}") +inference = Inference(model) + +# inference on the whole file +inference("file.wav") + +# inference on an excerpt +from pyannote.core import Segment +excerpt = Segment(start=2.0, end=5.0) +inference.crop("file.wav", excerpt)`, +]; +const pyannote_audio = (model) => { + if (model.tags.includes("pyannote-audio-pipeline")) { + return (0, exports.pyannote_audio_pipeline)(model); + } + return pyannote_audio_model(model); +}; +exports.pyannote_audio = pyannote_audio; +const relik = (model) => [ + `from relik import Relik + +relik = Relik.from_pretrained("${model.id}")`, +]; +exports.relik = relik; +const renderformer = (model) => [ + `# Install from https://github.com/microsoft/renderformer + +from renderformer import RenderFormerRenderingPipeline +pipeline = RenderFormerRenderingPipeline.from_pretrained("${model.id}")`, +]; +exports.renderformer = renderformer; +const tensorflowttsTextToMel = (model) => [ + `from tensorflow_tts.inference import AutoProcessor, TFAutoModel + +processor = AutoProcessor.from_pretrained("${model.id}") +model = TFAutoModel.from_pretrained("${model.id}") +`, +]; +const tensorflowttsMelToWav = (model) => [ + `from tensorflow_tts.inference import TFAutoModel + +model = TFAutoModel.from_pretrained("${model.id}") +audios = model.inference(mels) +`, +]; +const tensorflowttsUnknown = (model) => [ + `from tensorflow_tts.inference import TFAutoModel + +model = TFAutoModel.from_pretrained("${model.id}") +`, +]; +const tensorflowtts = (model) => { + if (model.tags.includes("text-to-mel")) { + return tensorflowttsTextToMel(model); + } + else if (model.tags.includes("mel-to-wav")) { + return tensorflowttsMelToWav(model); + } + return tensorflowttsUnknown(model); +}; +exports.tensorflowtts = tensorflowtts; +const timm = (model) => [ + `import timm + +model = timm.create_model("hf_hub:${model.id}", pretrained=True)`, +]; +exports.timm = timm; +const saelens = ( /* model: ModelData */) => [ + `# pip install sae-lens +from sae_lens import SAE + +sae, cfg_dict, sparsity = SAE.from_pretrained( + release = "RELEASE_ID", # e.g., "gpt2-small-res-jb". See other options in https://github.com/jbloomAus/SAELens/blob/main/sae_lens/pretrained_saes.yaml + sae_id = "SAE_ID", # e.g., "blocks.8.hook_resid_pre". Won't always be a hook point +)`, +]; +exports.saelens = saelens; +const seed_story = () => [ + `# seed_story_cfg_path refers to 'https://github.com/TencentARC/SEED-Story/blob/master/configs/clm_models/agent_7b_sft.yaml' +# llm_cfg_path refers to 'https://github.com/TencentARC/SEED-Story/blob/master/configs/clm_models/llama2chat7b_lora.yaml' +from omegaconf import OmegaConf +import hydra + +# load Llama2 +llm_cfg = OmegaConf.load(llm_cfg_path) +llm = hydra.utils.instantiate(llm_cfg, torch_dtype="fp16") + +# initialize seed_story +seed_story_cfg = OmegaConf.load(seed_story_cfg_path) +seed_story = hydra.utils.instantiate(seed_story_cfg, llm=llm) `, +]; +exports.seed_story = seed_story; +const skopsPickle = (model, modelFile) => { + return [ + `import joblib +from skops.hub_utils import download +download("${model.id}", "path_to_folder") +model = joblib.load( + "${modelFile}" +) +# only load pickle files from sources you trust +# read more about it here https://skops.readthedocs.io/en/stable/persistence.html`, + ]; +}; +const skopsFormat = (model, modelFile) => { + return [ + `from skops.hub_utils import download +from skops.io import load +download("${model.id}", "path_to_folder") +# make sure model file is in skops format +# if model is a pickle file, make sure it's from a source you trust +model = load("path_to_folder/${modelFile}")`, + ]; +}; +const skopsJobLib = (model) => { + return [ + `from huggingface_hub import hf_hub_download +import joblib +model = joblib.load( + hf_hub_download("${model.id}", "sklearn_model.joblib") +) +# only load pickle files from sources you trust +# read more about it here https://skops.readthedocs.io/en/stable/persistence.html`, + ]; +}; +const sklearn = (model) => { + if (model.tags.includes("skops")) { + const skopsmodelFile = model.config?.sklearn?.model?.file; + const skopssaveFormat = model.config?.sklearn?.model_format; + if (!skopsmodelFile) { + return [`# ⚠️ Model filename not specified in config.json`]; + } + if (skopssaveFormat === "pickle") { + return skopsPickle(model, skopsmodelFile); + } + else { + return skopsFormat(model, skopsmodelFile); + } + } + else { + return skopsJobLib(model); + } +}; +exports.sklearn = sklearn; +const stable_audio_tools = (model) => [ + `import torch +import torchaudio +from einops import rearrange +from stable_audio_tools import get_pretrained_model +from stable_audio_tools.inference.generation import generate_diffusion_cond + +device = "cuda" if torch.cuda.is_available() else "cpu" + +# Download model +model, model_config = get_pretrained_model("${model.id}") +sample_rate = model_config["sample_rate"] +sample_size = model_config["sample_size"] + +model = model.to(device) + +# Set up text and timing conditioning +conditioning = [{ + "prompt": "128 BPM tech house drum loop", +}] + +# Generate stereo audio +output = generate_diffusion_cond( + model, + conditioning=conditioning, + sample_size=sample_size, + device=device +) + +# Rearrange audio batch to a single sequence +output = rearrange(output, "b d n -> d (b n)") + +# Peak normalize, clip, convert to int16, and save to file +output = output.to(torch.float32).div(torch.max(torch.abs(output))).clamp(-1, 1).mul(32767).to(torch.int16).cpu() +torchaudio.save("output.wav", output, sample_rate)`, +]; +exports.stable_audio_tools = stable_audio_tools; +const fastai = (model) => [ + `from huggingface_hub import from_pretrained_fastai + +learn = from_pretrained_fastai("${model.id}")`, +]; +exports.fastai = fastai; +const sam2 = (model) => { + const image_predictor = `# Use SAM2 with images +import torch +from sam2.sam2_image_predictor import SAM2ImagePredictor + +predictor = SAM2ImagePredictor.from_pretrained(${model.id}) + +with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): + predictor.set_image() + masks, _, _ = predictor.predict()`; + const video_predictor = `# Use SAM2 with videos +import torch +from sam2.sam2_video_predictor import SAM2VideoPredictor + +predictor = SAM2VideoPredictor.from_pretrained(${model.id}) + +with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): + state = predictor.init_state() + + # add new prompts and instantly get the output on the same frame + frame_idx, object_ids, masks = predictor.add_new_points(state, ): + + # propagate the prompts to get masklets throughout the video + for frame_idx, object_ids, masks in predictor.propagate_in_video(state): + ...`; + return [image_predictor, video_predictor]; +}; +exports.sam2 = sam2; +const sam_3d_objects = (model) => [ + `from inference import Inference, load_image, load_single_mask +from huggingface_hub import hf_hub_download + +path = hf_hub_download("${model.id}", "pipeline.yaml") +inference = Inference(path, compile=False) + +image = load_image("path_to_image.png") +mask = load_single_mask("path_to_mask.png", index=14) + +output = inference(image, mask)`, +]; +exports.sam_3d_objects = sam_3d_objects; +const sam_3d_body = (model) => [ + `from notebook.utils import setup_sam_3d_body + +estimator = setup_sam_3d_body(${model.id}) +outputs = estimator.process_one_image(image) +rend_img = visualize_sample_together(image, outputs, estimator.faces)`, +]; +exports.sam_3d_body = sam_3d_body; +const sampleFactory = (model) => [ + `python -m sample_factory.huggingface.load_from_hub -r ${model.id} -d ./train_dir`, +]; +exports.sampleFactory = sampleFactory; +function get_widget_examples_from_st_model(model) { + const widgetExample = model.widgetData?.[0]; + if (widgetExample?.source_sentence && widgetExample?.sentences?.length) { + return [widgetExample.source_sentence, ...widgetExample.sentences]; + } +} +const sentenceTransformers = (model) => { + const remote_code_snippet = model.tags.includes(TAG_CUSTOM_CODE) ? ", trust_remote_code=True" : ""; + if (model.tags.includes("PyLate")) { + return [ + `from pylate import models + +queries = [ + "Which planet is known as the Red Planet?", + "What is the largest planet in our solar system?", +] + +documents = [ + ["Mars is the Red Planet.", "Venus is Earth's twin."], + ["Jupiter is the largest planet.", "Saturn has rings."], +] + +model = models.ColBERT(model_name_or_path="${model.id}") + +queries_emb = model.encode(queries, is_query=True) +docs_emb = model.encode(documents, is_query=False)`, + ]; + } + if (model.tags.includes("cross-encoder") || model.pipeline_tag == "text-ranking") { + return [ + `from sentence_transformers import CrossEncoder + +model = CrossEncoder("${model.id}"${remote_code_snippet}) + +query = "Which planet is known as the Red Planet?" +passages = [ + "Venus is often called Earth's twin because of its similar size and proximity.", + "Mars, known for its reddish appearance, is often referred to as the Red Planet.", + "Jupiter, the largest planet in our solar system, has a prominent red spot.", + "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." +] + +scores = model.predict([(query, passage) for passage in passages]) +print(scores)`, + ]; + } + const exampleSentences = get_widget_examples_from_st_model(model) ?? [ + "The weather is lovely today.", + "It's so sunny outside!", + "He drove to the stadium.", + ]; + return [ + `from sentence_transformers import SentenceTransformer + +model = SentenceTransformer("${model.id}"${remote_code_snippet}) + +sentences = ${JSON.stringify(exampleSentences, null, 4)} +embeddings = model.encode(sentences) + +similarities = model.similarity(embeddings, embeddings) +print(similarities.shape) +# [${exampleSentences.length}, ${exampleSentences.length}]`, + ]; +}; +exports.sentenceTransformers = sentenceTransformers; +const setfit = (model) => [ + `from setfit import SetFitModel + +model = SetFitModel.from_pretrained("${model.id}")`, +]; +exports.setfit = setfit; +const spacy = (model) => [ + `!pip install https://huggingface.co/${model.id}/resolve/main/${nameWithoutNamespace(model.id)}-any-py3-none-any.whl + +# Using spacy.load(). +import spacy +nlp = spacy.load("${nameWithoutNamespace(model.id)}") + +# Importing as module. +import ${nameWithoutNamespace(model.id)} +nlp = ${nameWithoutNamespace(model.id)}.load()`, +]; +exports.spacy = spacy; +const span_marker = (model) => [ + `from span_marker import SpanMarkerModel + +model = SpanMarkerModel.from_pretrained("${model.id}")`, +]; +exports.span_marker = span_marker; +const stanza = (model) => [ + `import stanza + +stanza.download("${nameWithoutNamespace(model.id).replace("stanza-", "")}") +nlp = stanza.Pipeline("${nameWithoutNamespace(model.id).replace("stanza-", "")}")`, +]; +exports.stanza = stanza; +const speechBrainMethod = (speechbrainInterface) => { + switch (speechbrainInterface) { + case "EncoderClassifier": + return "classify_file"; + case "EncoderDecoderASR": + case "EncoderASR": + return "transcribe_file"; + case "SpectralMaskEnhancement": + return "enhance_file"; + case "SepformerSeparation": + return "separate_file"; + default: + return undefined; + } +}; +const speechbrain = (model) => { + const speechbrainInterface = model.config?.speechbrain?.speechbrain_interface; + if (speechbrainInterface === undefined) { + return [`# interface not specified in config.json`]; + } + const speechbrainMethod = speechBrainMethod(speechbrainInterface); + if (speechbrainMethod === undefined) { + return [`# interface in config.json invalid`]; + } + return [ + `from speechbrain.pretrained import ${speechbrainInterface} +model = ${speechbrainInterface}.from_hparams( + "${model.id}" +) +model.${speechbrainMethod}("file.wav")`, + ]; +}; +exports.speechbrain = speechbrain; +const terratorch = (model) => [ + `from terratorch.registry import BACKBONE_REGISTRY + +model = BACKBONE_REGISTRY.build("${model.id}")`, +]; +exports.terratorch = terratorch; +const hasChatTemplate = (model) => model.config?.tokenizer_config?.chat_template !== undefined || + model.config?.processor_config?.chat_template !== undefined || + model.config?.chat_template_jinja !== undefined; +const transformers = (model) => { + const info = model.transformersInfo; + if (!info) { + return [`# ⚠️ Type of model unknown`]; + } + const remote_code_snippet = model.tags.includes(TAG_CUSTOM_CODE) ? ", trust_remote_code=True" : ""; + const autoSnippet = []; + if (info.processor) { + const processorVarName = info.processor === "AutoTokenizer" + ? "tokenizer" + : info.processor === "AutoFeatureExtractor" + ? "extractor" + : "processor"; + autoSnippet.push("# Load model directly", `from transformers import ${info.processor}, ${info.auto_model}`, "", `${processorVarName} = ${info.processor}.from_pretrained("${model.id}"` + remote_code_snippet + ")", `model = ${info.auto_model}.from_pretrained("${model.id}"` + remote_code_snippet + ")"); + if (model.tags.includes("conversational") && hasChatTemplate(model)) { + if (model.tags.includes("image-text-to-text")) { + autoSnippet.push("messages = [", [ + " {", + ' "role": "user",', + ' "content": [', + ' {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},', + ' {"type": "text", "text": "What animal is on the candy?"}', + " ]", + " },", + ].join("\n"), "]"); + } + else { + autoSnippet.push("messages = [", ' {"role": "user", "content": "Who are you?"},', "]"); + } + autoSnippet.push(`inputs = ${processorVarName}.apply_chat_template(`, " messages,", " add_generation_prompt=True,", " tokenize=True,", " return_dict=True,", ' return_tensors="pt",', ").to(model.device)", "", "outputs = model.generate(**inputs, max_new_tokens=40)", `print(${processorVarName}.decode(outputs[0][inputs["input_ids"].shape[-1]:]))`); + } + } + else { + autoSnippet.push("# Load model directly", `from transformers import ${info.auto_model}`, `model = ${info.auto_model}.from_pretrained("${model.id}"` + remote_code_snippet + ', dtype="auto")'); + } + if (model.pipeline_tag && library_to_tasks_js_1.LIBRARY_TASK_MAPPING.transformers?.includes(model.pipeline_tag)) { + const pipelineSnippet = ["# Use a pipeline as a high-level helper"]; + if (library_to_tasks_js_1.REMOVED_IN_V5_TRANSFORMERS_PIPELINES.includes(model.pipeline_tag)) { + pipelineSnippet.push(`# Warning: Pipeline type "${model.pipeline_tag}" is no longer supported in transformers v5.`, `# You must load the model directly (see below) or downgrade to v4.x with:`, `# 'pip install "transformers<5.0.0'`); + } + pipelineSnippet.push("from transformers import pipeline", "", `pipe = pipeline("${model.pipeline_tag}", model="${model.id}"` + remote_code_snippet + ")"); + if (model.tags.includes("conversational")) { + if (model.tags.includes("image-text-to-text")) { + pipelineSnippet.push("messages = [", [ + " {", + ' "role": "user",', + ' "content": [', + ' {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},', + ' {"type": "text", "text": "What animal is on the candy?"}', + " ]", + " },", + ].join("\n"), "]"); + pipelineSnippet.push("pipe(text=messages)"); + } + else { + pipelineSnippet.push("messages = [", ' {"role": "user", "content": "Who are you?"},', "]"); + pipelineSnippet.push("pipe(messages)"); + } + } + else if (model.pipeline_tag === "zero-shot-image-classification") { + pipelineSnippet.push("pipe(", ' "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png",', ' candidate_labels=["animals", "humans", "landscape"],', ")"); + } + else if (model.pipeline_tag === "image-classification") { + pipelineSnippet.push('pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")'); + } + return [pipelineSnippet.join("\n"), autoSnippet.join("\n")]; + } + return [autoSnippet.join("\n")]; +}; +exports.transformers = transformers; +const transformersJS = (model) => { + if (!model.pipeline_tag) { + return [`// ⚠️ Unknown pipeline tag`]; + } + const libName = "@huggingface/transformers"; + return [ + `// npm i ${libName} +import { pipeline } from '${libName}'; + +// Allocate pipeline +const pipe = await pipeline('${model.pipeline_tag}', '${model.id}');`, + ]; +}; +exports.transformersJS = transformersJS; +const peftTask = (peftTaskType) => { + switch (peftTaskType) { + case "CAUSAL_LM": + return "CausalLM"; + case "SEQ_2_SEQ_LM": + return "Seq2SeqLM"; + case "TOKEN_CLS": + return "TokenClassification"; + case "SEQ_CLS": + return "SequenceClassification"; + default: + return undefined; + } +}; +const peft = (model) => { + const { base_model_name_or_path: peftBaseModel, task_type: peftTaskType } = model.config?.peft ?? {}; + const pefttask = peftTask(peftTaskType); + if (!pefttask) { + return [`Task type is invalid.`]; + } + if (!peftBaseModel) { + return [`Base model is not found.`]; + } + return [ + `from peft import PeftModel +from transformers import AutoModelFor${pefttask} + +base_model = AutoModelFor${pefttask}.from_pretrained("${peftBaseModel}") +model = PeftModel.from_pretrained(base_model, "${model.id}")`, + ]; +}; +exports.peft = peft; +const fasttext = (model) => [ + `from huggingface_hub import hf_hub_download +import fasttext + +model = fasttext.load_model(hf_hub_download("${model.id}", "model.bin"))`, +]; +exports.fasttext = fasttext; +const stableBaselines3 = (model) => [ + `from huggingface_sb3 import load_from_hub +checkpoint = load_from_hub( + repo_id="${model.id}", + filename="{MODEL FILENAME}.zip", +)`, +]; +exports.stableBaselines3 = stableBaselines3; +const nemoDomainResolver = (domain, model) => { + switch (domain) { + case "ASR": + return [ + `import nemo.collections.asr as nemo_asr +asr_model = nemo_asr.models.ASRModel.from_pretrained("${model.id}") + +transcriptions = asr_model.transcribe(["file.wav"])`, + ]; + default: + return undefined; + } +}; +const mlAgents = (model) => [ + `mlagents-load-from-hf --repo-id="${model.id}" --local-dir="./download: string[]s"`, +]; +exports.mlAgents = mlAgents; +const sentis = ( /* model: ModelData */) => [ + `string modelName = "[Your model name here].sentis"; +Model model = ModelLoader.Load(Application.streamingAssetsPath + "/" + modelName); +IWorker engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model); +// Please see provided C# file for more details +`, +]; +exports.sentis = sentis; +const sana = (model) => [ + ` +# Load the model and infer image from text +import torch +from app.sana_pipeline import SanaPipeline +from torchvision.utils import save_image + +sana = SanaPipeline("configs/sana_config/1024ms/Sana_1600M_img1024.yaml") +sana.from_pretrained("hf://${model.id}") + +image = sana( + prompt='a cyberpunk cat with a neon sign that says "Sana"', + height=1024, + width=1024, + guidance_scale=5.0, + pag_guidance_scale=2.0, + num_inference_steps=18, +) `, +]; +exports.sana = sana; +const vibevoice = (model) => [ + `import torch, soundfile as sf, librosa, numpy as np +from vibevoice.processor.vibevoice_processor import VibeVoiceProcessor +from vibevoice.modular.modeling_vibevoice_inference import VibeVoiceForConditionalGenerationInference + +# Load voice sample (should be 24kHz mono) +voice, sr = sf.read("path/to/voice_sample.wav") +if voice.ndim > 1: voice = voice.mean(axis=1) +if sr != 24000: voice = librosa.resample(voice, sr, 24000) + +processor = VibeVoiceProcessor.from_pretrained("${model.id}") +model = VibeVoiceForConditionalGenerationInference.from_pretrained( + "${model.id}", torch_dtype=torch.bfloat16 +).to("cuda").eval() +model.set_ddpm_inference_steps(5) + +inputs = processor(text=["Speaker 0: Hello!\\nSpeaker 1: Hi there!"], + voice_samples=[[voice]], return_tensors="pt") +audio = model.generate(**inputs, cfg_scale=1.3, + tokenizer=processor.tokenizer).speech_outputs[0] +sf.write("output.wav", audio.cpu().numpy().squeeze(), 24000)`, +]; +exports.vibevoice = vibevoice; +const videoprism = (model) => [ + `# Install from https://github.com/google-deepmind/videoprism +import jax +from videoprism import models as vp + +flax_model = vp.get_model("${model.id}") +loaded_state = vp.load_pretrained_weights("${model.id}") + +@jax.jit +def forward_fn(inputs, train=False): + return flax_model.apply(loaded_state, inputs, train=train)`, +]; +exports.videoprism = videoprism; +const vfimamba = (model) => [ + `from Trainer_finetune import Model + +model = Model.from_pretrained("${model.id}")`, +]; +exports.vfimamba = vfimamba; +const lvface = (model) => [ + `from huggingface_hub import hf_hub_download + from inference_onnx import LVFaceONNXInferencer + +model_path = hf_hub_download("${model.id}", "LVFace-L_Glint360K/LVFace-L_Glint360K.onnx") +inferencer = LVFaceONNXInferencer(model_path, use_gpu=True, timeout=300) +img_path = 'path/to/image1.jpg' +embedding = inferencer.infer_from_image(img_path)`, +]; +exports.lvface = lvface; +const voicecraft = (model) => [ + `from voicecraft import VoiceCraft + +model = VoiceCraft.from_pretrained("${model.id}")`, +]; +exports.voicecraft = voicecraft; +const voxcpm = (model) => [ + `import soundfile as sf +from voxcpm import VoxCPM + +model = VoxCPM.from_pretrained("${model.id}") + +wav = model.generate( + text="VoxCPM is an innovative end-to-end TTS model from ModelBest, designed to generate highly expressive speech.", + prompt_wav_path=None, # optional: path to a prompt speech for voice cloning + prompt_text=None, # optional: reference text + cfg_value=2.0, # LM guidance on LocDiT, higher for better adherence to the prompt, but maybe worse + inference_timesteps=10, # LocDiT inference timesteps, higher for better result, lower for fast speed + normalize=True, # enable external TN tool + denoise=True, # enable external Denoise tool + retry_badcase=True, # enable retrying mode for some bad cases (unstoppable) + retry_badcase_max_times=3, # maximum retrying times + retry_badcase_ratio_threshold=6.0, # maximum length restriction for bad case detection (simple but effective), it could be adjusted for slow pace speech +) + +sf.write("output.wav", wav, 16000) +print("saved: output.wav")`, +]; +exports.voxcpm = voxcpm; +const vui = () => [ + `# !pip install git+https://github.com/fluxions-ai/vui + +import torchaudio + +from vui.inference import render +from vui.model import Vui, + +model = Vui.from_pretrained().cuda() +waveform = render( + model, + "Hey, here is some random stuff, usually something quite long as the shorter the text the less likely the model can cope!", +) +print(waveform.shape) +torchaudio.save("out.opus", waveform[0], 22050) +`, +]; +exports.vui = vui; +const chattts = () => [ + `import ChatTTS +import torchaudio + +chat = ChatTTS.Chat() +chat.load_models(compile=False) # Set to True for better performance + +texts = ["PUT YOUR TEXT HERE",] + +wavs = chat.infer(texts, ) + +torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)`, +]; +exports.chattts = chattts; +const ultralytics = (model) => { + // ultralytics models must have a version tag (e.g. `yolov8`) + const versionTag = model.tags.find((tag) => tag.match(/^yolov\d+$/)); + const className = versionTag ? `YOLOv${versionTag.slice(4)}` : "YOLOvXX"; + const prefix = versionTag + ? "" + : `# Couldn't find a valid YOLO version tag.\n# Replace XX with the correct version.\n`; + return [ + prefix + + `from ultralytics import ${className} + +model = ${className}.from_pretrained("${model.id}") +source = 'http://images.cocodataset.org/val2017/000000039769.jpg' +model.predict(source=source, save=True)`, + ]; +}; +exports.ultralytics = ultralytics; +const birefnet = (model) => [ + `# Option 1: use with transformers + +from transformers import AutoModelForImageSegmentation +birefnet = AutoModelForImageSegmentation.from_pretrained("${model.id}", trust_remote_code=True) +`, + `# Option 2: use with BiRefNet + +# Install from https://github.com/ZhengPeng7/BiRefNet + +from models.birefnet import BiRefNet +model = BiRefNet.from_pretrained("${model.id}")`, +]; +exports.birefnet = birefnet; +const supertonic = () => [ + `from supertonic import TTS + +tts = TTS(auto_download=True) + +style = tts.get_voice_style(voice_name="M1") + +text = "The train delay was announced at 4:45 PM on Wed, Apr 3, 2024 due to track maintenance." +wav, duration = tts.synthesize(text, voice_style=style) + +tts.save_audio(wav, "output.wav")`, +]; +exports.supertonic = supertonic; +const swarmformer = (model) => [ + `from swarmformer import SwarmFormerModel + +model = SwarmFormerModel.from_pretrained("${model.id}") +`, +]; +exports.swarmformer = swarmformer; +const univa = (model) => [ + `# Follow installation instructions at https://github.com/PKU-YuanGroup/UniWorld-V1 + +from univa.models.qwen2p5vl.modeling_univa_qwen2p5vl import UnivaQwen2p5VLForConditionalGeneration + model = UnivaQwen2p5VLForConditionalGeneration.from_pretrained( + "${model.id}", + torch_dtype=torch.bfloat16, + attn_implementation="flash_attention_2", + ).to("cuda") + processor = AutoProcessor.from_pretrained("${model.id}") +`, +]; +exports.univa = univa; +const mlx_unknown = (model) => [ + `# Download the model from the Hub +pip install huggingface_hub[hf_xet] + +huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} ${model.id}`, +]; +const mlxlm = (model) => [ + `# Make sure mlx-lm is installed +# pip install --upgrade mlx-lm +# if on a CUDA device, also pip install mlx[cuda] + +# Generate text with mlx-lm +from mlx_lm import load, generate + +model, tokenizer = load("${model.id}") + +prompt = "Once upon a time in" +text = generate(model, tokenizer, prompt=prompt, verbose=True)`, +]; +const mlxchat = (model) => [ + `# Make sure mlx-lm is installed +# pip install --upgrade mlx-lm + +# Generate text with mlx-lm +from mlx_lm import load, generate + +model, tokenizer = load("${model.id}") + +prompt = "Write a story about Einstein" +messages = [{"role": "user", "content": prompt}] +prompt = tokenizer.apply_chat_template( + messages, add_generation_prompt=True +) + +text = generate(model, tokenizer, prompt=prompt, verbose=True)`, +]; +const mlxvlm = (model) => [ + `# Make sure mlx-vlm is installed +# pip install --upgrade mlx-vlm + +from mlx_vlm import load, generate +from mlx_vlm.prompt_utils import apply_chat_template +from mlx_vlm.utils import load_config + +# Load the model +model, processor = load("${model.id}") +config = load_config("${model.id}") + +# Prepare input +image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] +prompt = "Describe this image." + +# Apply chat template +formatted_prompt = apply_chat_template( + processor, config, prompt, num_images=1 +) + +# Generate output +output = generate(model, processor, formatted_prompt, image) +print(output)`, +]; +const mlxim = (model) => [ + `from mlxim.model import create_model + +model = create_model(${model.id})`, +]; +exports.mlxim = mlxim; +const mlx = (model) => { + if (model.pipeline_tag === "image-text-to-text") { + return mlxvlm(model); + } + if (model.pipeline_tag === "text-generation") { + if (model.tags.includes("conversational")) { + return mlxchat(model); + } + else { + return mlxlm(model); + } + } + return mlx_unknown(model); +}; +exports.mlx = mlx; +const model2vec = (model) => [ + `from model2vec import StaticModel + +model = StaticModel.from_pretrained("${model.id}")`, +]; +exports.model2vec = model2vec; +const pruna = (model) => { + let snippets; + if (model.tags.includes("diffusers")) { + snippets = pruna_diffusers(model); + } + else if (model.tags.includes("transformers")) { + snippets = pruna_transformers(model); + } + else { + snippets = pruna_default(model); + } + const ensurePrunaModelImport = (snippet) => { + if (!/^from pruna import PrunaModel/m.test(snippet)) { + return `from pruna import PrunaModel\n${snippet}`; + } + return snippet; + }; + snippets = snippets.map(ensurePrunaModelImport); + if (model.tags.includes("pruna_pro-ai")) { + return snippets.map((snippet) => snippet.replace(/\bpruna\b/g, "pruna_pro").replace(/\bPrunaModel\b/g, "PrunaProModel")); + } + return snippets; +}; +exports.pruna = pruna; +const pruna_diffusers = (model) => { + const diffusersSnippets = (0, exports.diffusers)(model); + return diffusersSnippets.map((snippet) => snippet + // Replace pipeline classes with PrunaModel + .replace(/\b\w*Pipeline\w*\b/g, "PrunaModel") + // Clean up diffusers imports containing PrunaModel + .replace(/from diffusers import ([^,\n]*PrunaModel[^,\n]*)/g, "") + .replace(/from diffusers import ([^,\n]+),?\s*([^,\n]*PrunaModel[^,\n]*)/g, "from diffusers import $1") + .replace(/from diffusers import\s*(\n|$)/g, "") + // Fix PrunaModel imports + .replace(/from diffusers import PrunaModel/g, "from pruna import PrunaModel") + .replace(/from diffusers import ([^,\n]+), PrunaModel/g, "from diffusers import $1") + .replace(/from diffusers import PrunaModel, ([^,\n]+)/g, "from diffusers import $1") + // Clean up whitespace + .replace(/\n\n+/g, "\n") + .trim()); +}; +const pruna_transformers = (model) => { + const info = model.transformersInfo; + const transformersSnippets = (0, exports.transformers)(model); + // Replace pipeline with PrunaModel + let processedSnippets = transformersSnippets.map((snippet) => snippet + .replace(/from transformers import pipeline/g, "from pruna import PrunaModel") + .replace(/pipeline\([^)]*\)/g, `PrunaModel.from_pretrained("${model.id}")`)); + // Additional cleanup if auto_model info is available + if (info?.auto_model) { + processedSnippets = processedSnippets.map((snippet) => snippet + .replace(new RegExp(`from transformers import ${info.auto_model}\n?`, "g"), "") + .replace(new RegExp(`${info.auto_model}.from_pretrained`, "g"), "PrunaModel.from_pretrained") + .replace(new RegExp(`^.*from.*import.*(, *${info.auto_model})+.*$`, "gm"), (line) => line.replace(new RegExp(`, *${info.auto_model}`, "g"), ""))); + } + return processedSnippets; +}; +const pruna_default = (model) => [ + `from pruna import PrunaModel +model = PrunaModel.from_pretrained("${model.id}") +`, +]; +const nemo = (model) => { + let command = undefined; + // Resolve the tag to a nemo domain/sub-domain + if (model.tags.includes("automatic-speech-recognition")) { + command = nemoDomainResolver("ASR", model); + } + return command ?? [`# tag did not correspond to a valid NeMo domain.`]; +}; +exports.nemo = nemo; +const outetts = (model) => { + // Don’t show this block on GGUF / ONNX mirrors + const t = model.tags ?? []; + if (t.includes("gguf") || t.includes("onnx")) + return []; + // v1.0 HF → minimal runnable snippet + return [ + ` + import outetts + + enum = outetts.Models("${model.id}".split("/", 1)[1]) # VERSION_1_0_SIZE_1B + cfg = outetts.ModelConfig.auto_config(enum, outetts.Backend.HF) + tts = outetts.Interface(cfg) + + speaker = tts.load_default_speaker("EN-FEMALE-1-NEUTRAL") + tts.generate( + outetts.GenerationConfig( + text="Hello there, how are you doing?", + speaker=speaker, + ) + ).save("output.wav") + `, + ]; +}; +exports.outetts = outetts; +const pxia = (model) => [ + `from pxia import AutoModel + +model = AutoModel.from_pretrained("${model.id}")`, +]; +exports.pxia = pxia; +const pythae = (model) => [ + `from pythae.models import AutoModel + +model = AutoModel.load_from_hf_hub("${model.id}")`, +]; +exports.pythae = pythae; +const qwen3_tts = (model) => [ + `# pip install qwen-tts +import torch +import soundfile as sf +from qwen_tts import Qwen3TTSModel + +model = Qwen3TTSModel.from_pretrained( + "${model.id}", + device_map="cuda:0", + dtype=torch.bfloat16, + attn_implementation="flash_attention_2", +) + +wavs, sr = model.generate_custom_voice( + text="Your text here.", + language="English", + speaker="Ryan", + instruct="Speak in a natural tone.", +) + +sf.write("output.wav", wavs[0], sr)`, +]; +exports.qwen3_tts = qwen3_tts; +const musicgen = (model) => [ + `from audiocraft.models import MusicGen + +model = MusicGen.get_pretrained("${model.id}") + +descriptions = ['happy rock', 'energetic EDM', 'sad jazz'] +wav = model.generate(descriptions) # generates 3 samples.`, +]; +const magnet = (model) => [ + `from audiocraft.models import MAGNeT + +model = MAGNeT.get_pretrained("${model.id}") + +descriptions = ['disco beat', 'energetic EDM', 'funky groove'] +wav = model.generate(descriptions) # generates 3 samples.`, +]; +const audiogen = (model) => [ + `from audiocraft.models import AudioGen + +model = AudioGen.get_pretrained("${model.id}") +model.set_generation_params(duration=5) # generate 5 seconds. +descriptions = ['dog barking', 'sirene of an emergency vehicle', 'footsteps in a corridor'] +wav = model.generate(descriptions) # generates 3 samples.`, +]; +const anemoi = (model) => [ + `from anemoi.inference.runners.default import DefaultRunner +from anemoi.inference.config.run import RunConfiguration +# Create Configuration +config = RunConfiguration(checkpoint = {"huggingface":"${model.id}"}) +# Load Runner +runner = DefaultRunner(config)`, +]; +exports.anemoi = anemoi; +const audiocraft = (model) => { + if (model.tags.includes("musicgen")) { + return musicgen(model); + } + else if (model.tags.includes("audiogen")) { + return audiogen(model); + } + else if (model.tags.includes("magnet")) { + return magnet(model); + } + else { + return [`# Type of model unknown.`]; + } +}; +exports.audiocraft = audiocraft; +const whisperkit = () => [ + `# Install CLI with Homebrew on macOS device +brew install whisperkit-cli + +# View all available inference options +whisperkit-cli transcribe --help + +# Download and run inference using whisper base model +whisperkit-cli transcribe --audio-path /path/to/audio.mp3 + +# Or use your preferred model variant +whisperkit-cli transcribe --model "large-v3" --model-prefix "distil" --audio-path /path/to/audio.mp3 --verbose`, +]; +exports.whisperkit = whisperkit; +const threedtopia_xl = (model) => [ + `from threedtopia_xl.models import threedtopia_xl + +model = threedtopia_xl.from_pretrained("${model.id}") +model.generate(cond="path/to/image.png")`, +]; +exports.threedtopia_xl = threedtopia_xl; +const hezar = (model) => [ + `from hezar import Model + +model = Model.load("${model.id}")`, +]; +exports.hezar = hezar; +const zonos = (model) => [ + `# pip install git+https://github.com/Zyphra/Zonos.git +import torchaudio +from zonos.model import Zonos +from zonos.conditioning import make_cond_dict + +model = Zonos.from_pretrained("${model.id}", device="cuda") + +wav, sr = torchaudio.load("speaker.wav") # 5-10s reference clip +speaker = model.make_speaker_embedding(wav, sr) + +cond = make_cond_dict(text="Hello, world!", speaker=speaker, language="en-us") +codes = model.generate(model.prepare_conditioning(cond)) + +audio = model.autoencoder.decode(codes)[0].cpu() +torchaudio.save("sample.wav", audio, model.autoencoder.sampling_rate) +`, +]; +exports.zonos = zonos; +const moshi = (model) => { + // Detect backend from model name (no distinguishing tags available) + if (model.id.includes("-mlx")) { + // MLX backend (macOS Apple Silicon) + // -q flag only accepts 4 or 8, bf16 models don't use it + const quantFlag = model.id.includes("-q4") ? " -q 4" : model.id.includes("-q8") ? " -q 8" : ""; + return [ + `# pip install moshi_mlx +# Run local inference (macOS Apple Silicon) +python -m moshi_mlx.local${quantFlag} --hf-repo "${model.id}" + +# Or run with web UI +python -m moshi_mlx.local_web${quantFlag} --hf-repo "${model.id}"`, + ]; + } + if (model.id.includes("-candle")) { + // Rust/Candle backend + return [ + `# pip install rustymimi +# Candle backend - see https://github.com/kyutai-labs/moshi +# for Rust installation instructions`, + ]; + } + // PyTorch backend (default) + return [ + `# pip install moshi +# Run the interactive web server +python -m moshi.server --hf-repo "${model.id}" +# Then open https://localhost:8998 in your browser`, + `# pip install moshi +import torch +from moshi.models import loaders + +# Load checkpoint info from HuggingFace +checkpoint = loaders.CheckpointInfo.from_hf_repo("${model.id}") + +# Load the Mimi audio codec +mimi = checkpoint.get_mimi(device="cuda") +mimi.set_num_codebooks(8) + +# Encode audio (24kHz, mono) +wav = torch.randn(1, 1, 24000 * 10) # [batch, channels, samples] +with torch.no_grad(): + codes = mimi.encode(wav.cuda()) + decoded = mimi.decode(codes)`, + ]; +}; +exports.moshi = moshi; +//#endregion diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4992762e83f6647ee2d130b8b7dc9a66c0d93af --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=model-libraries-snippets.spec.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c78932806acc5f8931c62472c22ccb33afa974da --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"model-libraries-snippets.spec.d.ts","sourceRoot":"","sources":["../../src/model-libraries-snippets.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.js b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..8c6a4b3b4d7aedcbaf53e6ae141cf29fec599370 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries-snippets.spec.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const vitest_1 = require("vitest"); +const model_libraries_snippets_js_1 = require("./model-libraries-snippets.js"); +(0, vitest_1.describe)("model-libraries-snippets", () => { + (0, vitest_1.it)("llama_cpp_python conversational", async () => { + const model = { + id: "bartowski/Llama-3.2-3B-Instruct-GGUF", + pipeline_tag: "text-generation", + tags: ["conversational"], + inference: "", + }; + const snippet = (0, model_libraries_snippets_js_1.llama_cpp_python)(model); + (0, vitest_1.expect)(snippet.join("\n")).toEqual(`# !pip install llama-cpp-python + +from llama_cpp import Llama + +llm = Llama.from_pretrained( + repo_id="bartowski/Llama-3.2-3B-Instruct-GGUF", + filename="{{GGUF_FILE}}", +) + +llm.create_chat_completion( + messages = [ + { + "role": "user", + "content": "What is the capital of France?" + } + ] +)`); + }); + (0, vitest_1.it)("llama_cpp_python non-conversational", async () => { + const model = { + id: "mlabonne/gemma-2b-GGUF", + tags: [""], + inference: "", + }; + const snippet = (0, model_libraries_snippets_js_1.llama_cpp_python)(model); + (0, vitest_1.expect)(snippet.join("\n")).toEqual(`# !pip install llama-cpp-python + +from llama_cpp import Llama + +llm = Llama.from_pretrained( + repo_id="mlabonne/gemma-2b-GGUF", + filename="{{GGUF_FILE}}", +) + +output = llm( + "Once upon a time,", + max_tokens=512, + echo=True +) +print(output)`); + }); +}); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2042c9a39ec8e802306579783f00d4b182e747c4 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.d.ts @@ -0,0 +1,1531 @@ +import type { ModelData } from "./model-data.js"; +import type { ElasticSearchQuery } from "./model-libraries-downloads.js"; +/** + * Elements configurable by a model library. + */ +export interface LibraryUiElement { + /** + * Pretty name of the library. + * displayed in tags, and on the main + * call-to-action button on the model page. + */ + prettyLabel: string; + /** + * Repo name of the library's (usually on GitHub) code repo + */ + repoName: string; + /** + * URL to library's (usually on GitHub) code repo + */ + repoUrl: string; + /** + * URL to library's docs + */ + docsUrl?: string; + /** + * Code snippet(s) displayed on model page + */ + snippets?: (model: ModelData) => string[]; + /** + * Elastic query used to count this library's model downloads + * + * By default, those files are counted: + * "config.json", "config.yaml", "hyperparams.yaml", "params.json", "meta.yaml" + */ + countDownloads?: ElasticSearchQuery; + /** + * should we display this library in hf.co/models filter + * (only for popular libraries with > 100 models) + */ + filter?: boolean; +} +/** + * Add your new library here. + * + * This is for modeling (= architectures) libraries, not for file formats (like ONNX, etc). + * (unlike libraries, file formats live in an enum inside the internal codebase.) + * + * Doc on how to add a library to the Hub: + * + * https://huggingface.co/docs/hub/models-adding-libraries + * + * /!\ IMPORTANT + * + * The key you choose is the tag your models have in their library_name on the Hub. + */ +export declare const MODEL_LIBRARIES_UI_ELEMENTS: { + acestep: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "adapter-transformers": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + allennlp: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + anemoi: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + araclip: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + snippets: (model: ModelData) => string[]; + }; + "aviation-ner": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + countDownloads: string; + filter: false; + }; + asteroid: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + audiocraft: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + audioseal: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + "bagel-mot": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + bboxmaskpose: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + ben2: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + bertopic: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + big_vision: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + birder: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + birefnet: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + bm25s: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + boltzgen: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + cancertathomev2: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + cartesia_pytorch: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + }; + cartesia_mlx: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + }; + champ: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + chatterbox: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: () => string[]; + countDownloads: string; + filter: false; + }; + chaossim: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + filter: false; + }; + chat_tts: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: () => string[]; + filter: false; + countDownloads: string; + }; + "chronos-forecasting": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + }; + clara: { + prettyLabel: string; + repoName: string; + filter: false; + repoUrl: string; + countDownloads: string; + }; + clipscope: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "cloud-agents": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + colipri: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + cosyvoice: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + cotracker: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + colpali: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + comet: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + cosmos: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + "cxr-foundation": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: () => string[]; + filter: false; + countDownloads: string; + }; + deepforest: { + prettyLabel: string; + repoName: string; + docsUrl: string; + repoUrl: string; + }; + "depth-anything-v2": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + "depth-pro": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + "derm-foundation": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: () => string[]; + filter: false; + countDownloads: string; + }; + "describe-anything": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + "dia-tts": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + dia2: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + "diff-interpretation-tuning": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + diffree: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + diffusers: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + diffusionkit: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + }; + "docking-at-home": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + doctr: { + prettyLabel: string; + repoName: string; + repoUrl: string; + }; + edsnlp: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + snippets: (model: ModelData) => string[]; + countDownloads: string; + }; + elm: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + espnet: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + fairseq: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + fastai: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + fastprint: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + fasttext: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + fixer: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + flair: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + fme: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + countDownloads: string; + }; + "gemma.cpp": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "geometry-crafter": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + gliner: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + gliner2: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + "glm-tts": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "glyph-byt5": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + grok: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "habibi-tts": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + hallo: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + hermes: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + hezar: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + countDownloads: string; + }; + htrflow: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + }; + "hunyuan-dit": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + "hunyuan3d-2": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + "hunyuanworld-voyager": { + prettyLabel: string; + repoName: string; + repoUrl: string; + }; + "hy-worldplay": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "image-matching-models": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + imstoucan: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + "index-tts": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + infinitetalk: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "infinite-you": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + intellifold: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + keras: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + "tf-keras": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + countDownloads: string; + }; + "keras-hub": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + kernels: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + countDownloads: string; + }; + "kimi-audio": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + kittentts: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + }; + kronos: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + k2: { + prettyLabel: string; + repoName: string; + repoUrl: string; + }; + "lightning-ir": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + }; + litert: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "litert-lm": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + lerobot: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + snippets: (model: ModelData) => string[]; + }; + lightglue: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + liveportrait: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "llama-cpp-python": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + }; + "mini-omni2": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + mindspore: { + prettyLabel: string; + repoName: string; + repoUrl: string; + }; + "magi-1": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + "magenta-realtime": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + "mamba-ssm": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + snippets: (model: ModelData) => string[]; + }; + "mars5-tts": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + matanyone: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + "mesh-anything": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + snippets: () => string[]; + }; + merlin: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + medvae: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + mitie: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + "ml-agents": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + "ml-sharp": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + mlx: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + "mlx-image": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + "mlc-llm": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + countDownloads: string; + }; + model2vec: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + moshi: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + mtvcraft: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + nemo: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + "open-oasis": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + open_clip: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + openpeerllm: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + countDownloads: string; + filter: false; + }; + "open-sora": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + outetts: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + paddlenlp: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + PaddleOCR: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + peft: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + "perception-encoder": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + snippets: (model: ModelData) => string[]; + countDownloads: string; + }; + "phantom-wan": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + "pocket-tts": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + countDownloads: string; + }; + "pruna-ai": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + docsUrl: string; + }; + pxia: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + "pyannote-audio": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + "py-feat": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + }; + pythae: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + quantumpeer: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + qwen3_tts: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + recurrentgemma: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + relik: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + refiners: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + countDownloads: string; + }; + renderformer: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + reverb: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + }; + rkllm: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + saelens: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: () => string[]; + filter: false; + }; + sam2: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + snippets: (model: ModelData) => string[]; + countDownloads: string; + }; + "sam-3d-body": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + snippets: (model: ModelData) => string[]; + countDownloads: string; + }; + "sam-3d-objects": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + snippets: (model: ModelData) => string[]; + countDownloads: string; + }; + same: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "sample-factory": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + "sap-rpt-1-oss": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + snippets: () => string[]; + }; + sapiens: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + seedvr: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "self-forcing": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "sentence-transformers": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + setfit: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + sklearn: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + spacy: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + "span-marker": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + speechbrain: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + "ssr-speech": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "stable-audio-tools": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + monkeyocr: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "diffusion-single-file": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "seed-story": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + snippets: () => string[]; + }; + soloaudio: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + songbloom: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "stable-baselines3": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + stanza: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + supertonic: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: () => string[]; + filter: false; + }; + swarmformer: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + "f5-tts": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + genmo: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "tencent-song-generation": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + tensorflowtts: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + }; + tensorrt: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + tabpfn: { + prettyLabel: string; + repoName: string; + repoUrl: string; + }; + terratorch: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + "tic-clip": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + timesfm: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + timm: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + tirex: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + torchgeo: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + countDownloads: string; + }; + transformers: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + "transformers.js": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + }; + trellis: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + ultralytics: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + filter: false; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + univa: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: true; + countDownloads: string; + }; + "uni-3dar": { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + countDownloads: string; + }; + "unity-sentis": { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: () => string[]; + filter: true; + countDownloads: string; + }; + sana: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + videoprism: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + "vfi-mamba": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + vismatch: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + lvface: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + voicecraft: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + }; + voxcpm: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + vui: { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + snippets: () => string[]; + }; + vibevoice: { + prettyLabel: string; + repoName: string; + repoUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + videox_fun: { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + }; + "wan2.2": { + prettyLabel: string; + repoName: string; + repoUrl: string; + countDownloads: string; + }; + wham: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + countDownloads: string; + }; + whisperkit: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: () => string[]; + countDownloads: string; + }; + yolov10: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; + yolov26: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + countDownloads: string; + }; + zonos: { + prettyLabel: string; + repoName: string; + repoUrl: string; + docsUrl: string; + snippets: (model: ModelData) => string[]; + filter: false; + }; + "3dtopia-xl": { + prettyLabel: string; + repoName: string; + repoUrl: string; + filter: false; + countDownloads: string; + snippets: (model: ModelData) => string[]; + }; +}; +export type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS; +export declare const ALL_MODEL_LIBRARY_KEYS: ModelLibraryKey[]; +export declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("acestep" | "adapter-transformers" | "allennlp" | "anemoi" | "araclip" | "aviation-ner" | "asteroid" | "audiocraft" | "audioseal" | "bagel-mot" | "bboxmaskpose" | "ben2" | "bertopic" | "big_vision" | "birder" | "birefnet" | "bm25s" | "boltzgen" | "cancertathomev2" | "cartesia_pytorch" | "cartesia_mlx" | "champ" | "chatterbox" | "chaossim" | "chat_tts" | "chronos-forecasting" | "clara" | "clipscope" | "cloud-agents" | "colipri" | "cosyvoice" | "cotracker" | "colpali" | "comet" | "cosmos" | "cxr-foundation" | "deepforest" | "depth-anything-v2" | "depth-pro" | "derm-foundation" | "describe-anything" | "dia-tts" | "dia2" | "diff-interpretation-tuning" | "diffree" | "diffusers" | "diffusionkit" | "docking-at-home" | "doctr" | "edsnlp" | "elm" | "espnet" | "fairseq" | "fastai" | "fastprint" | "fasttext" | "fixer" | "flair" | "fme" | "gemma.cpp" | "geometry-crafter" | "gliner" | "gliner2" | "glm-tts" | "glyph-byt5" | "grok" | "habibi-tts" | "hallo" | "hermes" | "hezar" | "htrflow" | "hunyuan-dit" | "hunyuan3d-2" | "hunyuanworld-voyager" | "hy-worldplay" | "image-matching-models" | "imstoucan" | "index-tts" | "infinitetalk" | "infinite-you" | "intellifold" | "keras" | "tf-keras" | "keras-hub" | "kernels" | "kimi-audio" | "kittentts" | "kronos" | "k2" | "lightning-ir" | "litert" | "litert-lm" | "lerobot" | "lightglue" | "liveportrait" | "llama-cpp-python" | "mini-omni2" | "mindspore" | "magi-1" | "magenta-realtime" | "mamba-ssm" | "mars5-tts" | "matanyone" | "mesh-anything" | "merlin" | "medvae" | "mitie" | "ml-agents" | "ml-sharp" | "mlx" | "mlx-image" | "mlc-llm" | "model2vec" | "moshi" | "mtvcraft" | "nemo" | "open-oasis" | "open_clip" | "openpeerllm" | "open-sora" | "outetts" | "paddlenlp" | "PaddleOCR" | "peft" | "perception-encoder" | "phantom-wan" | "pocket-tts" | "pruna-ai" | "pxia" | "pyannote-audio" | "py-feat" | "pythae" | "quantumpeer" | "qwen3_tts" | "recurrentgemma" | "relik" | "refiners" | "renderformer" | "reverb" | "rkllm" | "saelens" | "sam2" | "sam-3d-body" | "sam-3d-objects" | "same" | "sample-factory" | "sap-rpt-1-oss" | "sapiens" | "seedvr" | "self-forcing" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "speechbrain" | "ssr-speech" | "stable-audio-tools" | "monkeyocr" | "diffusion-single-file" | "seed-story" | "soloaudio" | "songbloom" | "stable-baselines3" | "stanza" | "supertonic" | "swarmformer" | "f5-tts" | "genmo" | "tencent-song-generation" | "tensorflowtts" | "tensorrt" | "tabpfn" | "terratorch" | "tic-clip" | "timesfm" | "timm" | "tirex" | "torchgeo" | "transformers" | "transformers.js" | "trellis" | "ultralytics" | "univa" | "uni-3dar" | "unity-sentis" | "sana" | "videoprism" | "vfi-mamba" | "vismatch" | "lvface" | "voicecraft" | "voxcpm" | "vui" | "vibevoice" | "videox_fun" | "wan2.2" | "wham" | "whisperkit" | "yolov10" | "yolov26" | "zonos" | "3dtopia-xl")[]; +//# sourceMappingURL=model-libraries.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..706cd36bbfa4c3a4369149af832b4c6b4c67e432 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"model-libraries.d.ts","sourceRoot":"","sources":["../../src/model-libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,EAAE,CAAC;IAC1C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAq8CI,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,EAA+C,eAAe,EAAE,CAAC;AAEpG,eAAO,MAAM,8BAA8B,izFAQ1B,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.js b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.js new file mode 100644 index 0000000000000000000000000000000000000000..1504e707d1baa8d4c984ee34b1f834c5671c0e4e --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/model-libraries.js @@ -0,0 +1,1534 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ALL_DISPLAY_MODEL_LIBRARY_KEYS = exports.ALL_MODEL_LIBRARY_KEYS = exports.MODEL_LIBRARIES_UI_ELEMENTS = void 0; +const snippets = __importStar(require("./model-libraries-snippets.js")); +/** + * Add your new library here. + * + * This is for modeling (= architectures) libraries, not for file formats (like ONNX, etc). + * (unlike libraries, file formats live in an enum inside the internal codebase.) + * + * Doc on how to add a library to the Hub: + * + * https://huggingface.co/docs/hub/models-adding-libraries + * + * /!\ IMPORTANT + * + * The key you choose is the tag your models have in their library_name on the Hub. + */ +exports.MODEL_LIBRARIES_UI_ELEMENTS = { + acestep: { + prettyLabel: "ACE-Step", + repoName: "ACE-Step", + repoUrl: "https://github.com/ace-step/ACE-Step", + filter: false, + countDownloads: `path:"ace_step_transformer/config.json"`, + }, + "adapter-transformers": { + prettyLabel: "Adapters", + repoName: "adapters", + repoUrl: "https://github.com/Adapter-Hub/adapters", + docsUrl: "https://huggingface.co/docs/hub/adapters", + snippets: snippets.adapters, + filter: true, + countDownloads: `path:"adapter_config.json"`, + }, + allennlp: { + prettyLabel: "AllenNLP", + repoName: "AllenNLP", + repoUrl: "https://github.com/allenai/allennlp", + docsUrl: "https://huggingface.co/docs/hub/allennlp", + snippets: snippets.allennlp, + filter: true, + }, + anemoi: { + prettyLabel: "AnemoI", + repoName: "AnemoI", + repoUrl: "https://github.com/ecmwf/anemoi-inference", + docsUrl: "https://anemoi.readthedocs.io/en/latest/", + filter: false, + countDownloads: `path_extension:"ckpt"`, + snippets: snippets.anemoi, + }, + araclip: { + prettyLabel: "AraClip", + repoName: "AraClip", + repoUrl: "https://huggingface.co/Arabic-Clip/araclip", + filter: false, + snippets: snippets.araclip, + }, + "aviation-ner": { + prettyLabel: "Aviation NER", + repoName: "Aviation NER", + repoUrl: "https://github.com/Boeing/aviation_ner_sdr", + docsUrl: "https://github.com/Boeing/aviation_ner_sdr", + countDownloads: `path:"gliner_config.json"`, + filter: false, + }, + asteroid: { + prettyLabel: "Asteroid", + repoName: "Asteroid", + repoUrl: "https://github.com/asteroid-team/asteroid", + docsUrl: "https://huggingface.co/docs/hub/asteroid", + snippets: snippets.asteroid, + filter: true, + countDownloads: `path:"pytorch_model.bin"`, + }, + audiocraft: { + prettyLabel: "Audiocraft", + repoName: "audiocraft", + repoUrl: "https://github.com/facebookresearch/audiocraft", + snippets: snippets.audiocraft, + filter: false, + countDownloads: `path:"state_dict.bin"`, + }, + audioseal: { + prettyLabel: "AudioSeal", + repoName: "audioseal", + repoUrl: "https://github.com/facebookresearch/audioseal", + filter: false, + countDownloads: `path_extension:"pth"`, + snippets: snippets.audioseal, + }, + "bagel-mot": { + prettyLabel: "Bagel", + repoName: "Bagel", + repoUrl: "https://github.com/ByteDance-Seed/Bagel/", + filter: false, + countDownloads: `path:"llm_config.json"`, + }, + bboxmaskpose: { + prettyLabel: "BBoxMaskPose", + repoName: "BBoxMaskPose", + repoUrl: "https://github.com/MiraPurkrabek/BBoxMaskPose", + filter: false, + countDownloads: `path_extension:"pth"`, + }, + ben2: { + prettyLabel: "BEN2", + repoName: "BEN2", + repoUrl: "https://github.com/PramaLLC/BEN2", + snippets: snippets.ben2, + filter: false, + }, + bertopic: { + prettyLabel: "BERTopic", + repoName: "BERTopic", + repoUrl: "https://github.com/MaartenGr/BERTopic", + snippets: snippets.bertopic, + filter: true, + }, + big_vision: { + prettyLabel: "Big Vision", + repoName: "big_vision", + repoUrl: "https://github.com/google-research/big_vision", + filter: false, + countDownloads: `path_extension:"npz"`, + }, + birder: { + prettyLabel: "Birder", + repoName: "Birder", + repoUrl: "https://gitlab.com/birder/birder", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + birefnet: { + prettyLabel: "BiRefNet", + repoName: "BiRefNet", + repoUrl: "https://github.com/ZhengPeng7/BiRefNet", + snippets: snippets.birefnet, + filter: false, + }, + bm25s: { + prettyLabel: "BM25S", + repoName: "bm25s", + repoUrl: "https://github.com/xhluca/bm25s", + snippets: snippets.bm25s, + filter: false, + countDownloads: `path:"params.index.json"`, + }, + boltzgen: { + prettyLabel: "BoltzGen", + repoName: "BoltzGen", + repoUrl: "https://github.com/HannesStark/boltzgen", + filter: false, + countDownloads: `path:"boltzgen1_diverse.ckpt"`, + }, + cancertathomev2: { + prettyLabel: "Cancer@HomeV2", + repoName: "Cancer@HomeV2", + repoUrl: "https://huggingface.co/OpenPeerAI/CancerAtHomeV2", + filter: false, + countDownloads: `path:"run.py"`, + }, + cartesia_pytorch: { + prettyLabel: "Cartesia Pytorch", + repoName: "Cartesia Pytorch", + repoUrl: "https://github.com/cartesia-ai/cartesia_pytorch", + snippets: snippets.cartesia_pytorch, + }, + cartesia_mlx: { + prettyLabel: "Cartesia MLX", + repoName: "Cartesia MLX", + repoUrl: "https://github.com/cartesia-ai/cartesia_mlx", + snippets: snippets.cartesia_mlx, + }, + champ: { + prettyLabel: "Champ", + repoName: "Champ", + repoUrl: "https://github.com/fudan-generative-vision/champ", + countDownloads: `path:"champ/motion_module.pth"`, + }, + chatterbox: { + prettyLabel: "Chatterbox", + repoName: "Chatterbox", + repoUrl: "https://github.com/resemble-ai/chatterbox", + snippets: snippets.chatterbox, + countDownloads: `path:"tokenizer.json"`, + filter: false, + }, + chaossim: { + prettyLabel: "ChaosSIM", + repoName: "ChaosSIM", + repoUrl: "https://huggingface.co/OpenPeerAI/ChaosSIM/", + countDownloads: `path:"ChaosSim.nb"`, + filter: false, + }, + chat_tts: { + prettyLabel: "ChatTTS", + repoName: "ChatTTS", + repoUrl: "https://github.com/2noise/ChatTTS.git", + snippets: snippets.chattts, + filter: false, + countDownloads: `path:"asset/GPT.pt"`, + }, + "chronos-forecasting": { + prettyLabel: "Chronos", + repoName: "Chronos", + repoUrl: "https://github.com/amazon-science/chronos-forecasting", + snippets: snippets.chronos_forecasting, + }, + clara: { + prettyLabel: "Clara", + repoName: "Clara", + filter: false, + repoUrl: "https://github.com/nvidia/clara", + countDownloads: `path_extension:"ckpt" OR path:"config.json"`, + }, + clipscope: { + prettyLabel: "clipscope", + repoName: "clipscope", + repoUrl: "https://github.com/Lewington-pitsos/clipscope", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + "cloud-agents": { + prettyLabel: "Cloud Agents", + repoName: "Cloud Agents", + repoUrl: "https://huggingface.co/OpenPeerAI/Cloud-Agents", + filter: false, + countDownloads: `path:"setup.py"`, + }, + colipri: { + prettyLabel: "COLIPRI", + repoName: "COLIPRI", + repoUrl: "https://huggingface.co/microsoft/colipri", + snippets: snippets.colipri, + filter: false, + countDownloads: `path_extension:"safetensors"`, + }, + cosyvoice: { + prettyLabel: "CosyVoice", + repoName: "CosyVoice", + repoUrl: "https://github.com/FunAudioLLM/CosyVoice", + filter: false, + countDownloads: `path_extension:"onnx" OR path_extension:"pt"`, + }, + cotracker: { + prettyLabel: "CoTracker", + repoName: "CoTracker", + repoUrl: "https://github.com/facebookresearch/co-tracker", + filter: false, + countDownloads: `path_extension:"pth"`, + }, + colpali: { + prettyLabel: "ColPali", + repoName: "ColPali", + repoUrl: "https://github.com/ManuelFay/colpali", + filter: false, + countDownloads: `path:"adapter_config.json"`, + }, + comet: { + prettyLabel: "COMET", + repoName: "COMET", + repoUrl: "https://github.com/Unbabel/COMET/", + countDownloads: `path:"hparams.yaml"`, + }, + cosmos: { + prettyLabel: "Cosmos", + repoName: "Cosmos", + repoUrl: "https://github.com/NVIDIA/Cosmos", + countDownloads: `path:"config.json" OR path_extension:"pt"`, + }, + "cxr-foundation": { + prettyLabel: "CXR Foundation", + repoName: "cxr-foundation", + repoUrl: "https://github.com/google-health/cxr-foundation", + snippets: snippets.cxr_foundation, + filter: false, + countDownloads: `path:"precomputed_embeddings/embeddings.npz" OR path:"pax-elixr-b-text/saved_model.pb"`, + }, + deepforest: { + prettyLabel: "DeepForest", + repoName: "deepforest", + docsUrl: "https://deepforest.readthedocs.io/en/latest/", + repoUrl: "https://github.com/weecology/DeepForest", + }, + "depth-anything-v2": { + prettyLabel: "DepthAnythingV2", + repoName: "Depth Anything V2", + repoUrl: "https://github.com/DepthAnything/Depth-Anything-V2", + snippets: snippets.depth_anything_v2, + filter: false, + countDownloads: `path_extension:"pth"`, + }, + "depth-pro": { + prettyLabel: "Depth Pro", + repoName: "Depth Pro", + repoUrl: "https://github.com/apple/ml-depth-pro", + countDownloads: `path_extension:"pt"`, + snippets: snippets.depth_pro, + filter: false, + }, + "derm-foundation": { + prettyLabel: "Derm Foundation", + repoName: "derm-foundation", + repoUrl: "https://github.com/google-health/derm-foundation", + snippets: snippets.derm_foundation, + filter: false, + countDownloads: `path:"scin_dataset_precomputed_embeddings.npz" OR path:"saved_model.pb"`, + }, + "describe-anything": { + prettyLabel: "Describe Anything", + repoName: "Describe Anything", + repoUrl: "https://github.com/NVlabs/describe-anything", + snippets: snippets.describe_anything, + filter: false, + }, + "dia-tts": { + prettyLabel: "Dia", + repoName: "Dia", + repoUrl: "https://github.com/nari-labs/dia", + snippets: snippets.dia, + filter: false, + }, + dia2: { + prettyLabel: "Dia2", + repoName: "Dia2", + repoUrl: "https://github.com/nari-labs/dia2", + snippets: snippets.dia2, + filter: false, + }, + "diff-interpretation-tuning": { + prettyLabel: "Diff Interpretation Tuning", + repoName: "Diff Interpretation Tuning", + repoUrl: "https://github.com/Aviously/diff-interpretation-tuning", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + diffree: { + prettyLabel: "Diffree", + repoName: "Diffree", + repoUrl: "https://github.com/OpenGVLab/Diffree", + filter: false, + countDownloads: `path:"diffree-step=000010999.ckpt"`, + }, + diffusers: { + prettyLabel: "Diffusers", + repoName: "🤗/diffusers", + repoUrl: "https://github.com/huggingface/diffusers", + docsUrl: "https://huggingface.co/docs/hub/diffusers", + snippets: snippets.diffusers, + filter: true, + /// diffusers has its own more complex "countDownloads" query + }, + diffusionkit: { + prettyLabel: "DiffusionKit", + repoName: "DiffusionKit", + repoUrl: "https://github.com/argmaxinc/DiffusionKit", + snippets: snippets.diffusionkit, + }, + "docking-at-home": { + prettyLabel: "Docking@Home", + repoName: "Docking@Home", + repoUrl: "https://huggingface.co/OpenPeerAI/DockingAtHOME", + filter: false, + countDownloads: `path:"setup.py"`, + }, + doctr: { + prettyLabel: "docTR", + repoName: "doctr", + repoUrl: "https://github.com/mindee/doctr", + }, + edsnlp: { + prettyLabel: "EDS-NLP", + repoName: "edsnlp", + repoUrl: "https://github.com/aphp/edsnlp", + docsUrl: "https://aphp.github.io/edsnlp/latest/", + filter: false, + snippets: snippets.edsnlp, + countDownloads: `path_filename:"config" AND path_extension:"cfg"`, + }, + elm: { + prettyLabel: "ELM", + repoName: "elm", + repoUrl: "https://github.com/slicex-ai/elm", + filter: false, + countDownloads: `path_filename:"slicex_elm_config" AND path_extension:"json"`, + }, + espnet: { + prettyLabel: "ESPnet", + repoName: "ESPnet", + repoUrl: "https://github.com/espnet/espnet", + docsUrl: "https://huggingface.co/docs/hub/espnet", + snippets: snippets.espnet, + filter: true, + }, + fairseq: { + prettyLabel: "Fairseq", + repoName: "fairseq", + repoUrl: "https://github.com/pytorch/fairseq", + snippets: snippets.fairseq, + filter: true, + }, + fastai: { + prettyLabel: "fastai", + repoName: "fastai", + repoUrl: "https://github.com/fastai/fastai", + docsUrl: "https://huggingface.co/docs/hub/fastai", + snippets: snippets.fastai, + filter: true, + }, + fastprint: { + prettyLabel: "Fast Print", + repoName: "Fast Print", + repoUrl: "https://huggingface.co/OpenPeerAI/FastPrint", + countDownloads: `path_extension:"cs"`, + }, + fasttext: { + prettyLabel: "fastText", + repoName: "fastText", + repoUrl: "https://fasttext.cc/", + snippets: snippets.fasttext, + filter: true, + countDownloads: `path_extension:"bin"`, + }, + fixer: { + prettyLabel: "Fixer", + repoName: "Fixer", + repoUrl: "https://github.com/nv-tlabs/Fixer", + filter: false, + countDownloads: `path:"pretrained/pretrained_fixer.pkl"`, + }, + flair: { + prettyLabel: "Flair", + repoName: "Flair", + repoUrl: "https://github.com/flairNLP/flair", + docsUrl: "https://huggingface.co/docs/hub/flair", + snippets: snippets.flair, + filter: true, + countDownloads: `path:"pytorch_model.bin"`, + }, + fme: { + prettyLabel: "Full Model Emulation", + repoName: "Full Model Emulation", + repoUrl: "https://github.com/ai2cm/ace", + docsUrl: "https://ai2-climate-emulator.readthedocs.io/en/latest/", + filter: false, + countDownloads: `path_extension:"tar"`, + }, + "gemma.cpp": { + prettyLabel: "gemma.cpp", + repoName: "gemma.cpp", + repoUrl: "https://github.com/google/gemma.cpp", + filter: false, + countDownloads: `path_extension:"sbs"`, + }, + "geometry-crafter": { + prettyLabel: "GeometryCrafter", + repoName: "GeometryCrafter", + repoUrl: "https://github.com/TencentARC/GeometryCrafter", + countDownloads: `path:"point_map_vae/diffusion_pytorch_model.safetensors"`, + }, + gliner: { + prettyLabel: "GLiNER", + repoName: "GLiNER", + repoUrl: "https://github.com/urchade/GLiNER", + snippets: snippets.gliner, + filter: false, + countDownloads: `path:"gliner_config.json"`, + }, + gliner2: { + prettyLabel: "GLiNER2", + repoName: "GLiNER2", + repoUrl: "https://github.com/fastino-ai/GLiNER2", + snippets: snippets.gliner2, + filter: false, + }, + "glm-tts": { + prettyLabel: "GLM-TTS", + repoName: "GLM-TTS", + repoUrl: "https://github.com/zai-org/GLM-TTS", + filter: false, + countDownloads: `path:"flow/flow.pt"`, + }, + "glyph-byt5": { + prettyLabel: "Glyph-ByT5", + repoName: "Glyph-ByT5", + repoUrl: "https://github.com/AIGText/Glyph-ByT5", + filter: false, + countDownloads: `path:"checkpoints/byt5_model.pt"`, + }, + grok: { + prettyLabel: "Grok", + repoName: "Grok", + repoUrl: "https://github.com/xai-org/grok-1", + filter: false, + countDownloads: `path:"ckpt/tensor00000_000" OR path:"ckpt-0/tensor00000_000"`, + }, + "habibi-tts": { + prettyLabel: "Habibi-TTS", + repoName: "Habibi-TTS", + repoUrl: "https://github.com/SWivid/Habibi-TTS", + filter: false, + countDownloads: `path_extension:"safetensors"`, + }, + hallo: { + prettyLabel: "Hallo", + repoName: "Hallo", + repoUrl: "https://github.com/fudan-generative-vision/hallo", + countDownloads: `path:"hallo/net.pth"`, + }, + hermes: { + prettyLabel: "HERMES", + repoName: "HERMES", + repoUrl: "https://github.com/LMD0311/HERMES", + filter: false, + countDownloads: `path:"ckpt/hermes_final.pth"`, + }, + hezar: { + prettyLabel: "Hezar", + repoName: "Hezar", + repoUrl: "https://github.com/hezarai/hezar", + docsUrl: "https://hezarai.github.io/hezar", + countDownloads: `path:"model_config.yaml" OR path:"embedding/embedding_config.yaml"`, + }, + htrflow: { + prettyLabel: "HTRflow", + repoName: "HTRflow", + repoUrl: "https://github.com/AI-Riksarkivet/htrflow", + docsUrl: "https://ai-riksarkivet.github.io/htrflow", + snippets: snippets.htrflow, + }, + "hunyuan-dit": { + prettyLabel: "HunyuanDiT", + repoName: "HunyuanDiT", + repoUrl: "https://github.com/Tencent/HunyuanDiT", + countDownloads: `path:"pytorch_model_ema.pt" OR path:"pytorch_model_distill.pt"`, + }, + "hunyuan3d-2": { + prettyLabel: "Hunyuan3D-2", + repoName: "Hunyuan3D-2", + repoUrl: "https://github.com/Tencent/Hunyuan3D-2", + countDownloads: `path_filename:"model_index" OR path_filename:"config"`, + }, + "hunyuanworld-voyager": { + prettyLabel: "HunyuanWorld-voyager", + repoName: "HunyuanWorld-voyager", + repoUrl: "https://github.com/Tencent-Hunyuan/HunyuanWorld-Voyager", + }, + "hy-worldplay": { + prettyLabel: "HY-WorldPlay", + repoName: "HY-WorldPlay", + repoUrl: "https://github.com/Tencent-Hunyuan/HY-WorldPlay", + filter: false, + countDownloads: `path_extension:"json"`, + }, + "image-matching-models": { + prettyLabel: "Image Matching Models", + repoName: "Image Matching Models", + repoUrl: "https://github.com/alexstoken/image-matching-models", + filter: false, + countDownloads: `path_extension:"safetensors"`, + }, + imstoucan: { + prettyLabel: "IMS Toucan", + repoName: "IMS-Toucan", + repoUrl: "https://github.com/DigitalPhonetics/IMS-Toucan", + countDownloads: `path:"embedding_gan.pt" OR path:"Vocoder.pt" OR path:"ToucanTTS.pt"`, + }, + "index-tts": { + prettyLabel: "IndexTTS", + repoName: "IndexTTS", + repoUrl: "https://github.com/index-tts/index-tts", + snippets: snippets.indextts, + filter: false, + }, + infinitetalk: { + prettyLabel: "InfiniteTalk", + repoName: "InfiniteTalk", + repoUrl: "https://github.com/MeiGen-AI/InfiniteTalk", + filter: false, + countDownloads: `path_extension:"safetensors"`, + }, + "infinite-you": { + prettyLabel: "InfiniteYou", + repoName: "InfiniteYou", + repoUrl: "https://github.com/bytedance/InfiniteYou", + filter: false, + countDownloads: `path:"infu_flux_v1.0/sim_stage1/image_proj_model.bin" OR path:"infu_flux_v1.0/aes_stage2/image_proj_model.bin"`, + }, + intellifold: { + prettyLabel: "IntelliFold", + repoName: "IntelliFold", + repoUrl: "https://github.com/IntelliGen-AI/IntelliFold", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + keras: { + prettyLabel: "Keras", + repoName: "Keras", + repoUrl: "https://github.com/keras-team/keras", + docsUrl: "https://huggingface.co/docs/hub/keras", + snippets: snippets.keras, + filter: true, + countDownloads: `path:"config.json" OR path_extension:"keras"`, + }, + "tf-keras": { + // Legacy "Keras 2" library (tensorflow-only) + prettyLabel: "TF-Keras", + repoName: "TF-Keras", + repoUrl: "https://github.com/keras-team/tf-keras", + docsUrl: "https://huggingface.co/docs/hub/tf-keras", + snippets: snippets.tf_keras, + countDownloads: `path:"saved_model.pb"`, + }, + "keras-hub": { + prettyLabel: "KerasHub", + repoName: "KerasHub", + repoUrl: "https://github.com/keras-team/keras-hub", + docsUrl: "https://keras.io/keras_hub/", + snippets: snippets.keras_hub, + filter: true, + }, + kernels: { + prettyLabel: "Kernels", + repoName: "Kernels", + repoUrl: "https://github.com/huggingface/kernels", + docsUrl: "https://huggingface.co/docs/kernels", + snippets: snippets.kernels, + countDownloads: `path_filename:"_ops" AND path_extension:"py"`, + }, + "kimi-audio": { + prettyLabel: "KimiAudio", + repoName: "KimiAudio", + repoUrl: "https://github.com/MoonshotAI/Kimi-Audio", + snippets: snippets.kimi_audio, + filter: false, + }, + kittentts: { + prettyLabel: "KittenTTS", + repoName: "KittenTTS", + repoUrl: "https://github.com/KittenML/KittenTTS", + snippets: snippets.kittentts, + }, + kronos: { + prettyLabel: "KRONOS", + repoName: "KRONOS", + repoUrl: "https://github.com/mahmoodlab/KRONOS", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + k2: { + prettyLabel: "K2", + repoName: "k2", + repoUrl: "https://github.com/k2-fsa/k2", + }, + "lightning-ir": { + prettyLabel: "Lightning IR", + repoName: "Lightning IR", + repoUrl: "https://github.com/webis-de/lightning-ir", + snippets: snippets.lightning_ir, + }, + litert: { + prettyLabel: "LiteRT", + repoName: "LiteRT", + repoUrl: "https://github.com/google-ai-edge/LiteRT", + filter: false, + countDownloads: `path_extension:"tflite"`, + }, + "litert-lm": { + prettyLabel: "LiteRT-LM", + repoName: "LiteRT-LM", + repoUrl: "https://github.com/google-ai-edge/LiteRT-LM", + filter: false, + countDownloads: `path_extension:"litertlm" OR path_extension:"task"`, + }, + lerobot: { + prettyLabel: "LeRobot", + repoName: "LeRobot", + repoUrl: "https://github.com/huggingface/lerobot", + docsUrl: "https://huggingface.co/docs/lerobot", + filter: false, + snippets: snippets.lerobot, + }, + lightglue: { + prettyLabel: "LightGlue", + repoName: "LightGlue", + repoUrl: "https://github.com/cvg/LightGlue", + filter: false, + countDownloads: `path_extension:"pth" OR path:"config.json"`, + }, + liveportrait: { + prettyLabel: "LivePortrait", + repoName: "LivePortrait", + repoUrl: "https://github.com/KwaiVGI/LivePortrait", + filter: false, + countDownloads: `path:"liveportrait/landmark.onnx"`, + }, + "llama-cpp-python": { + prettyLabel: "llama-cpp-python", + repoName: "llama-cpp-python", + repoUrl: "https://github.com/abetlen/llama-cpp-python", + snippets: snippets.llama_cpp_python, + }, + "mini-omni2": { + prettyLabel: "Mini-Omni2", + repoName: "Mini-Omni2", + repoUrl: "https://github.com/gpt-omni/mini-omni2", + countDownloads: `path:"model_config.yaml"`, + }, + mindspore: { + prettyLabel: "MindSpore", + repoName: "mindspore", + repoUrl: "https://github.com/mindspore-ai/mindspore", + }, + "magi-1": { + prettyLabel: "MAGI-1", + repoName: "MAGI-1", + repoUrl: "https://github.com/SandAI-org/MAGI-1", + countDownloads: `path:"ckpt/vae/config.json"`, + }, + "magenta-realtime": { + prettyLabel: "Magenta RT", + repoName: "Magenta RT", + repoUrl: "https://github.com/magenta/magenta-realtime", + countDownloads: `path:"checkpoints/llm_base_x4286_c1860k.tar" OR path:"checkpoints/llm_large_x3047_c1860k.tar" OR path:"checkpoints/llm_large_x3047_c1860k/checkpoint"`, + }, + "mamba-ssm": { + prettyLabel: "MambaSSM", + repoName: "MambaSSM", + repoUrl: "https://github.com/state-spaces/mamba", + filter: false, + snippets: snippets.mamba_ssm, + }, + "mars5-tts": { + prettyLabel: "MARS5-TTS", + repoName: "MARS5-TTS", + repoUrl: "https://github.com/Camb-ai/MARS5-TTS", + filter: false, + countDownloads: `path:"mars5_ar.safetensors"`, + snippets: snippets.mars5_tts, + }, + matanyone: { + prettyLabel: "MatAnyone", + repoName: "MatAnyone", + repoUrl: "https://github.com/pq-yang/MatAnyone", + snippets: snippets.matanyone, + filter: false, + }, + "mesh-anything": { + prettyLabel: "MeshAnything", + repoName: "MeshAnything", + repoUrl: "https://github.com/buaacyw/MeshAnything", + filter: false, + countDownloads: `path:"MeshAnything_350m.pth"`, + snippets: snippets.mesh_anything, + }, + merlin: { + prettyLabel: "Merlin", + repoName: "Merlin", + repoUrl: "https://github.com/StanfordMIMI/Merlin", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + medvae: { + prettyLabel: "MedVAE", + repoName: "MedVAE", + repoUrl: "https://github.com/StanfordMIMI/MedVAE", + filter: false, + countDownloads: `path_extension:"ckpt"`, + }, + mitie: { + prettyLabel: "MITIE", + repoName: "MITIE", + repoUrl: "https://github.com/mit-nlp/MITIE", + countDownloads: `path_filename:"total_word_feature_extractor"`, + }, + "ml-agents": { + prettyLabel: "ml-agents", + repoName: "ml-agents", + repoUrl: "https://github.com/Unity-Technologies/ml-agents", + docsUrl: "https://huggingface.co/docs/hub/ml-agents", + snippets: snippets.mlAgents, + filter: true, + countDownloads: `path_extension:"onnx"`, + }, + "ml-sharp": { + prettyLabel: "Sharp", + repoName: "Sharp", + repoUrl: "https://github.com/apple/ml-sharp", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + mlx: { + prettyLabel: "MLX", + repoName: "MLX", + repoUrl: "https://github.com/ml-explore/mlx-examples/tree/main", + snippets: snippets.mlx, + filter: true, + }, + "mlx-image": { + prettyLabel: "mlx-image", + repoName: "mlx-image", + repoUrl: "https://github.com/riccardomusmeci/mlx-image", + docsUrl: "https://huggingface.co/docs/hub/mlx-image", + snippets: snippets.mlxim, + filter: false, + countDownloads: `path:"model.safetensors"`, + }, + "mlc-llm": { + prettyLabel: "MLC-LLM", + repoName: "MLC-LLM", + repoUrl: "https://github.com/mlc-ai/mlc-llm", + docsUrl: "https://llm.mlc.ai/docs/", + filter: false, + countDownloads: `path:"mlc-chat-config.json"`, + }, + model2vec: { + prettyLabel: "Model2Vec", + repoName: "model2vec", + repoUrl: "https://github.com/MinishLab/model2vec", + snippets: snippets.model2vec, + filter: false, + }, + moshi: { + prettyLabel: "Moshi", + repoName: "Moshi", + repoUrl: "https://github.com/kyutai-labs/moshi", + snippets: snippets.moshi, + filter: false, + countDownloads: `path:"tokenizer-e351c8d8-checkpoint125.safetensors"`, + }, + mtvcraft: { + prettyLabel: "MTVCraft", + repoName: "MTVCraft", + repoUrl: "https://github.com/baaivision/MTVCraft", + filter: false, + countDownloads: `path:"vae/3d-vae.pt"`, + }, + nemo: { + prettyLabel: "NeMo", + repoName: "NeMo", + repoUrl: "https://github.com/NVIDIA/NeMo", + snippets: snippets.nemo, + filter: true, + countDownloads: `path_extension:"nemo" OR path:"model_config.yaml" OR path_extension:"json"`, + }, + "open-oasis": { + prettyLabel: "open-oasis", + repoName: "open-oasis", + repoUrl: "https://github.com/etched-ai/open-oasis", + countDownloads: `path:"oasis500m.safetensors"`, + }, + open_clip: { + prettyLabel: "OpenCLIP", + repoName: "OpenCLIP", + repoUrl: "https://github.com/mlfoundations/open_clip", + snippets: snippets.open_clip, + filter: true, + countDownloads: `path:"open_clip_model.safetensors" + OR path:"model.safetensors" + OR path:"open_clip_pytorch_model.bin" + OR path:"pytorch_model.bin"`, + }, + openpeerllm: { + prettyLabel: "OpenPeerLLM", + repoName: "OpenPeerLLM", + repoUrl: "https://huggingface.co/openpeerai/openpeerllm", + docsUrl: "https://huggingface.co/OpenPeerAI/OpenPeerLLM/blob/main/README.md", + countDownloads: `path:".meta-huggingface.json"`, + filter: false, + }, + "open-sora": { + prettyLabel: "Open-Sora", + repoName: "Open-Sora", + repoUrl: "https://github.com/hpcaitech/Open-Sora", + filter: false, + countDownloads: `path:"Open_Sora_v2.safetensors"`, + }, + outetts: { + prettyLabel: "OuteTTS", + repoName: "OuteTTS", + repoUrl: "https://github.com/edwko/OuteTTS", + snippets: snippets.outetts, + filter: false, + }, + paddlenlp: { + prettyLabel: "paddlenlp", + repoName: "PaddleNLP", + repoUrl: "https://github.com/PaddlePaddle/PaddleNLP", + docsUrl: "https://huggingface.co/docs/hub/paddlenlp", + snippets: snippets.paddlenlp, + filter: true, + countDownloads: `path:"model_config.json"`, + }, + PaddleOCR: { + prettyLabel: "PaddleOCR", + repoName: "PaddleOCR", + repoUrl: "https://github.com/PaddlePaddle/PaddleOCR", + docsUrl: "https://www.paddleocr.ai/", + snippets: snippets.paddleocr, + filter: true, + countDownloads: `path_extension:"safetensors" OR path:"inference.pdiparams"`, + }, + peft: { + prettyLabel: "PEFT", + repoName: "PEFT", + repoUrl: "https://github.com/huggingface/peft", + snippets: snippets.peft, + filter: true, + countDownloads: `path:"adapter_config.json"`, + }, + "perception-encoder": { + prettyLabel: "PerceptionEncoder", + repoName: "PerceptionModels", + repoUrl: "https://github.com/facebookresearch/perception_models", + filter: false, + snippets: snippets.perception_encoder, + countDownloads: `path_extension:"pt"`, + }, + "phantom-wan": { + prettyLabel: "Phantom", + repoName: "Phantom", + repoUrl: "https://github.com/Phantom-video/Phantom", + snippets: snippets.phantom_wan, + filter: false, + countDownloads: `path_extension:"pth"`, + }, + "pocket-tts": { + prettyLabel: "Pocket-TTS", + repoName: "PocketTTS", + repoUrl: "https://github.com/kyutai-labs/pocket-tts", + snippets: snippets.pocket_tts, + filter: false, + countDownloads: `path:"tts_b6369a24.safetensors"`, + }, + "pruna-ai": { + prettyLabel: "Pruna AI", + repoName: "Pruna AI", + repoUrl: "https://github.com/PrunaAI/pruna", + snippets: snippets.pruna, + docsUrl: "https://docs.pruna.ai", + }, + pxia: { + prettyLabel: "pxia", + repoName: "pxia", + repoUrl: "https://github.com/not-lain/pxia", + snippets: snippets.pxia, + filter: false, + }, + "pyannote-audio": { + prettyLabel: "pyannote.audio", + repoName: "pyannote-audio", + repoUrl: "https://github.com/pyannote/pyannote-audio", + snippets: snippets.pyannote_audio, + filter: true, + }, + "py-feat": { + prettyLabel: "Py-Feat", + repoName: "Py-Feat", + repoUrl: "https://github.com/cosanlab/py-feat", + docsUrl: "https://py-feat.org/", + filter: false, + }, + pythae: { + prettyLabel: "pythae", + repoName: "pythae", + repoUrl: "https://github.com/clementchadebec/benchmark_VAE", + snippets: snippets.pythae, + filter: false, + }, + quantumpeer: { + prettyLabel: "QuantumPeer", + repoName: "QuantumPeer", + repoUrl: "https://github.com/OpenPeer-AI/QuantumPeer", + filter: false, + countDownloads: `path_extension:"setup.py"`, + }, + qwen3_tts: { + prettyLabel: "Qwen3-TTS", + repoName: "Qwen3-TTS", + repoUrl: "https://github.com/QwenLM/Qwen3-TTS", + snippets: snippets.qwen3_tts, + filter: false, + }, + recurrentgemma: { + prettyLabel: "RecurrentGemma", + repoName: "recurrentgemma", + repoUrl: "https://github.com/google-deepmind/recurrentgemma", + filter: false, + countDownloads: `path:"tokenizer.model"`, + }, + relik: { + prettyLabel: "Relik", + repoName: "Relik", + repoUrl: "https://github.com/SapienzaNLP/relik", + snippets: snippets.relik, + filter: false, + }, + refiners: { + prettyLabel: "Refiners", + repoName: "Refiners", + repoUrl: "https://github.com/finegrain-ai/refiners", + docsUrl: "https://refine.rs/", + filter: false, + countDownloads: `path:"model.safetensors"`, + }, + renderformer: { + prettyLabel: "RenderFormer", + repoName: "RenderFormer", + repoUrl: "https://github.com/microsoft/renderformer", + snippets: snippets.renderformer, + filter: false, + }, + reverb: { + prettyLabel: "Reverb", + repoName: "Reverb", + repoUrl: "https://github.com/revdotcom/reverb", + filter: false, + }, + rkllm: { + prettyLabel: "RKLLM", + repoName: "RKLLM", + repoUrl: "https://github.com/airockchip/rknn-llm", + countDownloads: `path_extension:"rkllm"`, + }, + saelens: { + prettyLabel: "SAELens", + repoName: "SAELens", + repoUrl: "https://github.com/jbloomAus/SAELens", + snippets: snippets.saelens, + filter: false, + }, + sam2: { + prettyLabel: "sam2", + repoName: "sam2", + repoUrl: "https://github.com/facebookresearch/segment-anything-2", + filter: false, + snippets: snippets.sam2, + countDownloads: `path_extension:"pt"`, + }, + "sam-3d-body": { + prettyLabel: "SAM 3D Body", + repoName: "SAM 3D Body", + repoUrl: "https://github.com/facebookresearch/sam-3d-body", + filter: false, + snippets: snippets.sam_3d_body, + countDownloads: `path:"model_config.yaml"`, + }, + "sam-3d-objects": { + prettyLabel: "SAM 3D Objects", + repoName: "SAM 3D Objects", + repoUrl: "https://github.com/facebookresearch/sam-3d-objects", + filter: false, + snippets: snippets.sam_3d_objects, + countDownloads: `path:"checkpoints/pipeline.yaml"`, + }, + same: { + prettyLabel: "SAME", + repoName: "SAME", + repoUrl: "https://github.com/GengzeZhou/SAME", + filter: false, + countDownloads: `path:"ckpt/SAME.pt" OR path:"pretrain/Attnq_pretrained_ckpt.pt"`, + }, + "sample-factory": { + prettyLabel: "sample-factory", + repoName: "sample-factory", + repoUrl: "https://github.com/alex-petrenko/sample-factory", + docsUrl: "https://huggingface.co/docs/hub/sample-factory", + snippets: snippets.sampleFactory, + filter: true, + countDownloads: `path:"cfg.json"`, + }, + "sap-rpt-1-oss": { + prettyLabel: "sap-rpt-1-oss", + repoName: "sap-rpt-1-oss", + repoUrl: "https://github.com/SAP-samples/sap-rpt-1-oss", + countDownloads: `path_extension:"pt"`, + snippets: snippets.sap_rpt_one_oss, + }, + sapiens: { + prettyLabel: "sapiens", + repoName: "sapiens", + repoUrl: "https://github.com/facebookresearch/sapiens", + filter: false, + countDownloads: `path_extension:"pt2" OR path_extension:"pth" OR path_extension:"onnx"`, + }, + seedvr: { + prettyLabel: "SeedVR", + repoName: "SeedVR", + repoUrl: "https://github.com/ByteDance-Seed/SeedVR", + filter: false, + countDownloads: `path_extension:"pth"`, + }, + "self-forcing": { + prettyLabel: "SelfForcing", + repoName: "SelfForcing", + repoUrl: "https://github.com/guandeh17/Self-Forcing", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + "sentence-transformers": { + prettyLabel: "sentence-transformers", + repoName: "sentence-transformers", + repoUrl: "https://github.com/UKPLab/sentence-transformers", + docsUrl: "https://huggingface.co/docs/hub/sentence-transformers", + snippets: snippets.sentenceTransformers, + filter: true, + }, + setfit: { + prettyLabel: "setfit", + repoName: "setfit", + repoUrl: "https://github.com/huggingface/setfit", + docsUrl: "https://huggingface.co/docs/hub/setfit", + snippets: snippets.setfit, + filter: true, + }, + sklearn: { + prettyLabel: "Scikit-learn", + repoName: "Scikit-learn", + repoUrl: "https://github.com/scikit-learn/scikit-learn", + snippets: snippets.sklearn, + filter: true, + countDownloads: `path:"sklearn_model.joblib"`, + }, + spacy: { + prettyLabel: "spaCy", + repoName: "spaCy", + repoUrl: "https://github.com/explosion/spaCy", + docsUrl: "https://huggingface.co/docs/hub/spacy", + snippets: snippets.spacy, + filter: true, + countDownloads: `path_extension:"whl"`, + }, + "span-marker": { + prettyLabel: "SpanMarker", + repoName: "SpanMarkerNER", + repoUrl: "https://github.com/tomaarsen/SpanMarkerNER", + docsUrl: "https://huggingface.co/docs/hub/span_marker", + snippets: snippets.span_marker, + filter: true, + }, + speechbrain: { + prettyLabel: "speechbrain", + repoName: "speechbrain", + repoUrl: "https://github.com/speechbrain/speechbrain", + docsUrl: "https://huggingface.co/docs/hub/speechbrain", + snippets: snippets.speechbrain, + filter: true, + countDownloads: `path:"hyperparams.yaml"`, + }, + "ssr-speech": { + prettyLabel: "SSR-Speech", + repoName: "SSR-Speech", + repoUrl: "https://github.com/WangHelin1997/SSR-Speech", + filter: false, + countDownloads: `path_extension:".pth"`, + }, + "stable-audio-tools": { + prettyLabel: "Stable Audio Tools", + repoName: "stable-audio-tools", + repoUrl: "https://github.com/Stability-AI/stable-audio-tools.git", + filter: false, + countDownloads: `path:"model.safetensors"`, + snippets: snippets.stable_audio_tools, + }, + monkeyocr: { + prettyLabel: "MonkeyOCR", + repoName: "monkeyocr", + repoUrl: "https://github.com/Yuliang-Liu/MonkeyOCR", + filter: false, + countDownloads: `path:"Recognition/config.json"`, + }, + "diffusion-single-file": { + prettyLabel: "Diffusion Single File", + repoName: "diffusion-single-file", + repoUrl: "https://github.com/comfyanonymous/ComfyUI", + filter: false, + countDownloads: `path_extension:"safetensors"`, + }, + "seed-story": { + prettyLabel: "SEED-Story", + repoName: "SEED-Story", + repoUrl: "https://github.com/TencentARC/SEED-Story", + filter: false, + countDownloads: `path:"cvlm_llama2_tokenizer/tokenizer.model"`, + snippets: snippets.seed_story, + }, + soloaudio: { + prettyLabel: "SoloAudio", + repoName: "SoloAudio", + repoUrl: "https://github.com/WangHelin1997/SoloAudio", + filter: false, + countDownloads: `path:"soloaudio_v2.pt"`, + }, + songbloom: { + prettyLabel: "SongBloom", + repoName: "SongBloom", + repoUrl: "https://github.com/Cypress-Yang/SongBloom", + filter: false, + countDownloads: `path_extension:"pt"`, + }, + "stable-baselines3": { + prettyLabel: "stable-baselines3", + repoName: "stable-baselines3", + repoUrl: "https://github.com/huggingface/huggingface_sb3", + docsUrl: "https://huggingface.co/docs/hub/stable-baselines3", + snippets: snippets.stableBaselines3, + filter: true, + countDownloads: `path_extension:"zip"`, + }, + stanza: { + prettyLabel: "Stanza", + repoName: "stanza", + repoUrl: "https://github.com/stanfordnlp/stanza", + docsUrl: "https://huggingface.co/docs/hub/stanza", + snippets: snippets.stanza, + filter: true, + countDownloads: `path:"models/default.zip"`, + }, + supertonic: { + prettyLabel: "Supertonic", + repoName: "Supertonic", + repoUrl: "https://github.com/supertone-inc/supertonic", + snippets: snippets.supertonic, + filter: false, + }, + swarmformer: { + prettyLabel: "SwarmFormer", + repoName: "SwarmFormer", + repoUrl: "https://github.com/takara-ai/SwarmFormer", + snippets: snippets.swarmformer, + filter: false, + }, + "f5-tts": { + prettyLabel: "F5-TTS", + repoName: "F5-TTS", + repoUrl: "https://github.com/SWivid/F5-TTS", + filter: false, + countDownloads: `path_extension:"safetensors" OR path_extension:"pt"`, + }, + genmo: { + prettyLabel: "Genmo", + repoName: "Genmo", + repoUrl: "https://github.com/genmoai/models", + filter: false, + countDownloads: `path:"vae_stats.json"`, + }, + "tencent-song-generation": { + prettyLabel: "SongGeneration", + repoName: "SongGeneration", + repoUrl: "https://github.com/tencent-ailab/songgeneration", + filter: false, + countDownloads: `path:"ckpt/songgeneration_base/model.pt"`, + }, + tensorflowtts: { + prettyLabel: "TensorFlowTTS", + repoName: "TensorFlowTTS", + repoUrl: "https://github.com/TensorSpeech/TensorFlowTTS", + snippets: snippets.tensorflowtts, + }, + tensorrt: { + prettyLabel: "TensorRT", + repoName: "TensorRT", + repoUrl: "https://github.com/NVIDIA/TensorRT", + countDownloads: `path_extension:"onnx"`, + }, + tabpfn: { + prettyLabel: "TabPFN", + repoName: "TabPFN", + repoUrl: "https://github.com/PriorLabs/TabPFN", + }, + terratorch: { + prettyLabel: "TerraTorch", + repoName: "TerraTorch", + repoUrl: "https://github.com/IBM/terratorch", + docsUrl: "https://ibm.github.io/terratorch/", + filter: false, + countDownloads: `path_extension:"pt" OR path_extension:"ckpt"`, + snippets: snippets.terratorch, + }, + "tic-clip": { + prettyLabel: "TiC-CLIP", + repoName: "TiC-CLIP", + repoUrl: "https://github.com/apple/ml-tic-clip", + filter: false, + countDownloads: `path_extension:"pt" AND path_prefix:"checkpoints/"`, + }, + timesfm: { + prettyLabel: "TimesFM", + repoName: "timesfm", + repoUrl: "https://github.com/google-research/timesfm", + filter: false, + countDownloads: `path:"checkpoints/checkpoint_1100000/state/checkpoint" OR path:"checkpoints/checkpoint_2150000/state/checkpoint" OR path_extension:"ckpt"`, + }, + timm: { + prettyLabel: "timm", + repoName: "pytorch-image-models", + repoUrl: "https://github.com/rwightman/pytorch-image-models", + docsUrl: "https://huggingface.co/docs/hub/timm", + snippets: snippets.timm, + filter: true, + countDownloads: `path:"pytorch_model.bin" OR path:"model.safetensors"`, + }, + tirex: { + prettyLabel: "TiRex", + repoName: "TiRex", + repoUrl: "https://github.com/NX-AI/tirex", + countDownloads: `path_extension:"ckpt"`, + }, + torchgeo: { + prettyLabel: "TorchGeo", + repoName: "TorchGeo", + repoUrl: "https://github.com/microsoft/torchgeo", + docsUrl: "https://torchgeo.readthedocs.io/", + filter: false, + countDownloads: `path_extension:"pt" OR path_extension:"pth"`, + }, + transformers: { + prettyLabel: "Transformers", + repoName: "🤗/transformers", + repoUrl: "https://github.com/huggingface/transformers", + docsUrl: "https://huggingface.co/docs/hub/transformers", + snippets: snippets.transformers, + filter: true, + }, + "transformers.js": { + prettyLabel: "Transformers.js", + repoName: "transformers.js", + repoUrl: "https://github.com/huggingface/transformers.js", + docsUrl: "https://huggingface.co/docs/hub/transformers-js", + snippets: snippets.transformersJS, + filter: true, + }, + trellis: { + prettyLabel: "Trellis", + repoName: "Trellis", + repoUrl: "https://github.com/microsoft/TRELLIS", + countDownloads: `path_extension:"safetensors"`, + }, + ultralytics: { + prettyLabel: "ultralytics", + repoName: "ultralytics", + repoUrl: "https://github.com/ultralytics/ultralytics", + docsUrl: "https://github.com/ultralytics/ultralytics", + filter: false, + countDownloads: `path_extension:"pt"`, + snippets: snippets.ultralytics, + }, + univa: { + prettyLabel: "univa", + repoName: "univa", + repoUrl: "https://github.com/PKU-YuanGroup/UniWorld-V1", + snippets: snippets.univa, + filter: true, + countDownloads: `path:"config.json"`, + }, + "uni-3dar": { + prettyLabel: "Uni-3DAR", + repoName: "Uni-3DAR", + repoUrl: "https://github.com/dptech-corp/Uni-3DAR", + docsUrl: "https://github.com/dptech-corp/Uni-3DAR", + countDownloads: `path_extension:"pt"`, + }, + "unity-sentis": { + prettyLabel: "unity-sentis", + repoName: "unity-sentis", + repoUrl: "https://github.com/Unity-Technologies/sentis-samples", + snippets: snippets.sentis, + filter: true, + countDownloads: `path_extension:"sentis"`, + }, + sana: { + prettyLabel: "Sana", + repoName: "Sana", + repoUrl: "https://github.com/NVlabs/Sana", + countDownloads: `path_extension:"pth"`, + snippets: snippets.sana, + }, + videoprism: { + prettyLabel: "VideoPrism", + repoName: "VideoPrism", + repoUrl: "https://github.com/google-deepmind/videoprism", + countDownloads: `path_extension:"npz"`, + snippets: snippets.videoprism, + }, + "vfi-mamba": { + prettyLabel: "VFIMamba", + repoName: "VFIMamba", + repoUrl: "https://github.com/MCG-NJU/VFIMamba", + countDownloads: `path_extension:"pkl"`, + snippets: snippets.vfimamba, + }, + vismatch: { + prettyLabel: "VisMatch", + repoName: "VisMatch", + repoUrl: "https://github.com/gmberton/vismatch", + filter: false, + countDownloads: `path:"vismatch.yaml"`, + }, + lvface: { + prettyLabel: "LVFace", + repoName: "LVFace", + repoUrl: "https://github.com/bytedance/LVFace", + countDownloads: `path_extension:"pt" OR path_extension:"onnx"`, + snippets: snippets.lvface, + }, + voicecraft: { + prettyLabel: "VoiceCraft", + repoName: "VoiceCraft", + repoUrl: "https://github.com/jasonppy/VoiceCraft", + docsUrl: "https://github.com/jasonppy/VoiceCraft", + snippets: snippets.voicecraft, + }, + voxcpm: { + prettyLabel: "VoxCPM", + repoName: "VoxCPM", + repoUrl: "https://github.com/OpenBMB/VoxCPM", + snippets: snippets.voxcpm, + filter: false, + }, + vui: { + prettyLabel: "Vui", + repoName: "Vui", + repoUrl: "https://github.com/vui-ai/vui", + countDownloads: `path_extension:"pt"`, + snippets: snippets.vui, + }, + vibevoice: { + prettyLabel: "VibeVoice", + repoName: "VibeVoice", + repoUrl: "https://github.com/microsoft/VibeVoice", + snippets: snippets.vibevoice, + filter: false, + }, + videox_fun: { + prettyLabel: "VideoX Fun", + repoName: "VideoX Fun", + repoUrl: "https://github.com/aigc-apps/VideoX-Fun", + filter: false, + countDownloads: `path_extension:"safetensors"`, + }, + "wan2.2": { + prettyLabel: "Wan2.2", + repoName: "Wan2.2", + repoUrl: "https://github.com/Wan-Video/Wan2.2", + countDownloads: `path_filename:"config" AND path_extension:"json"`, + }, + wham: { + prettyLabel: "WHAM", + repoName: "wham", + repoUrl: "https://huggingface.co/microsoft/wham", + docsUrl: "https://huggingface.co/microsoft/wham/blob/main/README.md", + countDownloads: `path_extension:"ckpt"`, + }, + whisperkit: { + prettyLabel: "WhisperKit", + repoName: "WhisperKit", + repoUrl: "https://github.com/argmaxinc/WhisperKit", + docsUrl: "https://github.com/argmaxinc/WhisperKit?tab=readme-ov-file#homebrew", + snippets: snippets.whisperkit, + countDownloads: `path_filename:"model" AND path_extension:"mil" AND _exists_:"path_prefix"`, + }, + yolov10: { + // YOLOv10 is a fork of ultraLytics. Code snippets and download count are the same but the repo is different. + prettyLabel: "YOLOv10", + repoName: "YOLOv10", + repoUrl: "https://github.com/THU-MIG/yolov10", + docsUrl: "https://github.com/THU-MIG/yolov10", + countDownloads: `path_extension:"pt" OR path_extension:"safetensors"`, + snippets: snippets.ultralytics, + }, + yolov26: { + prettyLabel: "YOLOv26", + repoName: "YOLOv26", + repoUrl: "https://github.com/ultralytics/ultralytics", + docsUrl: "https://docs.ultralytics.com/models/yolo26/", + countDownloads: `path_extension:"pt" OR path_extension:"safetensors"`, + }, + zonos: { + prettyLabel: "Zonos", + repoName: "Zonos", + repoUrl: "https://github.com/Zyphra/Zonos", + docsUrl: "https://github.com/Zyphra/Zonos", + snippets: snippets.zonos, + filter: false, + }, + "3dtopia-xl": { + prettyLabel: "3DTopia-XL", + repoName: "3DTopia-XL", + repoUrl: "https://github.com/3DTopia/3DTopia-XL", + filter: false, + countDownloads: `path:"model_vae_fp16.pt"`, + snippets: snippets.threedtopia_xl, + }, +}; +exports.ALL_MODEL_LIBRARY_KEYS = Object.keys(exports.MODEL_LIBRARIES_UI_ELEMENTS); +exports.ALL_DISPLAY_MODEL_LIBRARY_KEYS = Object.entries(exports.MODEL_LIBRARIES_UI_ELEMENTS) + // eslint-disable-next-line @typescript-eslint/no-unused-vars + .filter(([_, v]) => v.filter) + .map(([k]) => k); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/package.json b/node_modules/@huggingface/tasks/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@huggingface/tasks/dist/commonjs/pipelines.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/pipelines.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..48b5bfceac989cb636f78400358077608a9f9af3 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/pipelines.d.ts @@ -0,0 +1,385 @@ +export declare const MODALITIES: readonly ["multimodal", "nlp", "cv", "audio", "tabular", "rl", "other"]; +export type Modality = (typeof MODALITIES)[number]; +export declare const MODALITY_LABELS: { + multimodal: string; + nlp: string; + audio: string; + cv: string; + rl: string; + tabular: string; + other: string; +}; +/** + * Public interface for a sub task. + * + * This can be used in a model card's `model-index` metadata. + * and is more granular classification that can grow significantly + * over time as new tasks are added. + */ +export interface SubTask { + /** + * type of the task (e.g. audio-source-separation) + */ + type: string; + /** + * displayed name of the task (e.g. Audio Source Separation) + */ + name: string; +} +/** + * Public interface for a PipelineData. + * + * This information corresponds to a pipeline type (aka task) + * in the Hub. + */ +export interface PipelineData { + /** + * displayed name of the task (e.g. Text Classification) + */ + name: string; + subtasks?: SubTask[]; + modality: Modality; + /** + * whether to hide in /models filters + */ + hideInModels?: boolean; + /** + * whether to hide in /datasets filters + */ + hideInDatasets?: boolean; +} +export declare const PIPELINE_DATA: { + "text-classification": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "nlp"; + }; + "token-classification": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "nlp"; + }; + "table-question-answering": { + name: string; + modality: "nlp"; + }; + "question-answering": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "nlp"; + }; + "zero-shot-classification": { + name: string; + modality: "nlp"; + }; + translation: { + name: string; + modality: "nlp"; + }; + summarization: { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "nlp"; + }; + "feature-extraction": { + name: string; + modality: "nlp"; + }; + "text-generation": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "nlp"; + }; + "fill-mask": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "nlp"; + }; + "sentence-similarity": { + name: string; + modality: "nlp"; + }; + "text-to-speech": { + name: string; + modality: "audio"; + }; + "text-to-audio": { + name: string; + modality: "audio"; + }; + "automatic-speech-recognition": { + name: string; + modality: "audio"; + }; + "audio-to-audio": { + name: string; + modality: "audio"; + }; + "audio-classification": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "audio"; + }; + "audio-text-to-text": { + name: string; + modality: "multimodal"; + hideInDatasets: true; + }; + "voice-activity-detection": { + name: string; + modality: "audio"; + }; + "depth-estimation": { + name: string; + modality: "cv"; + }; + "image-classification": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "cv"; + }; + "object-detection": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "cv"; + }; + "image-segmentation": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "cv"; + }; + "text-to-image": { + name: string; + modality: "cv"; + }; + "image-to-text": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "cv"; + }; + "image-to-image": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "cv"; + }; + "image-to-video": { + name: string; + modality: "cv"; + }; + "unconditional-image-generation": { + name: string; + modality: "cv"; + }; + "video-classification": { + name: string; + modality: "cv"; + }; + "reinforcement-learning": { + name: string; + modality: "rl"; + }; + robotics: { + name: string; + modality: "rl"; + subtasks: { + type: string; + name: string; + }[]; + }; + "tabular-classification": { + name: string; + modality: "tabular"; + subtasks: { + type: string; + name: string; + }[]; + }; + "tabular-regression": { + name: string; + modality: "tabular"; + subtasks: { + type: string; + name: string; + }[]; + }; + "tabular-to-text": { + name: string; + modality: "tabular"; + subtasks: { + type: string; + name: string; + }[]; + hideInModels: true; + }; + "table-to-text": { + name: string; + modality: "nlp"; + hideInModels: true; + }; + "multiple-choice": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "nlp"; + hideInModels: true; + }; + "text-ranking": { + name: string; + modality: "nlp"; + }; + "text-retrieval": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "nlp"; + hideInModels: true; + }; + "time-series-forecasting": { + name: string; + modality: "tabular"; + subtasks: { + type: string; + name: string; + }[]; + }; + "text-to-video": { + name: string; + modality: "cv"; + }; + "image-text-to-text": { + name: string; + modality: "multimodal"; + }; + "image-text-to-image": { + name: string; + modality: "multimodal"; + }; + "image-text-to-video": { + name: string; + modality: "multimodal"; + }; + "visual-question-answering": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "multimodal"; + }; + "document-question-answering": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "multimodal"; + hideInDatasets: true; + }; + "zero-shot-image-classification": { + name: string; + modality: "cv"; + }; + "graph-ml": { + name: string; + modality: "other"; + }; + "mask-generation": { + name: string; + modality: "cv"; + }; + "zero-shot-object-detection": { + name: string; + modality: "cv"; + }; + "text-to-3d": { + name: string; + modality: "cv"; + }; + "image-to-3d": { + name: string; + modality: "cv"; + }; + "image-feature-extraction": { + name: string; + modality: "cv"; + }; + "video-text-to-text": { + name: string; + modality: "multimodal"; + hideInDatasets: false; + }; + "keypoint-detection": { + name: string; + subtasks: { + type: string; + name: string; + }[]; + modality: "cv"; + hideInDatasets: true; + }; + "visual-document-retrieval": { + name: string; + modality: "multimodal"; + }; + "any-to-any": { + name: string; + modality: "multimodal"; + }; + "video-to-video": { + name: string; + modality: "cv"; + hideInDatasets: true; + }; + other: { + name: string; + modality: "other"; + hideInModels: true; + hideInDatasets: true; + }; +}; +export type PipelineType = keyof typeof PIPELINE_DATA; +export type WidgetType = PipelineType | "conversational"; +export declare const PIPELINE_TYPES: PipelineType[]; +export declare const SUBTASK_TYPES: string[]; +export declare const PIPELINE_TYPES_SET: Set<"other" | "text-classification" | "token-classification" | "table-question-answering" | "question-answering" | "zero-shot-classification" | "translation" | "summarization" | "feature-extraction" | "text-generation" | "fill-mask" | "sentence-similarity" | "text-to-speech" | "text-to-audio" | "automatic-speech-recognition" | "audio-to-audio" | "audio-classification" | "audio-text-to-text" | "voice-activity-detection" | "depth-estimation" | "image-classification" | "object-detection" | "image-segmentation" | "text-to-image" | "image-to-text" | "image-to-image" | "image-to-video" | "unconditional-image-generation" | "video-classification" | "reinforcement-learning" | "robotics" | "tabular-classification" | "tabular-regression" | "tabular-to-text" | "table-to-text" | "multiple-choice" | "text-ranking" | "text-retrieval" | "time-series-forecasting" | "text-to-video" | "image-text-to-text" | "image-text-to-image" | "image-text-to-video" | "visual-question-answering" | "document-question-answering" | "zero-shot-image-classification" | "graph-ml" | "mask-generation" | "zero-shot-object-detection" | "text-to-3d" | "image-to-3d" | "image-feature-extraction" | "video-text-to-text" | "keypoint-detection" | "visual-document-retrieval" | "any-to-any" | "video-to-video">; +//# sourceMappingURL=pipelines.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/pipelines.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/pipelines.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e44b58ed1d6363fdc5bd08b53ab435961d17e281 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/pipelines.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../src/pipelines.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,yEAA0E,CAAC;AAElG,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,eAAe;;;;;;;;CAQQ,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB;AAcD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwkBc,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,aAAa,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEzD,eAAO,MAAM,cAAc,EAAiC,YAAY,EAAE,CAAC;AAE3E,eAAO,MAAM,aAAa,UAEN,CAAC;AAErB,eAAO,MAAM,kBAAkB,iwCAA0B,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/pipelines.js b/node_modules/@huggingface/tasks/dist/commonjs/pipelines.js new file mode 100644 index 0000000000000000000000000000000000000000..6986116337d99a0939b71fbfbba39fab75aa16d9 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/pipelines.js @@ -0,0 +1,615 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PIPELINE_TYPES_SET = exports.SUBTASK_TYPES = exports.PIPELINE_TYPES = exports.PIPELINE_DATA = exports.MODALITY_LABELS = exports.MODALITIES = void 0; +exports.MODALITIES = ["multimodal", "nlp", "cv", "audio", "tabular", "rl", "other"]; +exports.MODALITY_LABELS = { + multimodal: "Multimodal", + nlp: "Natural Language Processing", + audio: "Audio", + cv: "Computer Vision", + rl: "Reinforcement Learning", + tabular: "Tabular", + other: "Other", +}; +/// Coarse-grained taxonomy of tasks +/// +/// This type is used in multiple places in the Hugging Face +/// ecosystem: +/// - To determine which widget to show. +/// - To determine which endpoint of Inference Endpoints to use. +/// - As filters at the left of models and datasets page. +/// +/// Note that this is sensitive to order. +/// For each domain, the order should be of decreasing specificity. +/// This will impact the default pipeline tag of a model when not +/// specified. +exports.PIPELINE_DATA = { + "text-classification": { + name: "Text Classification", + subtasks: [ + { + type: "acceptability-classification", + name: "Acceptability Classification", + }, + { + type: "entity-linking-classification", + name: "Entity Linking Classification", + }, + { + type: "fact-checking", + name: "Fact Checking", + }, + { + type: "intent-classification", + name: "Intent Classification", + }, + { + type: "language-identification", + name: "Language Identification", + }, + { + type: "multi-class-classification", + name: "Multi Class Classification", + }, + { + type: "multi-label-classification", + name: "Multi Label Classification", + }, + { + type: "multi-input-text-classification", + name: "Multi-input Text Classification", + }, + { + type: "natural-language-inference", + name: "Natural Language Inference", + }, + { + type: "semantic-similarity-classification", + name: "Semantic Similarity Classification", + }, + { + type: "sentiment-classification", + name: "Sentiment Classification", + }, + { + type: "topic-classification", + name: "Topic Classification", + }, + { + type: "semantic-similarity-scoring", + name: "Semantic Similarity Scoring", + }, + { + type: "sentiment-scoring", + name: "Sentiment Scoring", + }, + { + type: "sentiment-analysis", + name: "Sentiment Analysis", + }, + { + type: "hate-speech-detection", + name: "Hate Speech Detection", + }, + { + type: "text-scoring", + name: "Text Scoring", + }, + ], + modality: "nlp", + }, + "token-classification": { + name: "Token Classification", + subtasks: [ + { + type: "named-entity-recognition", + name: "Named Entity Recognition", + }, + { + type: "part-of-speech", + name: "Part of Speech", + }, + { + type: "parsing", + name: "Parsing", + }, + { + type: "lemmatization", + name: "Lemmatization", + }, + { + type: "word-sense-disambiguation", + name: "Word Sense Disambiguation", + }, + { + type: "coreference-resolution", + name: "Coreference-resolution", + }, + ], + modality: "nlp", + }, + "table-question-answering": { + name: "Table Question Answering", + modality: "nlp", + }, + "question-answering": { + name: "Question Answering", + subtasks: [ + { + type: "extractive-qa", + name: "Extractive QA", + }, + { + type: "open-domain-qa", + name: "Open Domain QA", + }, + { + type: "closed-domain-qa", + name: "Closed Domain QA", + }, + ], + modality: "nlp", + }, + "zero-shot-classification": { + name: "Zero-Shot Classification", + modality: "nlp", + }, + translation: { + name: "Translation", + modality: "nlp", + }, + summarization: { + name: "Summarization", + subtasks: [ + { + type: "news-articles-summarization", + name: "News Articles Summarization", + }, + { + type: "news-articles-headline-generation", + name: "News Articles Headline Generation", + }, + ], + modality: "nlp", + }, + "feature-extraction": { + name: "Feature Extraction", + modality: "nlp", + }, + "text-generation": { + name: "Text Generation", + subtasks: [ + { + type: "dialogue-modeling", + name: "Dialogue Modeling", + }, + { + type: "dialogue-generation", + name: "Dialogue Generation", + }, + { + type: "conversational", + name: "Conversational", + }, + { + type: "language-modeling", + name: "Language Modeling", + }, + { + type: "text-simplification", + name: "Text simplification", + }, + { + type: "explanation-generation", + name: "Explanation Generation", + }, + { + type: "abstractive-qa", + name: "Abstractive QA", + }, + { + type: "open-domain-abstractive-qa", + name: "Open Domain Abstractive QA", + }, + { + type: "closed-domain-qa", + name: "Closed Domain QA", + }, + { + type: "open-book-qa", + name: "Open Book QA", + }, + { + type: "closed-book-qa", + name: "Closed Book QA", + }, + { + type: "text2text-generation", + name: "Text2Text Generation", + }, + ], + modality: "nlp", + }, + "fill-mask": { + name: "Fill-Mask", + subtasks: [ + { + type: "slot-filling", + name: "Slot Filling", + }, + { + type: "masked-language-modeling", + name: "Masked Language Modeling", + }, + ], + modality: "nlp", + }, + "sentence-similarity": { + name: "Sentence Similarity", + modality: "nlp", + }, + "text-to-speech": { + name: "Text-to-Speech", + modality: "audio", + }, + "text-to-audio": { + name: "Text-to-Audio", + modality: "audio", + }, + "automatic-speech-recognition": { + name: "Automatic Speech Recognition", + modality: "audio", + }, + "audio-to-audio": { + name: "Audio-to-Audio", + modality: "audio", + }, + "audio-classification": { + name: "Audio Classification", + subtasks: [ + { + type: "keyword-spotting", + name: "Keyword Spotting", + }, + { + type: "speaker-identification", + name: "Speaker Identification", + }, + { + type: "audio-intent-classification", + name: "Audio Intent Classification", + }, + { + type: "audio-emotion-recognition", + name: "Audio Emotion Recognition", + }, + { + type: "audio-language-identification", + name: "Audio Language Identification", + }, + ], + modality: "audio", + }, + "audio-text-to-text": { + name: "Audio-Text-to-Text", + modality: "multimodal", + hideInDatasets: true, + }, + "voice-activity-detection": { + name: "Voice Activity Detection", + modality: "audio", + }, + "depth-estimation": { + name: "Depth Estimation", + modality: "cv", + }, + "image-classification": { + name: "Image Classification", + subtasks: [ + { + type: "multi-label-image-classification", + name: "Multi Label Image Classification", + }, + { + type: "multi-class-image-classification", + name: "Multi Class Image Classification", + }, + ], + modality: "cv", + }, + "object-detection": { + name: "Object Detection", + subtasks: [ + { + type: "face-detection", + name: "Face Detection", + }, + { + type: "vehicle-detection", + name: "Vehicle Detection", + }, + ], + modality: "cv", + }, + "image-segmentation": { + name: "Image Segmentation", + subtasks: [ + { + type: "instance-segmentation", + name: "Instance Segmentation", + }, + { + type: "semantic-segmentation", + name: "Semantic Segmentation", + }, + { + type: "panoptic-segmentation", + name: "Panoptic Segmentation", + }, + ], + modality: "cv", + }, + "text-to-image": { + name: "Text-to-Image", + modality: "cv", + }, + "image-to-text": { + name: "Image-to-Text", + subtasks: [ + { + type: "image-captioning", + name: "Image Captioning", + }, + ], + modality: "cv", + }, + "image-to-image": { + name: "Image-to-Image", + subtasks: [ + { + type: "image-inpainting", + name: "Image Inpainting", + }, + { + type: "image-colorization", + name: "Image Colorization", + }, + { + type: "super-resolution", + name: "Super Resolution", + }, + ], + modality: "cv", + }, + "image-to-video": { + name: "Image-to-Video", + modality: "cv", + }, + "unconditional-image-generation": { + name: "Unconditional Image Generation", + modality: "cv", + }, + "video-classification": { + name: "Video Classification", + modality: "cv", + }, + "reinforcement-learning": { + name: "Reinforcement Learning", + modality: "rl", + }, + robotics: { + name: "Robotics", + modality: "rl", + subtasks: [ + { + type: "grasping", + name: "Grasping", + }, + { + type: "task-planning", + name: "Task Planning", + }, + ], + }, + "tabular-classification": { + name: "Tabular Classification", + modality: "tabular", + subtasks: [ + { + type: "tabular-multi-class-classification", + name: "Tabular Multi Class Classification", + }, + { + type: "tabular-multi-label-classification", + name: "Tabular Multi Label Classification", + }, + ], + }, + "tabular-regression": { + name: "Tabular Regression", + modality: "tabular", + subtasks: [ + { + type: "tabular-single-column-regression", + name: "Tabular Single Column Regression", + }, + ], + }, + "tabular-to-text": { + name: "Tabular to Text", + modality: "tabular", + subtasks: [ + { + type: "rdf-to-text", + name: "RDF to text", + }, + ], + hideInModels: true, + }, + "table-to-text": { + name: "Table to Text", + modality: "nlp", + hideInModels: true, + }, + "multiple-choice": { + name: "Multiple Choice", + subtasks: [ + { + type: "multiple-choice-qa", + name: "Multiple Choice QA", + }, + { + type: "multiple-choice-coreference-resolution", + name: "Multiple Choice Coreference Resolution", + }, + ], + modality: "nlp", + hideInModels: true, + }, + "text-ranking": { + name: "Text Ranking", + modality: "nlp", + }, + "text-retrieval": { + name: "Text Retrieval", + subtasks: [ + { + type: "document-retrieval", + name: "Document Retrieval", + }, + { + type: "utterance-retrieval", + name: "Utterance Retrieval", + }, + { + type: "entity-linking-retrieval", + name: "Entity Linking Retrieval", + }, + { + type: "fact-checking-retrieval", + name: "Fact Checking Retrieval", + }, + ], + modality: "nlp", + hideInModels: true, + }, + "time-series-forecasting": { + name: "Time Series Forecasting", + modality: "tabular", + subtasks: [ + { + type: "univariate-time-series-forecasting", + name: "Univariate Time Series Forecasting", + }, + { + type: "multivariate-time-series-forecasting", + name: "Multivariate Time Series Forecasting", + }, + ], + }, + "text-to-video": { + name: "Text-to-Video", + modality: "cv", + }, + "image-text-to-text": { + name: "Image-Text-to-Text", + modality: "multimodal", + }, + "image-text-to-image": { + name: "Image-Text-to-Image", + modality: "multimodal", + }, + "image-text-to-video": { + name: "Image-Text-to-Video", + modality: "multimodal", + }, + "visual-question-answering": { + name: "Visual Question Answering", + subtasks: [ + { + type: "visual-question-answering", + name: "Visual Question Answering", + }, + ], + modality: "multimodal", + }, + "document-question-answering": { + name: "Document Question Answering", + subtasks: [ + { + type: "document-question-answering", + name: "Document Question Answering", + }, + ], + modality: "multimodal", + hideInDatasets: true, + }, + "zero-shot-image-classification": { + name: "Zero-Shot Image Classification", + modality: "cv", + }, + "graph-ml": { + name: "Graph Machine Learning", + modality: "other", + }, + "mask-generation": { + name: "Mask Generation", + modality: "cv", + }, + "zero-shot-object-detection": { + name: "Zero-Shot Object Detection", + modality: "cv", + }, + "text-to-3d": { + name: "Text-to-3D", + modality: "cv", + }, + "image-to-3d": { + name: "Image-to-3D", + modality: "cv", + }, + "image-feature-extraction": { + name: "Image Feature Extraction", + modality: "cv", + }, + "video-text-to-text": { + name: "Video-Text-to-Text", + modality: "multimodal", + hideInDatasets: false, + }, + "keypoint-detection": { + name: "Keypoint Detection", + subtasks: [ + { + type: "pose-estimation", + name: "Pose Estimation", + }, + ], + modality: "cv", + hideInDatasets: true, + }, + "visual-document-retrieval": { + name: "Visual Document Retrieval", + modality: "multimodal", + }, + "any-to-any": { + name: "Any-to-Any", + modality: "multimodal", + }, + "video-to-video": { + name: "Video-to-Video", + modality: "cv", + hideInDatasets: true, + }, + other: { + name: "Other", + modality: "other", + hideInModels: true, + hideInDatasets: true, + }, +}; +exports.PIPELINE_TYPES = Object.keys(exports.PIPELINE_DATA); +exports.SUBTASK_TYPES = Object.values(exports.PIPELINE_DATA) + .flatMap((data) => ("subtasks" in data ? data.subtasks : [])) + .map((s) => s.type); +exports.PIPELINE_TYPES_SET = new Set(exports.PIPELINE_TYPES); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf5e9f386dcfeaef440383931a5892d91c9f01f8 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.d.ts @@ -0,0 +1,14 @@ +import type { ChatCompletionInputMessage, GenerationParameters } from "../tasks/index.js"; +export declare function stringifyMessages(messages: ChatCompletionInputMessage[], opts?: { + indent?: string; + attributeKeyQuotes?: boolean; + customContentEscaper?: (str: string) => string; +}): string; +type PartialGenerationParameters = Partial>; +export declare function stringifyGenerationConfig(config: PartialGenerationParameters, opts: { + indent: string; + attributeValueConnector: string; + attributeKeyQuotes?: boolean; +}): string; +export {}; +//# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..22fc37561512c88d91a21b3ff56a7c29cdd680d6 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/snippets/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE1F,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,0BAA0B,EAAE,EACtC,IAAI,CAAC,EAAE;IACN,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C,GACC,MAAM,CAYR;AAED,KAAK,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC;AAE/G,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,2BAA2B,EACnC,IAAI,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B,GACC,MAAM,CAMR"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.js b/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.js new file mode 100644 index 0000000000000000000000000000000000000000..bd6d395ed86cd9da6976465ae84228d23dd3d89c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/common.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stringifyMessages = stringifyMessages; +exports.stringifyGenerationConfig = stringifyGenerationConfig; +function stringifyMessages(messages, opts) { + let messagesStr = JSON.stringify(messages, null, "\t"); + if (opts?.indent) { + messagesStr = messagesStr.replaceAll("\n", `\n${opts.indent}`); + } + if (!opts?.attributeKeyQuotes) { + messagesStr = messagesStr.replace(/"([^"]+)":/g, "$1:"); + } + if (opts?.customContentEscaper) { + messagesStr = opts.customContentEscaper(messagesStr); + } + return messagesStr; +} +function stringifyGenerationConfig(config, opts) { + const quote = opts.attributeKeyQuotes ? `"` : ""; + return Object.entries(config) + .map(([key, val]) => `${quote}${key}${quote}${opts.attributeValueConnector}${val},`) + .join(`${opts.indent}`); +} diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..991b953e5f6ee7ddd737c3ad8c2a674f6197c98d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.d.ts @@ -0,0 +1,4 @@ +export * from "./common.js"; +export * from "./inputs.js"; +export * from "./types.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..548a10edf879f1c90bf3b4e790a3ee666694d74f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/snippets/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.js b/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1cc09552069bf9c84078aa41270d83b37d5e3353 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./common.js"), exports); +__exportStar(require("./inputs.js"), exports); +__exportStar(require("./types.js"), exports); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b7195b500182bf3159236cc9a51dfd441b5c4743 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.d.ts @@ -0,0 +1,4 @@ +import type { ChatCompletionInputMessage } from "../tasks/index.js"; +import type { ModelDataMinimal } from "./types.js"; +export declare function getModelInputSnippet(model: ModelDataMinimal, noWrap?: boolean, noQuotes?: boolean): string | ChatCompletionInputMessage[]; +//# sourceMappingURL=inputs.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e78561c1f373ff55e20a0e5a281a40ddfcb99836 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../../src/snippets/inputs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAqKnD,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,gBAAgB,EACvB,MAAM,UAAQ,EACd,QAAQ,UAAQ,GACd,MAAM,GAAG,0BAA0B,EAAE,CAmBvC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.js b/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.js new file mode 100644 index 0000000000000000000000000000000000000000..4a7badfae5da53c5e405245a8e5947a358442950 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/inputs.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getModelInputSnippet = getModelInputSnippet; +const inputsZeroShotClassification = () => `"Hi, I recently bought a device from your company but it is not working as advertised and I would like to get reimbursed!"`; +const inputsTranslation = () => `"Меня зовут Вольфганг и я живу в Берлине"`; +const inputsSummarization = () => `"The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct."`; +const inputsTableQuestionAnswering = () => `{ + "query": "How many stars does the transformers repository have?", + "table": { + "Repository": ["Transformers", "Datasets", "Tokenizers"], + "Stars": ["36542", "4512", "3934"], + "Contributors": ["651", "77", "34"], + "Programming language": [ + "Python", + "Python", + "Rust, Python and NodeJS" + ] + } +}`; +const inputsVisualQuestionAnswering = () => `{ + "image": "cat.png", + "question": "What is in this image?" + }`; +const inputsQuestionAnswering = () => `{ + "question": "What is my name?", + "context": "My name is Clara and I live in Berkeley." +}`; +const inputsTextClassification = () => `"I like you. I love you"`; +const inputsTokenClassification = () => `"My name is Sarah Jessica Parker but you can call me Jessica"`; +const inputsTextGeneration = (model) => { + if (model.tags.includes("conversational")) { + return model.pipeline_tag === "text-generation" + ? [{ role: "user", content: "What is the capital of France?" }] + : [ + { + role: "user", + content: [ + { + type: "text", + text: "Describe this image in one sentence.", + }, + { + type: "image_url", + image_url: { + url: "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg", + }, + }, + ], + }, + ]; + } + return `"Can you please let us know more details about your "`; +}; +const inputsFillMask = (model) => `"The answer to the universe is ${model.mask_token}."`; +const inputsSentenceSimilarity = () => `{ + "source_sentence": "That is a happy person", + "sentences": [ + "That is a happy dog", + "That is a very happy person", + "Today is a sunny day" + ] +}`; +const inputsFeatureExtraction = () => `"Today is a sunny day and I will get some ice cream."`; +const inputsImageClassification = () => `"cats.jpg"`; +const inputsImageToText = () => `"cats.jpg"`; +const inputsImageToImage = () => `{ + "image": "cat.png", + "prompt": "Turn the cat into a tiger." +}`; +const inputsImageToVideo = () => `{ + "image": "cat.png", + "prompt": "The cat starts to dance" +}`; +const inputsImageTextToImage = () => `{ + "image": "cat.png", + "prompt": "Turn the cat into a tiger." +}`; +const inputsImageTextToVideo = () => `{ + "image": "cat.png", + "prompt": "The cat starts to dance" +}`; +const inputsImageSegmentation = () => `"cats.jpg"`; +const inputsObjectDetection = () => `"cats.jpg"`; +const inputsAudioToAudio = () => `"sample1.flac"`; +const inputsAudioClassification = () => `"sample1.flac"`; +const inputsTextToImage = () => `"Astronaut riding a horse"`; +const inputsTextToVideo = () => `"A young man walking on the street"`; +const inputsTextToSpeech = () => `"The answer to the universe is 42"`; +const inputsTextToAudio = () => `"liquid drum and bass, atmospheric synths, airy sounds"`; +const inputsAutomaticSpeechRecognition = () => `"sample1.flac"`; +const inputsTabularPrediction = () => `'{"Height":[11.52,12.48],"Length1":[23.2,24.0],"Length2":[25.4,26.3],"Species": ["Bream","Bream"]}'`; +const inputsZeroShotImageClassification = () => `"cats.jpg"`; +const modelInputSnippets = { + "audio-to-audio": inputsAudioToAudio, + "audio-classification": inputsAudioClassification, + "automatic-speech-recognition": inputsAutomaticSpeechRecognition, + "document-question-answering": inputsVisualQuestionAnswering, + "feature-extraction": inputsFeatureExtraction, + "fill-mask": inputsFillMask, + "image-classification": inputsImageClassification, + "image-to-text": inputsImageToText, + "image-to-image": inputsImageToImage, + "image-to-video": inputsImageToVideo, + "image-text-to-image": inputsImageTextToImage, + "image-text-to-video": inputsImageTextToVideo, + "image-segmentation": inputsImageSegmentation, + "object-detection": inputsObjectDetection, + "question-answering": inputsQuestionAnswering, + "sentence-similarity": inputsSentenceSimilarity, + summarization: inputsSummarization, + "table-question-answering": inputsTableQuestionAnswering, + "tabular-regression": inputsTabularPrediction, + "tabular-classification": inputsTabularPrediction, + "text-classification": inputsTextClassification, + "text-generation": inputsTextGeneration, + "image-text-to-text": inputsTextGeneration, + "text-to-image": inputsTextToImage, + "text-to-video": inputsTextToVideo, + "text-to-speech": inputsTextToSpeech, + "text-to-audio": inputsTextToAudio, + "token-classification": inputsTokenClassification, + translation: inputsTranslation, + "zero-shot-classification": inputsZeroShotClassification, + "zero-shot-image-classification": inputsZeroShotImageClassification, +}; +// Use noWrap to put the whole snippet on a single line (removing new lines and tabulations) +// Use noQuotes to strip quotes from start & end (example: "abc" -> abc) +function getModelInputSnippet(model, noWrap = false, noQuotes = false) { + if (model.pipeline_tag) { + const inputs = modelInputSnippets[model.pipeline_tag]; + if (inputs) { + let result = inputs(model); + if (typeof result === "string") { + if (noWrap) { + result = result.replace(/(?:(?:\r?\n|\r)\t*)|\t+/g, " "); + } + if (noQuotes) { + const REGEX_QUOTES = /^"(.+)"$/s; + const match = result.match(REGEX_QUOTES); + result = match ? match[1] : result; + } + } + return result; + } + } + return "No input example has been defined for this model task."; +} diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..684489ef8f7272cde9a9f5039481a92122373f5f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.d.ts @@ -0,0 +1,15 @@ +import type { ModelData } from "../model-data.js"; +/** + * Minimal model data required for snippets. + * + * Add more fields as needed. + */ +export type ModelDataMinimal = Pick; +export declare const inferenceSnippetLanguages: readonly ["python", "js", "sh"]; +export type InferenceSnippetLanguage = (typeof inferenceSnippetLanguages)[number]; +export interface InferenceSnippet { + language: InferenceSnippetLanguage; + client: string; + content: string; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3e04ceef9eea3456ea042301bd21850e9794f79b --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/snippets/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAClC,SAAS,EACT,IAAI,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CACvF,CAAC;AAGF,eAAO,MAAM,yBAAyB,iCAAkC,CAAC;AACzE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.js b/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.js new file mode 100644 index 0000000000000000000000000000000000000000..2df04a6055fd934776dfd0cd70d7288ebbad3674 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/snippets/types.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.inferenceSnippetLanguages = void 0; +// Order of the elements in InferenceModal.svelte is determined by this const +exports.inferenceSnippetLanguages = ["python", "js", "sh"]; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..316d468d5a30916ed526b156e185469fadbf2567 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/any-to-any/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA4Df,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.js new file mode 100644 index 0000000000000000000000000000000000000000..d4e0ca260bf1c1bd6b29caefbba8dff501232bb8 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/any-to-any/data.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A dataset with multiple modality input and output pairs.", + id: "PKU-Alignment/align-anything", + }, + ], + demo: { + inputs: [ + { + filename: "any-to-any-input.jpg", + type: "img", + }, + { + label: "Text Prompt", + content: "What is the significance of this place?", + type: "text", + }, + ], + outputs: [ + { + label: "Generated Text", + content: "The place in the picture is Osaka Castle, located in Osaka, Japan. Osaka Castle is a historic castle that was originally built in the 16th century by Toyotomi Hideyoshi, a powerful warlord of the time. It is one of the most famous landmarks in Osaka and is known for its distinctive white walls and black roof tiles. The castle has been rebuilt several times over the centuries and is now a popular tourist attraction, offering visitors a glimpse into Japan's rich history and culture.", + type: "text", + }, + { + filename: "any-to-any-output.wav", + type: "audio", + }, + ], + }, + metrics: [], + models: [ + { + description: "Strong model that can take in video, audio, image, text and output text and natural speech.", + id: "Qwen/Qwen2.5-Omni-7B", + }, + { + description: "Robust model that can take in image and text and generate image and text.", + id: "OmniGen2/OmniGen2", + }, + { + description: "Any-to-any model with speech, video, audio, image and text understanding capabilities.", + id: "openbmb/MiniCPM-o-2_6", + }, + { + description: "A model that can understand image and text and generate image and text.", + id: "ByteDance-Seed/BAGEL-7B-MoT", + }, + ], + spaces: [ + { + description: "An application to chat with an any-to-any (image & text) model.", + id: "OmniGen2/OmniGen2", + }, + ], + summary: "Any-to-any models can understand two or more modalities and output two or more modalities.", + widgetModels: [], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..bf29381612f3a120b322349e0cbf0b3d83167dc5 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/audio-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA4Ef,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.js new file mode 100644 index 0000000000000000000000000000000000000000..72d39597b4d0a9b2533be264235b23dc80420b8b --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/data.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A benchmark of 10 different audio tasks.", + id: "s3prl/superb", + }, + { + description: "A dataset of YouTube clips and their sound categories.", + id: "agkphysics/AudioSet", + }, + ], + demo: { + inputs: [ + { + filename: "audio.wav", + type: "audio", + }, + ], + outputs: [ + { + data: [ + { + label: "Up", + score: 0.2, + }, + { + label: "Down", + score: 0.8, + }, + ], + type: "chart", + }, + ], + }, + metrics: [ + { + description: "", + id: "accuracy", + }, + { + description: "", + id: "recall", + }, + { + description: "", + id: "precision", + }, + { + description: "", + id: "f1", + }, + ], + models: [ + { + description: "An easy-to-use model for command recognition.", + id: "speechbrain/google_speech_command_xvector", + }, + { + description: "An emotion recognition model.", + id: "ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition", + }, + { + description: "A language identification model.", + id: "facebook/mms-lid-126", + }, + ], + spaces: [ + { + description: "An application that can classify music into different genre.", + id: "kurianbenoy/audioclassification", + }, + ], + summary: "Audio classification is the task of assigning a label or class to a given audio. It can be used for recognizing which command a user is giving or the emotion of a statement, as well as identifying a speaker.", + widgetModels: ["MIT/ast-finetuned-audioset-10-10-0.4593"], + youtubeId: "KWwzcmG98Ds", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ddc1cffad496de5105c0ecf687f7302737086f82 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.d.ts @@ -0,0 +1,54 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Audio Classification inference + */ +export interface AudioClassificationInput { + /** + * The input audio data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the audio data as a raw bytes payload. + */ + inputs: Blob; + /** + * Additional inference parameters for Audio Classification + */ + parameters?: AudioClassificationParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Audio Classification + */ +export interface AudioClassificationParameters { + /** + * The function to apply to the model outputs in order to retrieve the scores. + */ + function_to_apply?: ClassificationOutputTransform; + /** + * When specified, limits the output to the top K most probable classes. + */ + top_k?: number; + [property: string]: unknown; +} +/** + * The function to apply to the model outputs in order to retrieve the scores. + */ +export type ClassificationOutputTransform = "sigmoid" | "softmax" | "none"; +export type AudioClassificationOutput = AudioClassificationOutputElement[]; +/** + * Outputs for Audio Classification inference + */ +export interface AudioClassificationOutputElement { + /** + * The predicted class label. + */ + label: string; + /** + * The corresponding probability. + */ + score: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..36b8340d1109765339d12eda90f6e0d6c8be3e04 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/audio-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-classification/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5a31cfccf308085ac90260ae5454e2c10df544b2 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/audio-text-to-text/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAiEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.js new file mode 100644 index 0000000000000000000000000000000000000000..77222904e70ad7ea1a1b89d5b249ef951dbba495 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-text-to-text/data.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A dataset containing audio conversations with question–answer pairs.", + id: "nvidia/AF-Think", + }, + { + description: "A more advanced and comprehensive dataset that contains characteristics of the audio as well", + id: "tsinghua-ee/QualiSpeech", + }, + ], + demo: { + inputs: [ + { + filename: "audio.wav", + type: "audio", + }, + { + label: "Text Prompt", + content: "What is the gender of the speaker?", + type: "text", + }, + ], + outputs: [ + { + label: "Generated Text", + content: "The gender of the speaker is female.", + type: "text", + }, + ], + }, + metrics: [], + models: [ + { + description: "A lightweight model that has capabilities of taking both audio and text as inputs and generating responses.", + id: "fixie-ai/ultravox-v0_5-llama-3_2-1b", + }, + { + description: "A multimodal model that supports voice chat and audio analysis.", + id: "Qwen/Qwen2-Audio-7B-Instruct", + }, + { + description: "A model for audio understanding, speech translation, and transcription.", + id: "mistralai/Voxtral-Small-24B-2507", + }, + { + description: "A new model capable of audio question answering and reasoning.", + id: "nvidia/audio-flamingo-3", + }, + ], + spaces: [ + { + description: "A space that takes input as both audio and text and generates answers.", + id: "iamomtiwari/ATTT", + }, + { + description: "A web application that demonstrates chatting with the Qwen2Audio Model.", + id: "freddyaboulton/talk-to-qwen-webrtc", + }, + ], + summary: "Audio-text-to-text models take both an audio clip and a text prompt as input, and generate natural language text as output. These models can answer questions about spoken content, summarize meetings, analyze music, or interpret speech beyond simple transcription. They are useful for applications that combine speech understanding with reasoning or conversation.", + widgetModels: [], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e20ea8823de86f46b9aa9c8658cf637fb2e9d198 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/audio-to-audio/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA6Df,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.js new file mode 100644 index 0000000000000000000000000000000000000000..8c9c834c8f5b7cd4b5db7642e43eab303be238ba --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/audio-to-audio/data.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "512-element X-vector embeddings of speakers from CMU ARCTIC dataset.", + id: "Matthijs/cmu-arctic-xvectors", + }, + ], + demo: { + inputs: [ + { + filename: "input.wav", + type: "audio", + }, + ], + outputs: [ + { + filename: "label-0.wav", + type: "audio", + }, + { + filename: "label-1.wav", + type: "audio", + }, + ], + }, + metrics: [ + { + description: "The Signal-to-Noise ratio is the relationship between the target signal level and the background noise level. It is calculated as the logarithm of the target signal divided by the background noise, in decibels.", + id: "snri", + }, + { + description: "The Signal-to-Distortion ratio is the relationship between the target signal and the sum of noise, interference, and artifact errors", + id: "sdri", + }, + ], + models: [ + { + description: "A speech enhancement model.", + id: "ResembleAI/resemble-enhance", + }, + { + description: "A model that can change the voice in a speech recording.", + id: "microsoft/speecht5_vc", + }, + ], + spaces: [ + { + description: "An application for speech separation.", + id: "younver/speechbrain-speech-separation", + }, + { + description: "An application for audio style transfer.", + id: "nakas/audio-diffusion_style_transfer", + }, + ], + summary: "Audio-to-Audio is a family of tasks in which the input is an audio and the output is one or multiple generated audios. Some example tasks are speech enhancement and source separation.", + widgetModels: ["speechbrain/sepformer-wham"], + youtubeId: "iohj7nCCYoM", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..987e72b47dbd3da5b501f1b9a5a875a736b3af59 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/automatic-speech-recognition/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAyFf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.js new file mode 100644 index 0000000000000000000000000000000000000000..601f58d8adf6819a3614e47526baf20859daaeb2 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/data.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "31,175 hours of multilingual audio-text dataset in 108 languages.", + id: "mozilla-foundation/common_voice_17_0", + }, + { + description: "Multilingual and diverse audio dataset with 101k hours of audio.", + id: "amphion/Emilia-Dataset", + }, + { + description: "A dataset with 44.6k hours of English speaker data and 6k hours of other language speakers.", + id: "parler-tts/mls_eng", + }, + { + description: "A multilingual audio dataset with 370K hours of audio.", + id: "espnet/yodas", + }, + ], + demo: { + inputs: [ + { + filename: "input.flac", + type: "audio", + }, + ], + outputs: [ + { + /// GOING ALONG SLUSHY COUNTRY ROADS AND SPEAKING TO DAMP AUDIENCES I + label: "Transcript", + content: "Going along slushy country roads and speaking to damp audiences in...", + type: "text", + }, + ], + }, + metrics: [ + { + description: "", + id: "wer", + }, + { + description: "", + id: "cer", + }, + ], + models: [ + { + description: "A powerful ASR model by OpenAI.", + id: "openai/whisper-large-v3", + }, + { + description: "A good generic speech model by MetaAI for fine-tuning.", + id: "facebook/w2v-bert-2.0", + }, + { + description: "An end-to-end model that performs ASR and Speech Translation by MetaAI.", + id: "facebook/seamless-m4t-v2-large", + }, + { + description: "A powerful multilingual ASR and Speech Translation model by Nvidia.", + id: "nvidia/canary-1b", + }, + { + description: "Powerful speaker diarization model.", + id: "pyannote/speaker-diarization-3.1", + }, + ], + spaces: [ + { + description: "A powerful general-purpose speech recognition application.", + id: "hf-audio/whisper-large-v3", + }, + { + description: "Latest ASR model from Useful Sensors.", + id: "mrfakename/Moonshinex", + }, + { + description: "A high quality speech and text translation model by Meta.", + id: "facebook/seamless_m4t", + }, + { + description: "A powerful multilingual ASR and Speech Translation model by Nvidia", + id: "nvidia/canary-1b", + }, + ], + summary: "Automatic Speech Recognition (ASR), also known as Speech to Text (STT), is the task of transcribing a given audio to text. It has many applications, such as voice user interfaces.", + widgetModels: ["openai/whisper-large-v3"], + youtubeId: "TksaY_FDgnk", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..66b335f310af19f6c5741e82287897ecad32f647 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts @@ -0,0 +1,151 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Automatic Speech Recognition inference + */ +export interface AutomaticSpeechRecognitionInput { + /** + * The input audio data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the audio data as a raw bytes payload. + */ + inputs: Blob; + /** + * Additional inference parameters for Automatic Speech Recognition + */ + parameters?: AutomaticSpeechRecognitionParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Automatic Speech Recognition + */ +export interface AutomaticSpeechRecognitionParameters { + /** + * Parametrization of the text generation process + */ + generation_parameters?: GenerationParameters; + /** + * Whether to output corresponding timestamps with the generated text + */ + return_timestamps?: boolean; + [property: string]: unknown; +} +/** + * Parametrization of the text generation process + */ +export interface GenerationParameters { + /** + * Whether to use sampling instead of greedy decoding when generating new tokens. + */ + do_sample?: boolean; + /** + * Controls the stopping condition for beam-based methods. + */ + early_stopping?: EarlyStoppingUnion; + /** + * If set to float strictly between 0 and 1, only tokens with a conditional probability + * greater than epsilon_cutoff will be sampled. In the paper, suggested values range from + * 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language + * Model Desmoothing](https://hf.co/papers/2210.15191) for more details. + */ + epsilon_cutoff?: number; + /** + * Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to + * float strictly between 0 and 1, a token is only considered if it is greater than either + * eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter + * term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In + * the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model. + * See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) + * for more details. + */ + eta_cutoff?: number; + /** + * The maximum length (in tokens) of the generated text, including the input. + */ + max_length?: number; + /** + * The maximum number of tokens to generate. Takes precedence over max_length. + */ + max_new_tokens?: number; + /** + * The minimum length (in tokens) of the generated text, including the input. + */ + min_length?: number; + /** + * The minimum number of tokens to generate. Takes precedence over min_length. + */ + min_new_tokens?: number; + /** + * Number of groups to divide num_beams into in order to ensure diversity among different + * groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details. + */ + num_beam_groups?: number; + /** + * Number of beams to use for beam search. + */ + num_beams?: number; + /** + * The value balances the model confidence and the degeneration penalty in contrastive + * search decoding. + */ + penalty_alpha?: number; + /** + * The value used to modulate the next token probabilities. + */ + temperature?: number; + /** + * The number of highest probability vocabulary tokens to keep for top-k-filtering. + */ + top_k?: number; + /** + * If set to float < 1, only the smallest set of most probable tokens with probabilities + * that add up to top_p or higher are kept for generation. + */ + top_p?: number; + /** + * Local typicality measures how similar the conditional probability of predicting a target + * token next is to the expected conditional probability of predicting a random token next, + * given the partial text already generated. If set to float < 1, the smallest set of the + * most locally typical tokens with probabilities that add up to typical_p or higher are + * kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details. + */ + typical_p?: number; + /** + * Whether the model should use the past last key/values attentions to speed up decoding + */ + use_cache?: boolean; + [property: string]: unknown; +} +/** + * Controls the stopping condition for beam-based methods. + */ +export type EarlyStoppingUnion = boolean | "never"; +/** + * Outputs of inference for the Automatic Speech Recognition task + */ +export interface AutomaticSpeechRecognitionOutput { + /** + * When returnTimestamps is enabled, chunks contains a list of audio chunks identified by + * the model. + */ + chunks?: AutomaticSpeechRecognitionOutputChunk[]; + /** + * The recognized text. + */ + text: string; + [property: string]: unknown; +} +export interface AutomaticSpeechRecognitionOutputChunk { + /** + * A chunk of text identified by the model + */ + text: string; + /** + * The start and end timestamps corresponding with the text + */ + timestamp: number[]; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..dece49d1b3a428996138b9dce1065a1c4b72d803 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/automatic-speech-recognition/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,oCAAoC,CAAC;IAClD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACpD;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AACnD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;;OAGG;IACH,MAAM,CAAC,EAAE,qCAAqC,EAAE,CAAC;IACjD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,qCAAqC;IACrD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/automatic-speech-recognition/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95cbf492c8c800787dbdcc4b4d18e3d3f33cffdd --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.d.ts @@ -0,0 +1,330 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Chat Completion Input. + * + * Auto-generated from TGI specs. + * For more details, check out + * https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tgi-import.ts. + */ +export interface ChatCompletionInput { + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing + * frequency in the text so far, + * decreasing the model's likelihood to repeat the same line verbatim. + */ + frequency_penalty?: number; + /** + * UNUSED + * Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON + * object that maps tokens + * (specified by their token ID in the tokenizer) to an associated bias value from -100 to + * 100. Mathematically, + * the bias is added to the logits generated by the model prior to sampling. The exact + * effect will vary per model, + * but values between -1 and 1 should decrease or increase likelihood of selection; values + * like -100 or 100 should + * result in a ban or exclusive selection of the relevant token. + */ + logit_bias?: number[]; + /** + * Whether to return log probabilities of the output tokens or not. If true, returns the log + * probabilities of each + * output token returned in the content of message. + */ + logprobs?: boolean; + /** + * The maximum number of tokens that can be generated in the chat completion. + */ + max_tokens?: number; + /** + * A list of messages comprising the conversation so far. + */ + messages: ChatCompletionInputMessage[]; + /** + * [UNUSED] ID of the model to use. See the model endpoint compatibility table for details + * on which models work with the Chat API. + */ + model?: string; + /** + * UNUSED + * How many chat completion choices to generate for each input message. Note that you will + * be charged based on the + * number of generated tokens across all of the choices. Keep n as 1 to minimize costs. + */ + n?: number; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they + * appear in the text so far, + * increasing the model's likelihood to talk about new topics + */ + presence_penalty?: number; + response_format?: ChatCompletionInputGrammarType; + seed?: number; + /** + * Up to 4 sequences where the API will stop generating further tokens. + */ + stop?: string[]; + stream?: boolean; + stream_options?: ChatCompletionInputStreamOptions; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the + * output more random, while + * lower values like 0.2 will make it more focused and deterministic. + * + * We generally recommend altering this or `top_p` but not both. + */ + temperature?: number; + tool_choice?: ChatCompletionInputToolChoice; + /** + * A prompt to be appended before the tools + */ + tool_prompt?: string; + /** + * A list of tools the model may call. Currently, only functions are supported as a tool. + * Use this to provide a list of + * functions the model may generate JSON inputs for. + */ + tools?: ChatCompletionInputTool[]; + /** + * An integer between 0 and 5 specifying the number of most likely tokens to return at each + * token position, each with + * an associated log probability. logprobs must be set to true if this parameter is used. + */ + top_logprobs?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model + * considers the results of the + * tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% + * probability mass are considered. + */ + top_p?: number; + [property: string]: unknown; +} +export interface ChatCompletionInputMessage { + content?: ChatCompletionInputMessageContent; + name?: string; + role: string; + tool_calls?: ChatCompletionInputToolCall[]; + [property: string]: unknown; +} +export type ChatCompletionInputMessageContent = ChatCompletionInputMessageChunk[] | string; +export interface ChatCompletionInputMessageChunk { + image_url?: ChatCompletionInputURL; + text?: string; + type: ChatCompletionInputMessageChunkType; + [property: string]: unknown; +} +export interface ChatCompletionInputURL { + url: string; + [property: string]: unknown; +} +export type ChatCompletionInputMessageChunkType = "text" | "image_url"; +export interface ChatCompletionInputToolCall { + function: ChatCompletionInputFunctionDefinition; + id: string; + type: string; + [property: string]: unknown; +} +export interface ChatCompletionInputFunctionDefinition { + description?: string; + name: string; + parameters?: unknown; + [property: string]: unknown; +} +export interface ChatCompletionInputGrammarType { + json_schema?: ChatCompletionInputJSONSchemaConfig; + type: ChatCompletionInputGrammarTypeType; + [property: string]: unknown; +} +export interface ChatCompletionInputJSONSchemaConfig { + /** + * A description of what the response format is for, used by the model to determine how to + * respond in the format. + */ + description?: string; + /** + * The name of the response format. + */ + name: string; + /** + * The schema for the response format, described as a JSON Schema object. Learn how to build + * JSON schemas [here](https://json-schema.org/). + */ + schema?: { + [key: string]: unknown; + }; + /** + * Whether to enable strict schema adherence when generating the output. If set to true, the + * model will always follow the exact schema defined in the `schema` field. + */ + strict?: boolean; + [property: string]: unknown; +} +export type ChatCompletionInputGrammarTypeType = "text" | "json_schema" | "json_object"; +export interface ChatCompletionInputStreamOptions { + /** + * If set, an additional chunk will be streamed before the data: [DONE] message. The usage + * field on this chunk shows the token usage statistics for the entire request, and the + * choices field will always be an empty array. All other chunks will also include a usage + * field, but with a null value. + */ + include_usage?: boolean; + [property: string]: unknown; +} +/** + * + * + */ +export type ChatCompletionInputToolChoice = ChatCompletionInputToolChoiceEnum | ChatCompletionInputToolChoiceObject; +/** + * Means the model can pick between generating a message or calling one or more tools. + * + * Means the model will not call any tool and instead generates a message. + * + * Means the model must call one or more tools. + */ +export type ChatCompletionInputToolChoiceEnum = "auto" | "none" | "required"; +export interface ChatCompletionInputToolChoiceObject { + function: ChatCompletionInputFunctionName; + [property: string]: unknown; +} +export interface ChatCompletionInputFunctionName { + name: string; + [property: string]: unknown; +} +export interface ChatCompletionInputTool { + function: ChatCompletionInputFunctionDefinition; + type: string; + [property: string]: unknown; +} +/** + * Chat Completion Output. + * + * Auto-generated from TGI specs. + * For more details, check out + * https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tgi-import.ts. + */ +export interface ChatCompletionOutput { + choices: ChatCompletionOutputComplete[]; + created: number; + id: string; + model: string; + system_fingerprint: string; + usage: ChatCompletionOutputUsage; + [property: string]: unknown; +} +export interface ChatCompletionOutputComplete { + finish_reason: string; + index: number; + logprobs?: ChatCompletionOutputLogprobs; + message: ChatCompletionOutputMessage; + [property: string]: unknown; +} +export interface ChatCompletionOutputLogprobs { + content: ChatCompletionOutputLogprob[]; + [property: string]: unknown; +} +export interface ChatCompletionOutputLogprob { + logprob: number; + token: string; + top_logprobs: ChatCompletionOutputTopLogprob[]; + [property: string]: unknown; +} +export interface ChatCompletionOutputTopLogprob { + logprob: number; + token: string; + [property: string]: unknown; +} +export interface ChatCompletionOutputMessage { + content?: string; + role: string; + tool_call_id?: string; + tool_calls?: ChatCompletionOutputToolCall[]; + [property: string]: unknown; +} +export interface ChatCompletionOutputToolCall { + function: ChatCompletionOutputFunctionDefinition; + id: string; + type: string; + [property: string]: unknown; +} +export interface ChatCompletionOutputFunctionDefinition { + arguments: string; + description?: string; + name: string; + [property: string]: unknown; +} +export interface ChatCompletionOutputUsage { + completion_tokens: number; + prompt_tokens: number; + total_tokens: number; + [property: string]: unknown; +} +/** + * Chat Completion Stream Output. + * + * Auto-generated from TGI specs. + * For more details, check out + * https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tgi-import.ts. + */ +export interface ChatCompletionStreamOutput { + choices: ChatCompletionStreamOutputChoice[]; + created: number; + id: string; + model: string; + system_fingerprint: string; + usage?: ChatCompletionStreamOutputUsage; + [property: string]: unknown; +} +export interface ChatCompletionStreamOutputChoice { + delta: ChatCompletionStreamOutputDelta; + finish_reason?: string; + index: number; + logprobs?: ChatCompletionStreamOutputLogprobs; + [property: string]: unknown; +} +export interface ChatCompletionStreamOutputDelta { + content?: string; + role: string; + tool_call_id?: string; + tool_calls?: ChatCompletionStreamOutputDeltaToolCall[]; + [property: string]: unknown; +} +export interface ChatCompletionStreamOutputDeltaToolCall { + function: ChatCompletionStreamOutputFunction; + id: string; + index: number; + type: string; + [property: string]: unknown; +} +export interface ChatCompletionStreamOutputFunction { + arguments: string; + name?: string; + [property: string]: unknown; +} +export interface ChatCompletionStreamOutputLogprobs { + content: ChatCompletionStreamOutputLogprob[]; + [property: string]: unknown; +} +export interface ChatCompletionStreamOutputLogprob { + logprob: number; + token: string; + top_logprobs: ChatCompletionStreamOutputTopLogprob[]; + [property: string]: unknown; +} +export interface ChatCompletionStreamOutputTopLogprob { + logprob: number; + token: string; + [property: string]: unknown; +} +export interface ChatCompletionStreamOutputUsage { + completion_tokens: number; + prompt_tokens: number; + total_tokens: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..a70734f51301564a95ec185360acea6d84f301a2 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/chat-completion/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,0BAA0B,EAAE,CAAC;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,8BAA8B,CAAC;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,gCAAgC,CAAC;IAClD;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,6BAA6B,CAAC;IAC5C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAClC;;;;OAIG;IACH,YA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C;IACd,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,kCAAkC;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,kCAAkC;IAClD,OAAO,EAAE,iCAAiC,EAAE,CAAC;IAC7C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,iCAAiC;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,oCAAoC,EAAE,CAAC;IACrD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,oCAAoC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,+BAA+B;IAC/C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/chat-completion/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..cb232576320cf1d06f658b28334cf5d6afa01a01 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/depth-estimation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAiEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.js new file mode 100644 index 0000000000000000000000000000000000000000..3a2618113845d1620d13fae1f45b52f33492986f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/data.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "NYU Depth V2 Dataset: Video dataset containing both RGB and depth sensor data.", + id: "sayakpaul/nyu_depth_v2", + }, + { + description: "Monocular depth estimation benchmark based without noise and errors.", + id: "depth-anything/DA-2K", + }, + ], + demo: { + inputs: [ + { + filename: "depth-estimation-input.jpg", + type: "img", + }, + ], + outputs: [ + { + filename: "depth-estimation-output.png", + type: "img", + }, + ], + }, + metrics: [], + models: [ + { + description: "Cutting-edge depth estimation model.", + id: "depth-anything/Depth-Anything-V2-Large", + }, + { + description: "A strong monocular depth estimation model.", + id: "jingheya/lotus-depth-g-v1-0", + }, + { + description: "A depth estimation model that predicts depth in videos.", + id: "tencent/DepthCrafter", + }, + { + description: "A robust depth estimation model.", + id: "apple/DepthPro-hf", + }, + ], + spaces: [ + { + description: "An application that predicts the depth of an image and then reconstruct the 3D model as voxels.", + id: "radames/dpt-depth-estimation-3d-voxels", + }, + { + description: "An application for bleeding-edge depth estimation.", + id: "akhaliq/depth-pro", + }, + { + description: "An application on cutting-edge depth estimation in videos.", + id: "tencent/DepthCrafter", + }, + { + description: "A human-centric depth estimation application.", + id: "facebook/sapiens-depth", + }, + ], + summary: "Depth estimation is the task of predicting depth of the objects present in an image.", + widgetModels: [""], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7585f1ac33bb2d5ea520295d56da1ca4face71fb --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.d.ts @@ -0,0 +1,36 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Depth Estimation inference + */ +export interface DepthEstimationInput { + /** + * The input image data + */ + inputs: unknown; + /** + * Additional inference parameters for Depth Estimation + */ + parameters?: { + [key: string]: unknown; + }; + [property: string]: unknown; +} +/** + * Outputs of inference for the Depth Estimation task + */ +export interface DepthEstimationOutput { + /** + * The predicted depth as an image + */ + depth?: unknown; + /** + * The predicted depth as a tensor + */ + predicted_depth?: unknown; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..033a915d9d5a928ebb48b36b6eda9f5e7cd5e4fb --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/depth-estimation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;IACF,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/depth-estimation/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..9c729fbee845c5ce760e5b2345f751973770add5 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/document-question-answering/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAgFf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.js new file mode 100644 index 0000000000000000000000000000000000000000..f5207d13cb6ba039eb808a892595f0e18ce381cc --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/data.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Largest document understanding dataset.", + id: "HuggingFaceM4/Docmatix", + }, + { + description: "Dataset from the 2020 DocVQA challenge. The documents are taken from the UCSF Industry Documents Library.", + id: "eliolio/docvqa", + }, + ], + demo: { + inputs: [ + { + label: "Question", + content: "What is the idea behind the consumer relations efficiency team?", + type: "text", + }, + { + filename: "document-question-answering-input.png", + type: "img", + }, + ], + outputs: [ + { + label: "Answer", + content: "Balance cost efficiency with quality customer service", + type: "text", + }, + ], + }, + metrics: [ + { + description: "The evaluation metric for the DocVQA challenge is the Average Normalized Levenshtein Similarity (ANLS). This metric is flexible to character regognition errors and compares the predicted answer with the ground truth answer.", + id: "anls", + }, + { + description: "Exact Match is a metric based on the strict character match of the predicted answer and the right answer. For answers predicted correctly, the Exact Match will be 1. Even if only one character is different, Exact Match will be 0", + id: "exact-match", + }, + ], + models: [ + { + description: "A robust document question answering model.", + id: "impira/layoutlm-document-qa", + }, + { + description: "A document question answering model specialized in invoices.", + id: "impira/layoutlm-invoices", + }, + { + description: "A special model for OCR-free document question answering.", + id: "microsoft/udop-large", + }, + { + description: "A powerful model for document question answering.", + id: "google/pix2struct-docvqa-large", + }, + ], + spaces: [ + { + description: "A robust document question answering application.", + id: "impira/docquery", + }, + { + description: "An application that can answer questions from invoices.", + id: "impira/invoices", + }, + { + description: "An application to compare different document question answering models.", + id: "merve/compare_docvqa_models", + }, + ], + summary: "Document Question Answering (also known as Document Visual Question Answering) is the task of answering questions on document images. Document question answering models take a (document, question) pair as input and return an answer in natural language. Models usually rely on multi-modal features, combining text, position of words (bounding-boxes) and image.", + widgetModels: ["impira/layoutlm-invoices"], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d0201e7778a3a2003841e54a7e944a2b59a46653 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.d.ts @@ -0,0 +1,105 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Document Question Answering inference + */ +export interface DocumentQuestionAnsweringInput { + /** + * One (document, question) pair to answer + */ + inputs: DocumentQuestionAnsweringInputData; + /** + * Additional inference parameters for Document Question Answering + */ + parameters?: DocumentQuestionAnsweringParameters; + [property: string]: unknown; +} +/** + * One (document, question) pair to answer + */ +export interface DocumentQuestionAnsweringInputData { + /** + * The image on which the question is asked + */ + image: unknown; + /** + * A question to ask of the document + */ + question: string; + [property: string]: unknown; +} +/** + * Additional inference parameters for Document Question Answering + */ +export interface DocumentQuestionAnsweringParameters { + /** + * If the words in the document are too long to fit with the question for the model, it will + * be split in several chunks with some overlap. This argument controls the size of that + * overlap. + */ + doc_stride?: number; + /** + * Whether to accept impossible as an answer + */ + handle_impossible_answer?: boolean; + /** + * Language to use while running OCR. Defaults to english. + */ + lang?: string; + /** + * The maximum length of predicted answers (e.g., only answers with a shorter length are + * considered). + */ + max_answer_len?: number; + /** + * The maximum length of the question after tokenization. It will be truncated if needed. + */ + max_question_len?: number; + /** + * The maximum length of the total sentence (context + question) in tokens of each chunk + * passed to the model. The context will be split in several chunks (using doc_stride as + * overlap) if needed. + */ + max_seq_len?: number; + /** + * The number of answers to return (will be chosen by order of likelihood). Can return less + * than top_k answers if there are not enough options available within the context. + */ + top_k?: number; + /** + * A list of words and bounding boxes (normalized 0->1000). If provided, the inference will + * skip the OCR step and use the provided bounding boxes instead. + */ + word_boxes?: WordBox[]; + [property: string]: unknown; +} +export type WordBox = number[] | string; +export type DocumentQuestionAnsweringOutput = DocumentQuestionAnsweringOutputElement[]; +/** + * Outputs of inference for the Document Question Answering task + */ +export interface DocumentQuestionAnsweringOutputElement { + /** + * The answer to the question. + */ + answer: string; + /** + * The end word index of the answer (in the OCR’d version of the input or provided word + * boxes). + */ + end: number; + /** + * The probability associated to the answer. + */ + score: number; + /** + * The start word index of the answer (in the OCR’d version of the input or provided word + * boxes). + */ + start: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..f86c5635adab67721cb8843206eb5fc48b4c7d0e --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/document-question-answering/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;OAEG;IACH,MAAM,EAAE,kCAAkC,CAAC;IAC3C;;OAEG;IACH,UAAU,CAAC,EAAE,mCAAmC,CAAC;IACjD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAClD;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,mCAAmC;IACnD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC;IACvB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,+BAA+B,GAAG,sCAAsC,EAAE,CAAC;AACvF;;GAEG;AACH,MAAM,WAAW,sCAAsC;IACtD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/document-question-answering/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1b7c67323ed90db6335e841bb8cdb74d2f429d4c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/feature-extraction/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAoDf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.js new file mode 100644 index 0000000000000000000000000000000000000000..c8782958720d7b6a26216cf5a03dd171fe43d879 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/data.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Wikipedia dataset containing cleaned articles of all languages. Can be used to train `feature-extraction` models.", + id: "wikipedia", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "India, officially the Republic of India, is a country in South Asia.", + type: "text", + }, + ], + outputs: [ + { + table: [ + ["Dimension 1", "Dimension 2", "Dimension 3"], + ["2.583383083343506", "2.757075071334839", "0.9023529887199402"], + ["8.29393482208252", "1.1071064472198486", "2.03399395942688"], + ["-0.7754912972450256", "-1.647324562072754", "-0.6113331913948059"], + ["0.07087723910808563", "1.5942802429199219", "1.4610432386398315"], + ], + type: "tabular", + }, + ], + }, + metrics: [], + models: [ + { + description: "A powerful feature extraction model for natural language processing tasks.", + id: "thenlper/gte-large", + }, + { + description: "A strong feature extraction model for retrieval.", + id: "Alibaba-NLP/gte-Qwen1.5-7B-instruct", + }, + ], + spaces: [ + { + description: "A leaderboard to rank text feature extraction models based on a benchmark.", + id: "mteb/leaderboard", + }, + { + description: "A leaderboard to rank best feature extraction models based on human feedback.", + id: "mteb/arena", + }, + ], + summary: "Feature extraction is the task of extracting features learnt in a model.", + widgetModels: ["facebook/bart-base"], +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..688961c27e3dc737f10f5c7751b906eb109b4252 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.d.ts @@ -0,0 +1,42 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +export type FeatureExtractionOutput = Array; +/** + * Feature Extraction Input. + * + * Auto-generated from TEI specs. + * For more details, check out + * https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tei-import.ts. + */ +export interface FeatureExtractionInput { + /** + * The text or list of texts to embed. + */ + inputs: FeatureExtractionInputs; + normalize?: boolean; + /** + * The name of the prompt that should be used by for encoding. If not set, no prompt + * will be applied. + * + * Must be a key in the `sentence-transformers` configuration `prompts` dictionary. + * + * For example if ``prompt_name`` is "query" and the ``prompts`` is {"query": "query: ", + * ...}, + * then the sentence "What is the capital of France?" will be encoded as + * "query: What is the capital of France?" because the prompt text will be prepended before + * any text to encode. + */ + prompt_name?: string; + truncate?: boolean; + truncation_direction?: FeatureExtractionInputTruncationDirection; + [property: string]: unknown; +} +/** + * The text or list of texts to embed. + */ +export type FeatureExtractionInputs = string[] | string; +export type FeatureExtractionInputTruncationDirection = "left" | "right"; +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6c2bd1f9aef9f4084c503ce5754da17e463ea4e7 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/feature-extraction/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACtD;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,MAAM,EAAE,uBAAuB,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,yCAAyC,CAAC;IACjE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;AACxD,MAAM,MAAM,yCAAyC,GAAG,MAAM,GAAG,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/feature-extraction/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..d8447494880d737be45833c566928770eced4b7f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/fill-mask/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA0Ef,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.js new file mode 100644 index 0000000000000000000000000000000000000000..cd7233797cc4dd2b914affced4579ea67544838d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/data.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A common dataset that is used to train models for many languages.", + id: "wikipedia", + }, + { + description: "A large English dataset with text crawled from the web.", + id: "c4", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "The barked at me", + type: "text", + }, + ], + outputs: [ + { + type: "chart", + data: [ + { + label: "wolf", + score: 0.487, + }, + { + label: "dog", + score: 0.061, + }, + { + label: "cat", + score: 0.058, + }, + { + label: "fox", + score: 0.047, + }, + { + label: "squirrel", + score: 0.025, + }, + ], + }, + ], + }, + metrics: [ + { + description: "Cross Entropy is a metric that calculates the difference between two probability distributions. Each probability distribution is the distribution of predicted words", + id: "cross_entropy", + }, + { + description: "Perplexity is the exponential of the cross-entropy loss. It evaluates the probabilities assigned to the next word by the model. Lower perplexity indicates better performance", + id: "perplexity", + }, + ], + models: [ + { + description: "State-of-the-art masked language model.", + id: "answerdotai/ModernBERT-large", + }, + { + description: "A multilingual model trained on 100 languages.", + id: "FacebookAI/xlm-roberta-base", + }, + ], + spaces: [], + summary: "Masked language modeling is the task of masking some of the words in a sentence and predicting which words should replace those masks. These models are useful when we want to get a statistical understanding of the language in which the model is trained in.", + widgetModels: ["distilroberta-base"], + youtubeId: "mqElG5QJWUg", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2d695741a7232bad148db87e1e55cf9825d20dcd --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.d.ts @@ -0,0 +1,61 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Fill Mask inference + */ +export interface FillMaskInput { + /** + * The text with masked tokens + */ + inputs: string; + /** + * Additional inference parameters for Fill Mask + */ + parameters?: FillMaskParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Fill Mask + */ +export interface FillMaskParameters { + /** + * When passed, the model will limit the scores to the passed targets instead of looking up + * in the whole vocabulary. If the provided targets are not in the model vocab, they will be + * tokenized and the first resulting token will be used (with a warning, and that might be + * slower). + */ + targets?: string[]; + /** + * When passed, overrides the number of predictions to return. + */ + top_k?: number; + [property: string]: unknown; +} +export type FillMaskOutput = FillMaskOutputElement[]; +/** + * Outputs of inference for the Fill Mask task + */ +export interface FillMaskOutputElement { + /** + * The corresponding probability + */ + score: number; + /** + * The corresponding input with the mask token prediction. + */ + sequence: string; + /** + * The predicted token id (to replace the masked one). + */ + token: number; + tokenStr: unknown; + /** + * The predicted token (to replace the masked one). + */ + token_str?: string; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5d530f0a2d16b0ef869050b3c6edf02eb4922ebf --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/fill-mask/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,cAAc,GAAG,qBAAqB,EAAE,CAAC;AACrD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/fill-mask/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..f157fe0bf42e631cd4810f5d9d3b88a1bd8cd488 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAkFf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.js new file mode 100644 index 0000000000000000000000000000000000000000..92e626f89b0725db39a8ff4e336f961e9ca48e6d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/data.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + // TODO write proper description + description: "Benchmark dataset used for image classification with images that belong to 100 classes.", + id: "cifar100", + }, + { + // TODO write proper description + description: "Dataset consisting of images of garments.", + id: "fashion_mnist", + }, + ], + demo: { + inputs: [ + { + filename: "image-classification-input.jpeg", + type: "img", + }, + ], + outputs: [ + { + type: "chart", + data: [ + { + label: "Egyptian cat", + score: 0.514, + }, + { + label: "Tabby cat", + score: 0.193, + }, + { + label: "Tiger cat", + score: 0.068, + }, + ], + }, + ], + }, + metrics: [ + { + description: "", + id: "accuracy", + }, + { + description: "", + id: "recall", + }, + { + description: "", + id: "precision", + }, + { + description: "", + id: "f1", + }, + ], + models: [ + { + description: "A strong image classification model.", + id: "google/vit-base-patch16-224", + }, + { + description: "A robust image classification model.", + id: "facebook/deit-base-distilled-patch16-224", + }, + { + description: "A strong image classification model.", + id: "facebook/convnext-large-224", + }, + ], + spaces: [ + { + description: "A leaderboard to evaluate different image classification models.", + id: "timm/leaderboard", + }, + ], + summary: "Image classification is the task of assigning a label or class to an entire image. Images are expected to have only one class for each image. Image classification models take an image as input and return a prediction about which class the image belongs to.", + widgetModels: ["google/vit-base-patch16-224"], + youtubeId: "tjAIM7BOYhw", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cea2bf9efe0f9dfa738b46d40fb17dcaba022793 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.d.ts @@ -0,0 +1,54 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Image Classification inference + */ +export interface ImageClassificationInput { + /** + * The input image data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the image data as a raw bytes payload. + */ + inputs: Blob; + /** + * Additional inference parameters for Image Classification + */ + parameters?: ImageClassificationParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Image Classification + */ +export interface ImageClassificationParameters { + /** + * The function to apply to the model outputs in order to retrieve the scores. + */ + function_to_apply?: ClassificationOutputTransform; + /** + * When specified, limits the output to the top K most probable classes. + */ + top_k?: number; + [property: string]: unknown; +} +/** + * The function to apply to the model outputs in order to retrieve the scores. + */ +export type ClassificationOutputTransform = "sigmoid" | "softmax" | "none"; +export type ImageClassificationOutput = ImageClassificationOutputElement[]; +/** + * Outputs of inference for the Image Classification task + */ +export interface ImageClassificationOutputElement { + /** + * The predicted class label. + */ + label: string; + /** + * The corresponding probability. + */ + score: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..037c9227770f76072b14980b75b858c399c7a54a --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-classification/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..90bc944282b5d5de9e390cc55fa1f326f5f1b6bf --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-feature-extraction/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA2Df,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.js new file mode 100644 index 0000000000000000000000000000000000000000..a5a34f85c4b4f5d7b48deb69f0ce050fe6b50498 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-feature-extraction/data.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "ImageNet-1K is a image classification dataset in which images are used to train image-feature-extraction models.", + id: "imagenet-1k", + }, + ], + demo: { + inputs: [ + { + filename: "mask-generation-input.png", + type: "img", + }, + ], + outputs: [ + { + table: [ + ["Dimension 1", "Dimension 2", "Dimension 3"], + ["0.21236686408519745", "1.0919708013534546", "0.8512550592422485"], + ["0.809657871723175", "-0.18544459342956543", "-0.7851548194885254"], + ["1.3103108406066895", "-0.2479034662246704", "-0.9107287526130676"], + ["1.8536205291748047", "-0.36419737339019775", "0.09717650711536407"], + ], + type: "tabular", + }, + ], + }, + metrics: [], + models: [ + { + description: "A powerful image feature extraction model.", + id: "timm/vit_large_patch14_dinov2.lvd142m", + }, + { + description: "A strong image feature extraction model.", + id: "nvidia/MambaVision-T-1K", + }, + { + description: "A robust image feature extraction model.", + id: "facebook/dino-vitb16", + }, + { + description: "Cutting-edge image feature extraction model.", + id: "apple/aimv2-large-patch14-336-distilled", + }, + { + description: "Strong image feature extraction model that can be used on images and documents.", + id: "OpenGVLab/InternViT-6B-448px-V1-2", + }, + ], + spaces: [ + { + description: "A leaderboard to evaluate different image-feature-extraction models on classification performances", + id: "timm/leaderboard", + }, + ], + summary: "Image feature extraction is the task of extracting features learnt in a computer vision model.", + widgetModels: [], +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..23ff6576f4a0f6e8cee58c7500193af6426f7738 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-segmentation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA8Ff,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.js new file mode 100644 index 0000000000000000000000000000000000000000..d4bb17fa6913a34a37c13fcd4d07c519d320d42c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/data.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Scene segmentation dataset.", + id: "scene_parse_150", + }, + ], + demo: { + inputs: [ + { + filename: "image-segmentation-input.jpeg", + type: "img", + }, + ], + outputs: [ + { + filename: "image-segmentation-output.png", + type: "img", + }, + ], + }, + metrics: [ + { + description: "Average Precision (AP) is the Area Under the PR Curve (AUC-PR). It is calculated for each semantic class separately", + id: "Average Precision", + }, + { + description: "Mean Average Precision (mAP) is the overall average of the AP values", + id: "Mean Average Precision", + }, + { + description: "Intersection over Union (IoU) is the overlap of segmentation masks. Mean IoU is the average of the IoU of all semantic classes", + id: "Mean Intersection over Union", + }, + { + description: "APα is the Average Precision at the IoU threshold of a α value, for example, AP50 and AP75", + id: "APα", + }, + ], + models: [ + { + // TO DO: write description + description: "Solid panoptic segmentation model trained on COCO.", + id: "tue-mps/coco_panoptic_eomt_large_640", + }, + { + description: "Background removal model.", + id: "briaai/RMBG-1.4", + }, + { + description: "A multipurpose image segmentation model for high resolution images.", + id: "ZhengPeng7/BiRefNet", + }, + { + description: "Powerful human-centric image segmentation model.", + id: "facebook/sapiens-seg-1b", + }, + { + description: "Panoptic segmentation model trained on the COCO (common objects) dataset.", + id: "facebook/mask2former-swin-large-coco-panoptic", + }, + ], + spaces: [ + { + description: "A semantic segmentation application that can predict unseen instances out of the box.", + id: "facebook/ov-seg", + }, + { + description: "One of the strongest segmentation applications.", + id: "jbrinkma/segment-anything", + }, + { + description: "A human-centric segmentation model.", + id: "facebook/sapiens-pose", + }, + { + description: "An instance segmentation application to predict neuronal cell types from microscopy images.", + id: "rashmi/sartorius-cell-instance-segmentation", + }, + { + description: "An application that segments videos.", + id: "ArtGAN/Segment-Anything-Video", + }, + { + description: "An panoptic segmentation application built for outdoor environments.", + id: "segments/panoptic-segment-anything", + }, + ], + summary: "Image Segmentation divides an image into segments where each pixel in the image is mapped to an object. This task has multiple variants such as instance segmentation, panoptic segmentation and semantic segmentation.", + widgetModels: ["nvidia/segformer-b0-finetuned-ade-512-512"], + youtubeId: "dKE8SIt9C-w", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..62893d683d831473f37662e89e8742a0582f6d4f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.d.ts @@ -0,0 +1,68 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Image Segmentation inference + */ +export interface ImageSegmentationInput { + /** + * The input image data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the image data as a raw bytes payload. + */ + inputs: Blob; + /** + * Additional inference parameters for Image Segmentation + */ + parameters?: ImageSegmentationParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Image Segmentation + */ +export interface ImageSegmentationParameters { + /** + * Threshold to use when turning the predicted masks into binary values. + */ + mask_threshold?: number; + /** + * Mask overlap threshold to eliminate small, disconnected segments. + */ + overlap_mask_area_threshold?: number; + /** + * Segmentation task to be performed, depending on model capabilities. + */ + subtask?: ImageSegmentationSubtask; + /** + * Probability threshold to filter out predicted masks. + */ + threshold?: number; + [property: string]: unknown; +} +/** + * Segmentation task to be performed, depending on model capabilities. + */ +export type ImageSegmentationSubtask = "instance" | "panoptic" | "semantic"; +export type ImageSegmentationOutput = ImageSegmentationOutputElement[]; +/** + * Outputs of inference for the Image Segmentation task + * + * A predicted mask / segment + */ +export interface ImageSegmentationOutputElement { + /** + * The label of the predicted segment. + */ + label: string; + /** + * The corresponding mask as a black-and-white image (base64-encoded). + */ + mask: string; + /** + * The score or confidence degree the model has. + */ + score?: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..002f53684e81edb0b5ac7dd0ed180a404781f3e2 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-segmentation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,EAAE,CAAC;AACvE;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-segmentation/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..53a0eeeace77cd5956a7331e9ab7cb5c8f3fd1fb --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-text-to-image/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAiDf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.js new file mode 100644 index 0000000000000000000000000000000000000000..2af0abfa134fa1695cc0f5ed0a5852188e6b8a24 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/data.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [], + demo: { + inputs: [ + { + filename: "image-text-to-image-input.jpeg", + type: "img", + }, + { + label: "Input", + content: "A city above clouds, pastel colors, Victorian style", + type: "text", + }, + ], + outputs: [ + { + filename: "image-text-to-image-output.png", + type: "img", + }, + ], + }, + metrics: [ + { + description: "The Fréchet Inception Distance (FID) calculates the distance between distributions between synthetic and real samples. A lower FID score indicates better similarity between the distributions of real and generated images.", + id: "FID", + }, + { + description: "CLIP Score measures the similarity between the generated image and the text prompt using CLIP embeddings. A higher score indicates better alignment with the text prompt.", + id: "CLIP", + }, + ], + models: [ + { + description: "A powerful model for image-text-to-image generation.", + id: "black-forest-labs/FLUX.2-dev", + }, + ], + spaces: [ + { + description: "An application for image-text-to-image generation.", + id: "black-forest-labs/FLUX.2-dev", + }, + ], + summary: "Image-text-to-image models take an image and a text prompt as input and generate a new image based on the reference image and text instructions. These models are useful for image editing, style transfer, image variations, and guided image generation tasks.", + widgetModels: ["black-forest-labs/FLUX.2-dev"], + youtubeId: undefined, +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6d2dab3a0b73c4600be87602613629b9d288570 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.d.ts @@ -0,0 +1,76 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Image Text To Image inference. Either inputs (image) or prompt (in parameters) + * must be provided, or both. + */ +export interface ImageTextToImageInput { + /** + * The input image data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the image data as a raw bytes payload. Either this or prompt must be + * provided. + */ + inputs?: Blob; + /** + * Additional inference parameters for Image Text To Image + */ + parameters?: ImageTextToImageParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Image Text To Image + */ +export interface ImageTextToImageParameters { + /** + * For diffusion models. A higher guidance scale value encourages the model to generate + * images closely linked to the text prompt at the expense of lower image quality. + */ + guidance_scale?: number; + /** + * One prompt to guide what NOT to include in image generation. + */ + negative_prompt?: string; + /** + * For diffusion models. The number of denoising steps. More denoising steps usually lead to + * a higher quality image at the expense of slower inference. + */ + num_inference_steps?: number; + /** + * The text prompt to guide the image generation. Either this or inputs (image) must be + * provided. + */ + prompt?: string; + /** + * Seed for the random number generator. + */ + seed?: number; + /** + * The size in pixels of the output image. This parameter is only supported by some + * providers and for specific models. It will be ignored when unsupported. + */ + target_size?: TargetSize; + [property: string]: unknown; +} +/** + * The size in pixels of the output image. This parameter is only supported by some + * providers and for specific models. It will be ignored when unsupported. + */ +export interface TargetSize { + height: number; + width: number; + [property: string]: unknown; +} +/** + * Outputs of inference for the Image Text To Image task + */ +export interface ImageTextToImageOutput { + /** + * The generated image returned as raw bytes in the payload. + */ + image: unknown; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e0caa1a268aacfd85428f46c8615abf68d4f0606 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-text-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;;OAIG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;OAEG;IACH,UAAU,CAAC,EAAE,0BAA0B,CAAC;IACxC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;GAGG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-image/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..b600eb9ac66eb184e991671ecca7a6e8d4b6e8ab --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-text-to-text/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAiFf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.js new file mode 100644 index 0000000000000000000000000000000000000000..eeffaade20f09824f163de8e64f293c449e5d7b9 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-text/data.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Instructions composed of image and text.", + id: "liuhaotian/LLaVA-Instruct-150K", + }, + { + description: "Collection of image-text pairs on scientific topics.", + id: "DAMO-NLP-SG/multimodal_textbook", + }, + { + description: "A collection of datasets made for model fine-tuning.", + id: "HuggingFaceM4/the_cauldron", + }, + { + description: "Screenshots of websites with their HTML/CSS codes.", + id: "HuggingFaceM4/WebSight", + }, + ], + demo: { + inputs: [ + { + filename: "image-text-to-text-input.png", + type: "img", + }, + { + label: "Text Prompt", + content: "Describe the position of the bee in detail.", + type: "text", + }, + ], + outputs: [ + { + label: "Answer", + content: "The bee is sitting on a pink flower, surrounded by other flowers. The bee is positioned in the center of the flower, with its head and front legs sticking out.", + type: "text", + }, + ], + }, + metrics: [], + models: [ + { + description: "Small and efficient yet powerful vision language model.", + id: "HuggingFaceTB/SmolVLM-Instruct", + }, + { + description: "Cutting-edge reasoning vision language model.", + id: "zai-org/GLM-4.5V", + }, + { + description: "Cutting-edge small vision language model to convert documents to text.", + id: "rednote-hilab/dots.ocr", + }, + { + description: "Small yet powerful model.", + id: "Qwen/Qwen2.5-VL-3B-Instruct", + }, + { + description: "Image-text-to-text model with agentic capabilities.", + id: "microsoft/Magma-8B", + }, + ], + spaces: [ + { + description: "Leaderboard to evaluate vision language models.", + id: "opencompass/open_vlm_leaderboard", + }, + { + description: "An application that compares object detection capabilities of different vision language models.", + id: "sergiopaniego/vlm_object_understanding", + }, + { + description: "An application to compare different OCR models.", + id: "prithivMLmods/Multimodal-OCR", + }, + ], + summary: "Image-text-to-text models take in an image and text prompt and output text. These models are also called vision-language models, or VLMs. The difference from image-to-text models is that these models take an additional text input, not restricting the model to certain use cases like image captioning, and may also be trained to accept a conversation as input.", + widgetModels: ["zai-org/GLM-4.5V"], + youtubeId: "IoGaGfU1CIg", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4b9e273281951252ef914c15fc3f2df7c63fdfbd --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-text-to-video/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAiDf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.js new file mode 100644 index 0000000000000000000000000000000000000000..b9d89e46a3ae6c7c5f9ad18ac3570bb1daa3b4bf --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/data.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [], + demo: { + inputs: [ + { + filename: "image-text-to-video-input.jpg", + type: "img", + }, + { + label: "Input", + content: "Darth Vader is surfing on the waves.", + type: "text", + }, + ], + outputs: [ + { + filename: "image-text-to-video-output.gif", + type: "img", + }, + ], + }, + metrics: [ + { + description: "Frechet Video Distance uses a model that captures coherence for changes in frames and the quality of each frame. A smaller score indicates better video generation.", + id: "fvd", + }, + { + description: "CLIPSIM measures similarity between video frames and text using an image-text similarity model. A higher score indicates better video generation.", + id: "clipsim", + }, + ], + models: [ + { + description: "A powerful model for image-text-to-video generation.", + id: "Lightricks/LTX-Video", + }, + ], + spaces: [ + { + description: "An application for image-text-to-video generation.", + id: "Lightricks/ltx-video-distilled", + }, + ], + summary: "Image-text-to-video models take an reference image and a text instructions as and generate a video based on them. These models are useful for animating still images, creating dynamic content from static references, and generating videos with specific motion or transformation guidance.", + widgetModels: ["Lightricks/LTX-Video"], + youtubeId: undefined, +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..069db05bcf626591087431e5284525e1b189cc41 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.d.ts @@ -0,0 +1,78 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Image Text To Video inference. Either inputs (image) or prompt (in parameters) + * must be provided, or both. + */ +export interface ImageTextToVideoInput { + /** + * The input image data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the image data as a raw bytes payload. Either this or prompt must be + * provided. + */ + inputs?: Blob; + /** + * Additional inference parameters for Image Text To Video + */ + parameters?: ImageTextToVideoParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Image Text To Video + */ +export interface ImageTextToVideoParameters { + /** + * For diffusion models. A higher guidance scale value encourages the model to generate + * videos closely linked to the text prompt at the expense of lower image quality. + */ + guidance_scale?: number; + /** + * One prompt to guide what NOT to include in video generation. + */ + negative_prompt?: string; + /** + * The num_frames parameter determines how many video frames are generated. + */ + num_frames?: number; + /** + * The number of denoising steps. More denoising steps usually lead to a higher quality + * video at the expense of slower inference. + */ + num_inference_steps?: number; + /** + * The text prompt to guide the video generation. Either this or inputs (image) must be + * provided. + */ + prompt?: string; + /** + * Seed for the random number generator. + */ + seed?: number; + /** + * The size in pixel of the output video frames. + */ + target_size?: TargetSize; + [property: string]: unknown; +} +/** + * The size in pixel of the output video frames. + */ +export interface TargetSize { + height: number; + width: number; + [property: string]: unknown; +} +/** + * Outputs of inference for the Image Text To Video task + */ +export interface ImageTextToVideoOutput { + /** + * The generated video returned as raw bytes in the payload. + */ + video: unknown; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..dddebe7ae1d8e967527b72e26ba1a9b5f1544c2c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-text-to-video/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;;OAIG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;OAEG;IACH,UAAU,CAAC,EAAE,0BAA0B,CAAC;IACxC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-text-to-video/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8c8b2f7cc89572fcc9c798d136a3bc242d3d98bd --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-3d/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAsEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.js new file mode 100644 index 0000000000000000000000000000000000000000..c43723a73cfabf77214bf04b2900a416e81e704d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-3d/data.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A large dataset of over 10 million 3D objects.", + id: "allenai/objaverse-xl", + }, + { + description: "A dataset of isolated object images for evaluating image-to-3D models.", + id: "dylanebert/iso3d", + }, + ], + demo: { + inputs: [ + { + filename: "image-to-3d-image-input.png", + type: "img", + }, + ], + outputs: [ + { + label: "Result", + content: "image-to-3d-3d-output-filename.glb", + type: "text", + }, + ], + }, + metrics: [], + models: [ + { + description: "Fast image-to-3D mesh model by Tencent.", + id: "TencentARC/InstantMesh", + }, + { + description: "3D world generation model.", + id: "tencent/HunyuanWorld-1", + }, + { + description: "A scaled up image-to-3D mesh model derived from TripoSR.", + id: "hwjiang/Real3D", + }, + { + description: "Consistent image-to-3d generation model.", + id: "stabilityai/stable-point-aware-3d", + }, + ], + spaces: [ + { + description: "Leaderboard to evaluate image-to-3D models.", + id: "dylanebert/3d-arena", + }, + { + description: "Image-to-3D demo with mesh outputs.", + id: "TencentARC/InstantMesh", + }, + { + description: "Image-to-3D demo.", + id: "stabilityai/stable-point-aware-3d", + }, + { + description: "Image-to-3D demo with mesh outputs.", + id: "hwjiang/Real3D", + }, + { + description: "Image-to-3D demo with splat outputs.", + id: "dylanebert/LGM-mini", + }, + ], + summary: "Image-to-3D models take in image input and produce 3D output.", + widgetModels: [], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..df6672e2ac2e6e69cdfdc88c3e5300bb1a441eb8 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-image/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA2Ff,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.js new file mode 100644 index 0000000000000000000000000000000000000000..f65b45a7ba7a9dab6a019297e50368d03e13ca2b --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/data.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Synthetic dataset, for image relighting", + id: "VIDIT", + }, + { + description: "Multiple images of celebrities, used for facial expression translation", + id: "huggan/CelebA-faces", + }, + { + description: "12M image-caption pairs.", + id: "Spawning/PD12M", + }, + ], + demo: { + inputs: [ + { + filename: "image-to-image-input.jpeg", + type: "img", + }, + ], + outputs: [ + { + filename: "image-to-image-output.png", + type: "img", + }, + ], + }, + isPlaceholder: false, + metrics: [ + { + description: "Peak Signal to Noise Ratio (PSNR) is an approximation of the human perception, considering the ratio of the absolute intensity with respect to the variations. Measured in dB, a high value indicates a high fidelity.", + id: "PSNR", + }, + { + description: "Structural Similarity Index (SSIM) is a perceptual metric which compares the luminance, contrast and structure of two images. The values of SSIM range between -1 and 1, and higher values indicate closer resemblance to the original image.", + id: "SSIM", + }, + { + description: "Inception Score (IS) is an analysis of the labels predicted by an image classification model when presented with a sample of the generated images.", + id: "IS", + }, + ], + models: [ + { + description: "An image-to-image model to improve image resolution.", + id: "fal/AuraSR-v2", + }, + { + description: "Powerful image editing model.", + id: "black-forest-labs/FLUX.1-Kontext-dev", + }, + { + description: "Virtual try-on model.", + id: "yisol/IDM-VTON", + }, + { + description: "Image re-lighting model.", + id: "kontext-community/relighting-kontext-dev-lora-v3", + }, + { + description: "Strong model for inpainting and outpainting.", + id: "black-forest-labs/FLUX.1-Fill-dev", + }, + { + description: "Strong model for image editing using depth maps.", + id: "black-forest-labs/FLUX.1-Depth-dev-lora", + }, + ], + spaces: [ + { + description: "Image editing application.", + id: "black-forest-labs/FLUX.1-Kontext-Dev", + }, + { + description: "Image relighting application.", + id: "lllyasviel/iclight-v2-vary", + }, + { + description: "An application for image upscaling.", + id: "jasperai/Flux.1-dev-Controlnet-Upscaler", + }, + ], + summary: "Image-to-image is the task of transforming an input image through a variety of possible manipulations and enhancements, such as super-resolution, image inpainting, colorization, and more.", + widgetModels: ["Qwen/Qwen-Image"], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c5c7a1dc660bc32cac43d7d9298c4710c82fc186 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.d.ts @@ -0,0 +1,69 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Image To Image inference + */ +export interface ImageToImageInput { + /** + * The input image data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the image data as a raw bytes payload. + */ + inputs: Blob; + /** + * Additional inference parameters for Image To Image + */ + parameters?: ImageToImageParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Image To Image + */ +export interface ImageToImageParameters { + /** + * For diffusion models. A higher guidance scale value encourages the model to generate + * images closely linked to the text prompt at the expense of lower image quality. + */ + guidance_scale?: number; + /** + * One prompt to guide what NOT to include in image generation. + */ + negative_prompt?: string; + /** + * For diffusion models. The number of denoising steps. More denoising steps usually lead to + * a higher quality image at the expense of slower inference. + */ + num_inference_steps?: number; + /** + * The text prompt to guide the image generation. + */ + prompt?: string; + /** + * The size in pixels of the output image. This parameter is only supported by some + * providers and for specific models. It will be ignored when unsupported. + */ + target_size?: TargetSize; + [property: string]: unknown; +} +/** + * The size in pixels of the output image. This parameter is only supported by some + * providers and for specific models. It will be ignored when unsupported. + */ +export interface TargetSize { + height: number; + width: number; + [property: string]: unknown; +} +/** + * Outputs of inference for the Image To Image task + */ +export interface ImageToImageOutput { + /** + * The output image returned as raw bytes in the payload. + */ + image?: unknown; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6a40c1d8e247354fc5934c1b438879b3888011e6 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;GAGG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-image/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..aa4d932b0466467f4b50fda065faf7fd02b50f87 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-text/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAyDf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.js new file mode 100644 index 0000000000000000000000000000000000000000..a56605b1f65bcb7364ecbe7b1fd6ea1fba5eae27 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/data.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + // TODO write proper description + description: "Dataset from 12M image-text of Reddit", + id: "red_caps", + }, + { + // TODO write proper description + description: "Dataset from 3.3M images of Google", + id: "datasets/conceptual_captions", + }, + ], + demo: { + inputs: [ + { + filename: "savanna.jpg", + type: "img", + }, + ], + outputs: [ + { + label: "Detailed description", + content: "a herd of giraffes and zebras grazing in a field", + type: "text", + }, + ], + }, + metrics: [], + models: [ + { + description: "Strong OCR model.", + id: "allenai/olmOCR-7B-0725", + }, + { + description: "Powerful image captioning model.", + id: "fancyfeast/llama-joycaption-beta-one-hf-llava", + }, + ], + spaces: [ + { + description: "SVG generator app from images.", + id: "multimodalart/OmniSVG-3B", + }, + { + description: "An application that converts documents to markdown.", + id: "numind/NuMarkdown-8B-Thinking", + }, + { + description: "An application that can caption images.", + id: "fancyfeast/joy-caption-beta-one", + }, + ], + summary: "Image to text models output a text from a given image. Image captioning or optical character recognition can be considered as the most common applications of image to text.", + widgetModels: ["Salesforce/blip-image-captioning-large"], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9944a906d4fa9529af0e38ef2473969de421da4c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/inference.d.ts @@ -0,0 +1,135 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Image To Text inference + */ +export interface ImageToTextInput { + /** + * The input image data + */ + inputs: Blob; + /** + * Additional inference parameters for Image To Text + */ + parameters?: ImageToTextParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Image To Text + */ +export interface ImageToTextParameters { + /** + * Parametrization of the text generation process + */ + generation_parameters?: GenerationParameters; + /** + * The amount of maximum tokens to generate. + */ + max_new_tokens?: number; + [property: string]: unknown; +} +/** + * Parametrization of the text generation process + */ +export interface GenerationParameters { + /** + * Whether to use sampling instead of greedy decoding when generating new tokens. + */ + do_sample?: boolean; + /** + * Controls the stopping condition for beam-based methods. + */ + early_stopping?: EarlyStoppingUnion; + /** + * If set to float strictly between 0 and 1, only tokens with a conditional probability + * greater than epsilon_cutoff will be sampled. In the paper, suggested values range from + * 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language + * Model Desmoothing](https://hf.co/papers/2210.15191) for more details. + */ + epsilon_cutoff?: number; + /** + * Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to + * float strictly between 0 and 1, a token is only considered if it is greater than either + * eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter + * term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In + * the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model. + * See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) + * for more details. + */ + eta_cutoff?: number; + /** + * The maximum length (in tokens) of the generated text, including the input. + */ + max_length?: number; + /** + * The maximum number of tokens to generate. Takes precedence over max_length. + */ + max_new_tokens?: number; + /** + * The minimum length (in tokens) of the generated text, including the input. + */ + min_length?: number; + /** + * The minimum number of tokens to generate. Takes precedence over min_length. + */ + min_new_tokens?: number; + /** + * Number of groups to divide num_beams into in order to ensure diversity among different + * groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details. + */ + num_beam_groups?: number; + /** + * Number of beams to use for beam search. + */ + num_beams?: number; + /** + * The value balances the model confidence and the degeneration penalty in contrastive + * search decoding. + */ + penalty_alpha?: number; + /** + * The value used to modulate the next token probabilities. + */ + temperature?: number; + /** + * The number of highest probability vocabulary tokens to keep for top-k-filtering. + */ + top_k?: number; + /** + * If set to float < 1, only the smallest set of most probable tokens with probabilities + * that add up to top_p or higher are kept for generation. + */ + top_p?: number; + /** + * Local typicality measures how similar the conditional probability of predicting a target + * token next is to the expected conditional probability of predicting a random token next, + * given the partial text already generated. If set to float < 1, the smallest set of the + * most locally typical tokens with probabilities that add up to typical_p or higher are + * kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details. + */ + typical_p?: number; + /** + * Whether the model should use the past last key/values attentions to speed up decoding + */ + use_cache?: boolean; + [property: string]: unknown; +} +/** + * Controls the stopping condition for beam-based methods. + */ +export type EarlyStoppingUnion = boolean | "never"; +/** + * Outputs of inference for the Image To Text task + */ +export interface ImageToTextOutput { + generatedText: unknown; + /** + * The generated text. + */ + generated_text?: string; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..b4d812f2f06619307ca7ebf5c53526474c51ab2d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-text/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C;;OAEG;IACH,cAAc,CAAC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tasks/dist/commonjs/tasks/image-to-text/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-text/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e5d0273d48ff15ed08a8d8bcd0d85efb1ba1a091 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-video/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAyHf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.js new file mode 100644 index 0000000000000000000000000000000000000000..c413e3be08aec203ae4a94efdd6588f32084b8b7 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/data.js @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A benchmark dataset for reference image controlled video generation.", + id: "ali-vilab/VACE-Benchmark", + }, + { + description: "A dataset of video generation style preferences.", + id: "Rapidata/sora-video-generation-style-likert-scoring", + }, + { + description: "A dataset with videos and captions throughout the videos.", + id: "BestWishYsh/ChronoMagic", + }, + ], + demo: { + inputs: [ + { + filename: "image-to-video-input.jpg", + type: "img", + }, + { + label: "Optional Text Prompt", + content: "This penguin is dancing", + type: "text", + }, + ], + outputs: [ + { + filename: "image-to-video-output.gif", + type: "img", + }, + ], + }, + metrics: [ + { + description: "Fréchet Video Distance (FVD) measures the perceptual similarity between the distributions of generated videos and a set of real videos, assessing overall visual quality and temporal coherence of the video generated from an input image.", + id: "fvd", + }, + { + description: "CLIP Score measures the semantic similarity between a textual prompt (if provided alongside the input image) and the generated video frames. It evaluates how well the video's generated content and motion align with the textual description, conditioned on the initial image.", + id: "clip_score", + }, + { + description: "First Frame Fidelity, often measured using LPIPS (Learned Perceptual Image Patch Similarity), PSNR, or SSIM, quantifies how closely the first frame of the generated video matches the input conditioning image.", + id: "lpips", + }, + { + description: "Identity Preservation Score measures the consistency of identity (e.g., a person's face or a specific object's characteristics) between the input image and throughout the generated video frames, often calculated using features from specialized models like face recognition (e.g., ArcFace) or re-identification models.", + id: "identity_preservation", + }, + { + description: "Motion Score evaluates the quality, realism, and temporal consistency of motion in the video generated from a static image. This can be based on optical flow analysis (e.g., smoothness, magnitude), consistency of object trajectories, or specific motion plausibility assessments.", + id: "motion_score", + }, + ], + models: [ + { + description: "LTX-Video, a 13B parameter model for high quality video generation", + id: "Lightricks/LTX-Video-0.9.7-dev", + }, + { + description: "A 14B parameter model for reference image controlled video generation", + id: "Wan-AI/Wan2.1-VACE-14B", + }, + { + description: "An image-to-video generation model using FramePack F1 methodology with Hunyuan-DiT architecture", + id: "lllyasviel/FramePack_F1_I2V_HY_20250503", + }, + { + description: "A distilled version of the LTX-Video-0.9.7-dev model for faster inference", + id: "Lightricks/LTX-Video-0.9.7-distilled", + }, + { + description: "An image-to-video generation model by Skywork AI, 14B parameters, producing 720p videos.", + id: "Skywork/SkyReels-V2-I2V-14B-720P", + }, + { + description: "Image-to-video variant of Tencent's HunyuanVideo.", + id: "tencent/HunyuanVideo-I2V", + }, + { + description: "A 14B parameter model for 720p image-to-video generation by Wan-AI.", + id: "Wan-AI/Wan2.1-I2V-14B-720P", + }, + { + description: "A Diffusers version of the Wan2.1-I2V-14B-720P model for 720p image-to-video generation.", + id: "Wan-AI/Wan2.1-I2V-14B-720P-Diffusers", + }, + ], + spaces: [ + { + description: "An application to generate videos fast.", + id: "Lightricks/ltx-video-distilled", + }, + { + description: "Generate videos with the FramePack-F1", + id: "linoyts/FramePack-F1", + }, + { + description: "Generate videos with the FramePack", + id: "lisonallen/framepack-i2v", + }, + { + description: "Wan2.1 with CausVid LoRA", + id: "multimodalart/wan2-1-fast", + }, + { + description: "A demo for Stable Video Diffusion", + id: "multimodalart/stable-video-diffusion", + }, + ], + summary: "Image-to-video models take a still image as input and generate a video. These models can be guided by text prompts to influence the content and style of the output video.", + widgetModels: [], + youtubeId: undefined, +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d6c62757ec0115df3abf86575056526232d0a7b --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.d.ts @@ -0,0 +1,75 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Image To Video inference + */ +export interface ImageToVideoInput { + /** + * The input image data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the image data as a raw bytes payload. + */ + inputs: Blob; + /** + * Additional inference parameters for Image To Video + */ + parameters?: ImageToVideoParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Image To Video + */ +export interface ImageToVideoParameters { + /** + * For diffusion models. A higher guidance scale value encourages the model to generate + * videos closely linked to the text prompt at the expense of lower image quality. + */ + guidance_scale?: number; + /** + * One prompt to guide what NOT to include in video generation. + */ + negative_prompt?: string; + /** + * The num_frames parameter determines how many video frames are generated. + */ + num_frames?: number; + /** + * The number of denoising steps. More denoising steps usually lead to a higher quality + * video at the expense of slower inference. + */ + num_inference_steps?: number; + /** + * The text prompt to guide the video generation. + */ + prompt?: string; + /** + * Seed for the random number generator. + */ + seed?: number; + /** + * The size in pixel of the output video frames. + */ + target_size?: TargetSize; + [property: string]: unknown; +} +/** + * The size in pixel of the output video frames. + */ +export interface TargetSize { + height: number; + width: number; + [property: string]: unknown; +} +/** + * Outputs of inference for the Image To Video task + */ +export interface ImageToVideoOutput { + /** + * The generated video returned as raw bytes in the payload. + */ + video: unknown; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..81dcff95e010b3e686370e299598f3966b398664 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/image-to-video/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/image-to-video/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94fdc2d6ba6abd243bae015279941067d3e51a2e --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.d.ts @@ -0,0 +1,91 @@ +import type { PipelineType } from "../pipelines.js"; +export type * from "./audio-classification/inference.js"; +export type * from "./automatic-speech-recognition/inference.js"; +export type { ChatCompletionInput, ChatCompletionInputMessage, ChatCompletionInputMessageChunkType, ChatCompletionOutput, ChatCompletionOutputComplete, ChatCompletionOutputMessage, ChatCompletionStreamOutput, ChatCompletionStreamOutputChoice, ChatCompletionStreamOutputDelta, } from "./chat-completion/inference.js"; +export type * from "./document-question-answering/inference.js"; +export type * from "./feature-extraction/inference.js"; +export type * from "./fill-mask/inference.js"; +export type { ImageClassificationInput, ImageClassificationOutput, ImageClassificationOutputElement, ImageClassificationParameters, } from "./image-classification/inference.js"; +export type * from "./image-to-image/inference.js"; +export type { ImageToTextInput, ImageToTextOutput, ImageToTextParameters } from "./image-to-text/inference.js"; +export type * from "./image-segmentation/inference.js"; +export type { ImageToVideoInput, ImageToVideoOutput, ImageToVideoParameters } from "./image-to-video/inference.js"; +export type { ImageTextToImageInput, ImageTextToImageOutput, ImageTextToImageParameters, } from "./image-text-to-image/inference.js"; +export type { ImageTextToVideoInput, ImageTextToVideoOutput, ImageTextToVideoParameters, } from "./image-text-to-video/inference.js"; +export type * from "./object-detection/inference.js"; +export type * from "./depth-estimation/inference.js"; +export type * from "./question-answering/inference.js"; +export type * from "./sentence-similarity/inference.js"; +export type * from "./summarization/inference.js"; +export type * from "./table-question-answering/inference.js"; +export type { TextToImageInput, TextToImageOutput, TextToImageParameters } from "./text-to-image/inference.js"; +export type { TextToVideoParameters, TextToVideoOutput, TextToVideoInput } from "./text-to-video/inference.js"; +export type { TextToSpeechParameters, TextToSpeechInput, TextToSpeechOutput } from "./text-to-speech/inference.js"; +export type * from "./token-classification/inference.js"; +export type { TranslationInput, TranslationOutput } from "./translation/inference.js"; +export type { ClassificationOutputTransform, TextClassificationInput, TextClassificationOutput, TextClassificationOutputElement, TextClassificationParameters, } from "./text-classification/inference.js"; +export type { TextGenerationOutputFinishReason, TextGenerationOutputPrefillToken, TextGenerationInput, TextGenerationOutput, TextGenerationOutputDetails, TextGenerationInputGenerateParameters, TextGenerationOutputBestOfSequence, TextGenerationOutputToken, TextGenerationStreamOutputStreamDetails, TextGenerationStreamOutput, } from "./text-generation/inference.js"; +export type * from "./video-classification/inference.js"; +export type * from "./visual-question-answering/inference.js"; +export type * from "./zero-shot-classification/inference.js"; +export type * from "./zero-shot-image-classification/inference.js"; +export type { BoundingBox, ZeroShotObjectDetectionInput, ZeroShotObjectDetectionOutput, ZeroShotObjectDetectionOutputElement, } from "./zero-shot-object-detection/inference.js"; +import type { ModelLibraryKey } from "../model-libraries.js"; +/** + * Model libraries compatible with each ML task + */ +export declare const TASKS_MODEL_LIBRARIES: Record; +export declare const TASKS_DATA: Record; +export interface ExampleRepo { + description: string; + id: string; +} +export type TaskDemoEntry = { + filename: string; + type: "audio"; +} | { + data: Array<{ + label: string; + score: number; + }>; + type: "chart"; +} | { + filename: string; + type: "img"; +} | { + table: string[][]; + type: "tabular"; +} | { + content: string; + label: string; + type: "text"; +} | { + text: string; + tokens: Array<{ + end: number; + start: number; + type: string; + }>; + type: "text-with-tokens"; +}; +export interface TaskDemo { + inputs: TaskDemoEntry[]; + outputs: TaskDemoEntry[]; +} +export interface TaskData { + datasets: ExampleRepo[]; + demo: TaskDemo; + id: PipelineType; + canonicalId?: PipelineType; + isPlaceholder?: boolean; + label: string; + libraries: ModelLibraryKey[]; + metrics: ExampleRepo[]; + models: ExampleRepo[]; + spaces: ExampleRepo[]; + summary: string; + widgetModels: string[]; + youtubeId?: string; +} +export type TaskDataCustom = Omit; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..18a818e806f1140958715845584c04b5182319f1 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tasks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E,OAAO,CAAC;CACb,GACD;IACA,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,KAAK,CAAC;CACX,GACD;IACA,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;CACf,GACD;IACA,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACZ,GACD;IACA,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACb,CAAC,CAAC;IACH,IAAI,EAAE,kBAAkB,CAAC;CACxB,CAAC;AAEL,MAAM,WAAW,QAAQ;IACxB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,YAAY,CAAC;IACjB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ea77963d93d8c81459d9b80b5de16b9031b1ad28 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/index.js @@ -0,0 +1,201 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TASKS_DATA = exports.TASKS_MODEL_LIBRARIES = void 0; +const pipelines_js_1 = require("../pipelines.js"); +const data_js_1 = __importDefault(require("./any-to-any/data.js")); +const data_js_2 = __importDefault(require("./audio-classification/data.js")); +const data_js_3 = __importDefault(require("./audio-text-to-text/data.js")); +const data_js_4 = __importDefault(require("./audio-to-audio/data.js")); +const data_js_5 = __importDefault(require("./automatic-speech-recognition/data.js")); +const data_js_6 = __importDefault(require("./document-question-answering/data.js")); +const data_js_7 = __importDefault(require("./feature-extraction/data.js")); +const data_js_8 = __importDefault(require("./fill-mask/data.js")); +const data_js_9 = __importDefault(require("./image-classification/data.js")); +const data_js_10 = __importDefault(require("./image-feature-extraction/data.js")); +const data_js_11 = __importDefault(require("./image-to-image/data.js")); +const data_js_12 = __importDefault(require("./image-to-text/data.js")); +const data_js_13 = __importDefault(require("./image-text-to-text/data.js")); +const data_js_14 = __importDefault(require("./image-text-to-image/data.js")); +const data_js_15 = __importDefault(require("./image-text-to-video/data.js")); +const data_js_16 = __importDefault(require("./image-segmentation/data.js")); +const data_js_17 = __importDefault(require("./image-to-video/data.js")); +const data_js_18 = __importDefault(require("./mask-generation/data.js")); +const data_js_19 = __importDefault(require("./object-detection/data.js")); +const data_js_20 = __importDefault(require("./depth-estimation/data.js")); +const data_js_21 = __importDefault(require("./placeholder/data.js")); +const data_js_22 = __importDefault(require("./reinforcement-learning/data.js")); +const data_js_23 = __importDefault(require("./question-answering/data.js")); +const data_js_24 = __importDefault(require("./sentence-similarity/data.js")); +const data_js_25 = __importDefault(require("./summarization/data.js")); +const data_js_26 = __importDefault(require("./table-question-answering/data.js")); +const data_js_27 = __importDefault(require("./tabular-classification/data.js")); +const data_js_28 = __importDefault(require("./tabular-regression/data.js")); +const data_js_29 = __importDefault(require("./text-to-image/data.js")); +const data_js_30 = __importDefault(require("./text-to-speech/data.js")); +const data_js_31 = __importDefault(require("./token-classification/data.js")); +const data_js_32 = __importDefault(require("./translation/data.js")); +const data_js_33 = __importDefault(require("./text-classification/data.js")); +const data_js_34 = __importDefault(require("./text-generation/data.js")); +const data_js_35 = __importDefault(require("./text-ranking/data.js")); +const data_js_36 = __importDefault(require("./text-to-video/data.js")); +const data_js_37 = __importDefault(require("./unconditional-image-generation/data.js")); +const data_js_38 = __importDefault(require("./video-classification/data.js")); +const data_js_39 = __importDefault(require("./visual-document-retrieval/data.js")); +const data_js_40 = __importDefault(require("./visual-question-answering/data.js")); +const data_js_41 = __importDefault(require("./zero-shot-classification/data.js")); +const data_js_42 = __importDefault(require("./zero-shot-image-classification/data.js")); +const data_js_43 = __importDefault(require("./zero-shot-object-detection/data.js")); +const data_js_44 = __importDefault(require("./image-to-3d/data.js")); +const data_js_45 = __importDefault(require("./text-to-3d/data.js")); +const data_js_46 = __importDefault(require("./keypoint-detection/data.js")); +const data_js_47 = __importDefault(require("./video-text-to-text/data.js")); +const data_js_48 = __importDefault(require("./video-to-video/data.js")); +/** + * Model libraries compatible with each ML task + */ +exports.TASKS_MODEL_LIBRARIES = { + "audio-classification": ["speechbrain", "transformers", "transformers.js"], + "audio-to-audio": ["asteroid", "fairseq", "speechbrain"], + "automatic-speech-recognition": ["espnet", "nemo", "speechbrain", "transformers", "transformers.js"], + "audio-text-to-text": ["transformers"], + "depth-estimation": ["transformers", "transformers.js"], + "document-question-answering": ["transformers", "transformers.js"], + "feature-extraction": ["sentence-transformers", "transformers", "transformers.js"], + "fill-mask": ["transformers", "transformers.js"], + "graph-ml": ["transformers"], + "image-classification": ["keras", "timm", "transformers", "transformers.js"], + "image-feature-extraction": ["timm", "transformers"], + "image-segmentation": ["transformers", "transformers.js"], + "image-text-to-text": ["transformers"], + "image-text-to-image": ["diffusers"], + "image-text-to-video": ["diffusers"], + "image-to-image": ["diffusers", "transformers", "transformers.js"], + "image-to-text": ["transformers", "transformers.js"], + "image-to-video": ["diffusers"], + "keypoint-detection": ["transformers"], + "video-classification": ["transformers"], + "mask-generation": ["transformers"], + "multiple-choice": ["transformers"], + "object-detection": ["transformers", "transformers.js", "ultralytics"], + other: [], + "question-answering": ["adapter-transformers", "allennlp", "transformers", "transformers.js"], + robotics: [], + "reinforcement-learning": ["transformers", "stable-baselines3", "ml-agents", "sample-factory"], + "sentence-similarity": ["sentence-transformers", "spacy", "transformers.js"], + summarization: ["transformers", "transformers.js"], + "table-question-answering": ["transformers"], + "table-to-text": ["transformers"], + "tabular-classification": ["sklearn"], + "tabular-regression": ["sklearn"], + "tabular-to-text": ["transformers"], + "text-classification": ["adapter-transformers", "setfit", "spacy", "transformers", "transformers.js"], + "text-generation": ["transformers", "transformers.js"], + "text-ranking": ["sentence-transformers", "transformers"], + "text-retrieval": [], + "text-to-image": ["diffusers"], + "text-to-speech": ["espnet", "tensorflowtts", "transformers", "transformers.js"], + "text-to-audio": ["transformers", "transformers.js"], + "text-to-video": ["diffusers"], + "time-series-forecasting": [], + "token-classification": [ + "adapter-transformers", + "flair", + "spacy", + "span-marker", + "stanza", + "transformers", + "transformers.js", + ], + translation: ["transformers", "transformers.js"], + "unconditional-image-generation": ["diffusers"], + "video-text-to-text": ["transformers"], + "visual-question-answering": ["transformers", "transformers.js"], + "voice-activity-detection": [], + "zero-shot-classification": ["transformers", "transformers.js"], + "zero-shot-image-classification": ["transformers", "transformers.js"], + "zero-shot-object-detection": ["transformers", "transformers.js"], + "text-to-3d": ["diffusers"], + "image-to-3d": ["diffusers"], + "any-to-any": ["transformers"], + "visual-document-retrieval": ["transformers"], + "video-to-video": ["diffusers"], +}; +/** + * Return the whole TaskData object for a certain task. + * If the partialTaskData argument is left undefined, + * the default placeholder data will be used. + */ +function getData(type, partialTaskData = data_js_21.default) { + return { + ...partialTaskData, + id: type, + label: pipelines_js_1.PIPELINE_DATA[type].name, + libraries: exports.TASKS_MODEL_LIBRARIES[type], + }; +} +// To make comparisons easier, task order is the same as in const.ts +// Tasks set to undefined won't have an associated task page. +// Tasks that call getData() without the second argument will +// have a "placeholder" page. +exports.TASKS_DATA = { + "any-to-any": getData("any-to-any", data_js_1.default), + "audio-classification": getData("audio-classification", data_js_2.default), + "audio-to-audio": getData("audio-to-audio", data_js_4.default), + "audio-text-to-text": getData("audio-text-to-text", data_js_3.default), + "automatic-speech-recognition": getData("automatic-speech-recognition", data_js_5.default), + "depth-estimation": getData("depth-estimation", data_js_20.default), + "document-question-answering": getData("document-question-answering", data_js_6.default), + "visual-document-retrieval": getData("visual-document-retrieval", data_js_39.default), + "feature-extraction": getData("feature-extraction", data_js_7.default), + "fill-mask": getData("fill-mask", data_js_8.default), + "graph-ml": undefined, + "image-classification": getData("image-classification", data_js_9.default), + "image-feature-extraction": getData("image-feature-extraction", data_js_10.default), + "image-segmentation": getData("image-segmentation", data_js_16.default), + "image-to-image": getData("image-to-image", data_js_11.default), + "image-text-to-text": getData("image-text-to-text", data_js_13.default), + "image-text-to-image": getData("image-text-to-image", data_js_14.default), + "image-text-to-video": getData("image-text-to-video", data_js_15.default), + "image-to-text": getData("image-to-text", data_js_12.default), + "image-to-video": getData("image-to-video", data_js_17.default), + "keypoint-detection": getData("keypoint-detection", data_js_46.default), + "mask-generation": getData("mask-generation", data_js_18.default), + "multiple-choice": undefined, + "object-detection": getData("object-detection", data_js_19.default), + "video-classification": getData("video-classification", data_js_38.default), + other: undefined, + "question-answering": getData("question-answering", data_js_23.default), + "reinforcement-learning": getData("reinforcement-learning", data_js_22.default), + robotics: undefined, + "sentence-similarity": getData("sentence-similarity", data_js_24.default), + summarization: getData("summarization", data_js_25.default), + "table-question-answering": getData("table-question-answering", data_js_26.default), + "table-to-text": undefined, + "tabular-classification": getData("tabular-classification", data_js_27.default), + "tabular-regression": getData("tabular-regression", data_js_28.default), + "tabular-to-text": undefined, + "text-classification": getData("text-classification", data_js_33.default), + "text-generation": getData("text-generation", data_js_34.default), + "text-ranking": getData("text-ranking", data_js_35.default), + "text-retrieval": undefined, + "text-to-image": getData("text-to-image", data_js_29.default), + "text-to-speech": getData("text-to-speech", data_js_30.default), + "text-to-audio": undefined, + "text-to-video": getData("text-to-video", data_js_36.default), + "time-series-forecasting": undefined, + "token-classification": getData("token-classification", data_js_31.default), + translation: getData("translation", data_js_32.default), + "unconditional-image-generation": getData("unconditional-image-generation", data_js_37.default), + "video-text-to-text": getData("video-text-to-text", data_js_47.default), + "video-to-video": getData("video-to-video", data_js_48.default), + "visual-question-answering": getData("visual-question-answering", data_js_40.default), + "voice-activity-detection": undefined, + "zero-shot-classification": getData("zero-shot-classification", data_js_41.default), + "zero-shot-image-classification": getData("zero-shot-image-classification", data_js_42.default), + "zero-shot-object-detection": getData("zero-shot-object-detection", data_js_43.default), + "text-to-3d": getData("text-to-3d", data_js_45.default), + "image-to-3d": getData("image-to-3d", data_js_44.default), +}; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..eb823f21e8304e3e89965c2360ab9594e5d59139 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/keypoint-detection/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAqDf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.js new file mode 100644 index 0000000000000000000000000000000000000000..94880999e406d783ecaff09d3e041f547c9c6723 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/keypoint-detection/data.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A dataset of hand keypoints of over 500k examples.", + id: "Vincent-luo/hagrid-mediapipe-hands", + }, + ], + demo: { + inputs: [ + { + filename: "keypoint-detection-input.png", + type: "img", + }, + ], + outputs: [ + { + filename: "keypoint-detection-output.png", + type: "img", + }, + ], + }, + metrics: [], + models: [ + { + description: "A robust keypoint detection model.", + id: "magic-leap-community/superpoint", + }, + { + description: "A robust keypoint matching model.", + id: "magic-leap-community/superglue_outdoor", + }, + { + description: "Strong keypoint detection model used to detect human pose.", + id: "qualcomm/RTMPose-Body2d", + }, + { + description: "Powerful keypoint matching model.", + id: "ETH-CVG/lightglue_disk", + }, + ], + spaces: [ + { + description: "An application that detects hand keypoints in real-time.", + id: "datasciencedojo/Hand-Keypoint-Detection-Realtime", + }, + { + description: "An application for keypoint detection and matching.", + id: "ETH-CVG/LightGlue", + }, + ], + summary: "Keypoint detection is the task of identifying meaningful distinctive points or features in an image.", + widgetModels: [], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4c15a98fdabb31e019d38076d691da7391cefa47 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/mask-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAgEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.js new file mode 100644 index 0000000000000000000000000000000000000000..20d3efc52f5252944f4701981559907eb3f04486 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/mask-generation/data.js @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Widely used benchmark dataset for multiple Vision tasks.", + id: "merve/coco2017", + }, + { + description: "Medical Imaging dataset of the Human Brain for segmentation and mask generating tasks", + id: "rocky93/BraTS_segmentation", + }, + ], + demo: { + inputs: [ + { + filename: "mask-generation-input.png", + type: "img", + }, + ], + outputs: [ + { + filename: "mask-generation-output.png", + type: "img", + }, + ], + }, + metrics: [ + { + description: "IoU is used to measure the overlap between predicted mask and the ground truth mask.", + id: "Intersection over Union (IoU)", + }, + ], + models: [ + { + description: "Small yet powerful mask generation model.", + id: "Zigeng/SlimSAM-uniform-50", + }, + { + description: "Very strong mask generation model.", + id: "facebook/sam2-hiera-large", + }, + ], + spaces: [ + { + description: "An application that combines a mask generation model with a zero-shot object detection model for text-guided image segmentation.", + id: "merve/OWLSAM2", + }, + { + description: "An application that compares the performance of a large and a small mask generation model.", + id: "merve/slimsam", + }, + { + description: "An application based on an improved mask generation model.", + id: "SkalskiP/segment-anything-model-2", + }, + { + description: "An application to remove objects from videos using mask generation models.", + id: "SkalskiP/SAM_and_ProPainter", + }, + ], + summary: "Mask generation is the task of generating masks that identify a specific object or region of interest in a given image. Masks are often used in segmentation tasks, where they provide a precise way to isolate the object of interest for further processing or analysis.", + widgetModels: [], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..628b2c78e9a1f523dcab289b02218d52718855ac --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/object-detection/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAqFf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.js new file mode 100644 index 0000000000000000000000000000000000000000..497e960bb08cf88dfa3d1b309f4420d9ee987b62 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/data.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Widely used benchmark dataset for multiple vision tasks.", + id: "merve/coco2017", + }, + { + description: "Multi-task computer vision benchmark.", + id: "merve/pascal-voc", + }, + ], + demo: { + inputs: [ + { + filename: "object-detection-input.jpg", + type: "img", + }, + ], + outputs: [ + { + filename: "object-detection-output.jpg", + type: "img", + }, + ], + }, + metrics: [ + { + description: "The Average Precision (AP) metric is the Area Under the PR Curve (AUC-PR). It is calculated for each class separately", + id: "Average Precision", + }, + { + description: "The Mean Average Precision (mAP) metric is the overall average of the AP values", + id: "Mean Average Precision", + }, + { + description: "The APα metric is the Average Precision at the IoU threshold of a α value, for example, AP50 and AP75", + id: "APα", + }, + ], + models: [ + { + description: "Solid object detection model pre-trained on the COCO 2017 dataset.", + id: "facebook/detr-resnet-50", + }, + { + description: "Accurate object detection model.", + id: "IDEA-Research/dab-detr-resnet-50", + }, + { + description: "Fast and accurate object detection model.", + id: "PekingU/rtdetr_v2_r50vd", + }, + { + description: "Object detection model for low-lying objects.", + id: "StephanST/WALDO30", + }, + ], + spaces: [ + { + description: "Real-time object detection demo.", + id: "Roboflow/RF-DETR", + }, + { + description: "An application that contains various object detection models to try from.", + id: "Gradio-Blocks/Object-Detection-With-DETR-and-YOLOS", + }, + { + description: "A cutting-edge object detection application.", + id: "sunsmarterjieleaf/yolov12", + }, + { + description: "An object tracking, segmentation and inpainting application.", + id: "VIPLab/Track-Anything", + }, + { + description: "Very fast object tracking application based on object detection.", + id: "merve/RT-DETR-tracking-coco", + }, + ], + summary: "Object Detection models allow users to identify objects of certain defined classes. Object detection models receive an image as input and output the images with bounding boxes and labels on detected objects.", + widgetModels: ["facebook/detr-resnet-50"], + youtubeId: "WdAeKSOpxhw", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..14661180189671f77efac91846a902f1f85d91a9 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.d.ts @@ -0,0 +1,74 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Object Detection inference + */ +export interface ObjectDetectionInput { + /** + * The input image data as a base64-encoded string. If no `parameters` are provided, you can + * also provide the image data as a raw bytes payload. + */ + inputs: Blob; + /** + * Additional inference parameters for Object Detection + */ + parameters?: ObjectDetectionParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Object Detection + */ +export interface ObjectDetectionParameters { + /** + * The probability necessary to make a prediction. + */ + threshold?: number; + [property: string]: unknown; +} +/** + * The predicted bounding box. Coordinates are relative to the top left corner of the input + * image. + */ +export interface BoundingBox { + /** + * The x-coordinate of the bottom-right corner of the bounding box. + */ + xmax: number; + /** + * The x-coordinate of the top-left corner of the bounding box. + */ + xmin: number; + /** + * The y-coordinate of the bottom-right corner of the bounding box. + */ + ymax: number; + /** + * The y-coordinate of the top-left corner of the bounding box. + */ + ymin: number; + [property: string]: unknown; +} +export type ObjectDetectionOutput = ObjectDetectionOutputElement[]; +/** + * Outputs of inference for the Object Detection task + */ +export interface ObjectDetectionOutputElement { + /** + * The predicted bounding box. Coordinates are relative to the top left corner of the input + * image. + */ + box: BoundingBox; + /** + * The predicted label for the bounding box. + */ + label: string; + /** + * The associated score / probability. + */ + score: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..64ac1c743fb4d62b1c12cceb58c692b409d268e1 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/object-detection/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,EAAE,CAAC;AACnE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/object-detection/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5db21ad2a46706da5b2235bfb24ee2a5a9cc0757 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/placeholder/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAgBf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.js new file mode 100644 index 0000000000000000000000000000000000000000..491ecdc94848cdd3de410eaba62a51c9343e9352 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/placeholder/data.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [], + demo: { + inputs: [], + outputs: [], + }, + isPlaceholder: true, + metrics: [], + models: [], + spaces: [], + summary: "", + widgetModels: [], + youtubeId: undefined, + /// If this is a subtask, link to the most general task ID + /// (eg, text-generation is the canonical ID of text-simplification) + canonicalId: undefined, +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..796067455ff80c17a422ec70958bc4311e8124e3 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/question-answering/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAsEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.js new file mode 100644 index 0000000000000000000000000000000000000000..305489e7689da030d4ea07bb2aff0ae8b60d0979 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/data.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + // TODO write proper description + description: "A famous question answering dataset based on English articles from Wikipedia.", + id: "squad_v2", + }, + { + // TODO write proper description + description: "A dataset of aggregated anonymized actual queries issued to the Google search engine.", + id: "natural_questions", + }, + ], + demo: { + inputs: [ + { + label: "Question", + content: "Which name is also used to describe the Amazon rainforest in English?", + type: "text", + }, + { + label: "Context", + content: "The Amazon rainforest, also known in English as Amazonia or the Amazon Jungle", + type: "text", + }, + ], + outputs: [ + { + label: "Answer", + content: "Amazonia", + type: "text", + }, + ], + }, + metrics: [ + { + description: "Exact Match is a metric based on the strict character match of the predicted answer and the right answer. For answers predicted correctly, the Exact Match will be 1. Even if only one character is different, Exact Match will be 0", + id: "exact-match", + }, + { + description: " The F1-Score metric is useful if we value both false positives and false negatives equally. The F1-Score is calculated on each word in the predicted sequence against the correct answer", + id: "f1", + }, + ], + models: [ + { + description: "A robust baseline model for most question answering domains.", + id: "deepset/roberta-base-squad2", + }, + { + description: "Small yet robust model that can answer questions.", + id: "distilbert/distilbert-base-cased-distilled-squad", + }, + { + description: "A special model that can answer questions from tables.", + id: "google/tapas-base-finetuned-wtq", + }, + ], + spaces: [ + { + description: "An application that can answer a long question from Wikipedia.", + id: "deepset/wikipedia-assistant", + }, + ], + summary: "Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document. Some question answering models can generate answers without context!", + widgetModels: ["deepset/roberta-base-squad2"], + youtubeId: "ajPx5LwJD-I", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0956db6c47a1bb07ee6c2bd1fd5603b4d66b406f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.d.ts @@ -0,0 +1,98 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Question Answering inference + */ +export interface QuestionAnsweringInput { + /** + * One (context, question) pair to answer + */ + inputs: QuestionAnsweringInputData; + /** + * Additional inference parameters for Question Answering + */ + parameters?: QuestionAnsweringParameters; + [property: string]: unknown; +} +/** + * One (context, question) pair to answer + */ +export interface QuestionAnsweringInputData { + /** + * The context to be used for answering the question + */ + context: string; + /** + * The question to be answered + */ + question: string; + [property: string]: unknown; +} +/** + * Additional inference parameters for Question Answering + */ +export interface QuestionAnsweringParameters { + /** + * Attempts to align the answer to real words. Improves quality on space separated + * languages. Might hurt on non-space-separated languages (like Japanese or Chinese) + */ + align_to_words?: boolean; + /** + * If the context is too long to fit with the question for the model, it will be split in + * several chunks with some overlap. This argument controls the size of that overlap. + */ + doc_stride?: number; + /** + * Whether to accept impossible as an answer. + */ + handle_impossible_answer?: boolean; + /** + * The maximum length of predicted answers (e.g., only answers with a shorter length are + * considered). + */ + max_answer_len?: number; + /** + * The maximum length of the question after tokenization. It will be truncated if needed. + */ + max_question_len?: number; + /** + * The maximum length of the total sentence (context + question) in tokens of each chunk + * passed to the model. The context will be split in several chunks (using docStride as + * overlap) if needed. + */ + max_seq_len?: number; + /** + * The number of answers to return (will be chosen by order of likelihood). Note that we + * return less than topk answers if there are not enough options available within the + * context. + */ + top_k?: number; + [property: string]: unknown; +} +export type QuestionAnsweringOutput = QuestionAnsweringOutputElement[]; +/** + * Outputs of inference for the Question Answering task + */ +export interface QuestionAnsweringOutputElement { + /** + * The answer to the question. + */ + answer: string; + /** + * The character position in the input where the answer ends. + */ + end: number; + /** + * The probability associated to the answer. + */ + score: number; + /** + * The character position in the input where the answer begins. + */ + start: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..bf237c1fb8f8f2de5f02091faf25bed254771a75 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/question-answering/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,MAAM,EAAE,0BAA0B,CAAC;IACnC;;OAEG;IACH,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,MAAM,uBAAuB,GAAG,8BAA8B,EAAE,CAAC;AACvE;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/question-answering/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..da6859fc13463382ff95b67b4ee618679d06845c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/reinforcement-learning/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAsEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.js new file mode 100644 index 0000000000000000000000000000000000000000..65aa55e5b63c964cfb3f93bfae99aeca042118ae --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/reinforcement-learning/data.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A curation of widely used datasets for Data Driven Deep Reinforcement Learning (D4RL)", + id: "edbeeching/decision_transformer_gym_replay", + }, + ], + demo: { + inputs: [ + { + label: "State", + content: "Red traffic light, pedestrians are about to pass.", + type: "text", + }, + ], + outputs: [ + { + label: "Action", + content: "Stop the car.", + type: "text", + }, + { + label: "Next State", + content: "Yellow light, pedestrians have crossed.", + type: "text", + }, + ], + }, + metrics: [ + { + description: "Accumulated reward across all time steps discounted by a factor that ranges between 0 and 1 and determines how much the agent optimizes for future relative to immediate rewards. Measures how good is the policy ultimately found by a given algorithm considering uncertainty over the future.", + id: "Discounted Total Reward", + }, + { + description: "Average return obtained after running the policy for a certain number of evaluation episodes. As opposed to total reward, mean reward considers how much reward a given algorithm receives while learning.", + id: "Mean Reward", + }, + { + description: "Measures how good a given algorithm is after a predefined time. Some algorithms may be guaranteed to converge to optimal behavior across many time steps. However, an agent that reaches an acceptable level of optimality after a given time horizon may be preferable to one that ultimately reaches optimality but takes a long time.", + id: "Level of Performance After Some Time", + }, + ], + models: [ + { + description: "A Reinforcement Learning model trained on expert data from the Gym Hopper environment", + id: "edbeeching/decision-transformer-gym-hopper-expert", + }, + { + description: "A PPO agent playing seals/CartPole-v0 using the stable-baselines3 library and the RL Zoo.", + id: "HumanCompatibleAI/ppo-seals-CartPole-v0", + }, + ], + spaces: [ + { + description: "An application for a cute puppy agent learning to catch a stick.", + id: "ThomasSimonini/Huggy", + }, + { + description: "An application to play Snowball Fight with a reinforcement learning agent.", + id: "ThomasSimonini/SnowballFight", + }, + ], + summary: "Reinforcement learning is the computational approach of learning from action by interacting with an environment through trial and error and receiving rewards (negative or positive) as feedback", + widgetModels: [], + youtubeId: "q0BiUn5LiBc", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..d457bc40bbb8d21b76a24e583381c7ea694b063e --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/sentence-similarity/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAoGf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.js new file mode 100644 index 0000000000000000000000000000000000000000..2f01e72b547817bb5ad879043af8d2ab7890c5de --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/data.js @@ -0,0 +1,99 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Bing queries with relevant passages from various web sources.", + id: "microsoft/ms_marco", + }, + ], + demo: { + inputs: [ + { + label: "Source sentence", + content: "Machine learning is so easy.", + type: "text", + }, + { + label: "Sentences to compare to", + content: "Deep learning is so straightforward.", + type: "text", + }, + { + label: "", + content: "This is so difficult, like rocket science.", + type: "text", + }, + { + label: "", + content: "I can't believe how much I struggled with this.", + type: "text", + }, + ], + outputs: [ + { + type: "chart", + data: [ + { + label: "Deep learning is so straightforward.", + score: 0.623, + }, + { + label: "This is so difficult, like rocket science.", + score: 0.413, + }, + { + label: "I can't believe how much I struggled with this.", + score: 0.256, + }, + ], + }, + ], + }, + metrics: [ + { + description: "Reciprocal Rank is a measure used to rank the relevancy of documents given a set of documents. Reciprocal Rank is the reciprocal of the rank of the document retrieved, meaning, if the rank is 3, the Reciprocal Rank is 0.33. If the rank is 1, the Reciprocal Rank is 1", + id: "Mean Reciprocal Rank", + }, + { + description: "The similarity of the embeddings is evaluated mainly on cosine similarity. It is calculated as the cosine of the angle between two vectors. It is particularly useful when your texts are not the same length", + id: "Cosine Similarity", + }, + ], + models: [ + { + description: "This model works well for sentences and paragraphs and can be used for clustering/grouping and semantic searches.", + id: "sentence-transformers/all-mpnet-base-v2", + }, + { + description: "A multilingual robust sentence similarity model.", + id: "BAAI/bge-m3", + }, + { + description: "A robust sentence similarity model.", + id: "HIT-TMG/KaLM-embedding-multilingual-mini-instruct-v1.5", + }, + ], + spaces: [ + { + description: "An application that leverages sentence similarity to answer questions from YouTube videos.", + id: "Gradio-Blocks/Ask_Questions_To_YouTube_Videos", + }, + { + description: "An application that retrieves relevant PubMed abstracts for a given online article which can be used as further references.", + id: "Gradio-Blocks/pubmed-abstract-retriever", + }, + { + description: "An application that leverages sentence similarity to summarize text.", + id: "nickmuchi/article-text-summarizer", + }, + { + description: "A guide that explains how Sentence Transformers can be used for semantic search.", + id: "sentence-transformers/Sentence_Transformers_for_semantic_search", + }, + ], + summary: "Sentence Similarity is the task of determining how similar two texts are. Sentence similarity models convert input texts into vectors (embeddings) that capture semantic information and calculate how close (similar) they are between them. This task is particularly useful for information retrieval and clustering/grouping.", + widgetModels: ["sentence-transformers/all-MiniLM-L6-v2"], + youtubeId: "VCZq5AkbNEU", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7836ed35d431c28daa542326aca7ea75563f5b9c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.d.ts @@ -0,0 +1,32 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +export type SentenceSimilarityOutput = number[]; +/** + * Inputs for Sentence similarity inference + */ +export interface SentenceSimilarityInput { + inputs: SentenceSimilarityInputData; + /** + * Additional inference parameters for Sentence Similarity + */ + parameters?: { + [key: string]: unknown; + }; + [property: string]: unknown; +} +export interface SentenceSimilarityInputData { + /** + * A list of strings which will be compared against the source_sentence. + */ + sentences: string[]; + /** + * The string that you wish to compare the other strings with. This can be a phrase, + * sentence, or longer passage, depending on the model being used. + */ + source_sentence: string; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1a31ca5b3e6cbd66e566a52e86cba1a024684a97 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/sentence-similarity/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,EAAE,CAAC;AAChD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,MAAM,EAAE,2BAA2B,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;IACF,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/sentence-similarity/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7f112b24d58cd35588a17df77cc61bad268f5b37 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/summarization/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAuEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.js new file mode 100644 index 0000000000000000000000000000000000000000..a1018747c3cb91ac2d5be946b806d31a72ac8f9f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/data.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + canonicalId: "text-generation", + datasets: [ + { + description: "News articles in five different languages along with their summaries. Widely used for benchmarking multilingual summarization models.", + id: "mlsum", + }, + { + description: "English conversations and their summaries. Useful for benchmarking conversational agents.", + id: "samsum", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. It was the first structure to reach a height of 300 metres. Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.", + type: "text", + }, + ], + outputs: [ + { + label: "Output", + content: "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building. It was the first structure to reach a height of 300 metres.", + type: "text", + }, + ], + }, + metrics: [ + { + description: "The generated sequence is compared against its summary, and the overlap of tokens are counted. ROUGE-N refers to overlap of N subsequent tokens, ROUGE-1 refers to overlap of single tokens and ROUGE-2 is the overlap of two subsequent tokens.", + id: "rouge", + }, + ], + models: [ + { + description: "A strong summarization model trained on English news articles. Excels at generating factual summaries.", + id: "facebook/bart-large-cnn", + }, + { + description: "A summarization model trained on medical articles.", + id: "Falconsai/medical_summarization", + }, + ], + spaces: [ + { + description: "An application that can summarize long paragraphs.", + id: "pszemraj/summarize-long-text", + }, + { + description: "A much needed summarization application for terms and conditions.", + id: "ml6team/distilbart-tos-summarizer-tosdr", + }, + { + description: "An application that summarizes long documents.", + id: "pszemraj/document-summarization", + }, + { + description: "An application that can detect errors in abstractive summarization.", + id: "ml6team/post-processing-summarization", + }, + ], + summary: "Summarization is the task of producing a shorter version of a document while preserving its important information. Some models can extract text from the original input, while other models can generate entirely new text.", + widgetModels: ["facebook/bart-large-cnn"], + youtubeId: "yHnr5Dk2zCI", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3153fbb4fdb5eeb040516b68b90dfdda2057798 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.d.ts @@ -0,0 +1,54 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Summarization inference + */ +export interface SummarizationInput { + /** + * The input text to summarize. + */ + inputs: string; + /** + * Additional inference parameters for summarization. + */ + parameters?: SummarizationParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for summarization. + */ +export interface SummarizationParameters { + /** + * Whether to clean up the potential extra spaces in the text output. + */ + clean_up_tokenization_spaces?: boolean; + /** + * Additional parametrization of the text generation algorithm. + */ + generate_parameters?: { + [key: string]: unknown; + }; + /** + * The truncation strategy to use. + */ + truncation?: SummarizationTruncationStrategy; + [property: string]: unknown; +} +/** + * The truncation strategy to use. + */ +export type SummarizationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second"; +/** + * Outputs of inference for the Summarization task + */ +export interface SummarizationOutput { + /** + * The summarized text. + */ + summary_text: string; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e2834ebbaa672e6227241c2f2c7fad3e67a586ba --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/summarization/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;IACF;;OAEG;IACH,UAAU,CAAC,EAAE,+BAA+B,CAAC;IAC7C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,CAAC;AACjH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/summarization/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7df5547173450d1e1d1218adc4b5e3c9a2d90075 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/table-question-answering/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAsDf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.js new file mode 100644 index 0000000000000000000000000000000000000000..9e79709f75feb6ffca8337d2b7280d4537930f87 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/data.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "The WikiTableQuestions dataset is a large-scale dataset for the task of question answering on semi-structured tables.", + id: "wikitablequestions", + }, + { + description: "WikiSQL is a dataset of 80654 hand-annotated examples of questions and SQL queries distributed across 24241 tables from Wikipedia.", + id: "wikisql", + }, + ], + demo: { + inputs: [ + { + table: [ + ["Rank", "Name", "No.of reigns", "Combined days"], + ["1", "lou Thesz", "3", "3749"], + ["2", "Ric Flair", "8", "3103"], + ["3", "Harley Race", "7", "1799"], + ], + type: "tabular", + }, + { label: "Question", content: "What is the number of reigns for Harley Race?", type: "text" }, + ], + outputs: [{ label: "Result", content: "7", type: "text" }], + }, + metrics: [ + { + description: "Checks whether the predicted answer(s) is the same as the ground-truth answer(s).", + id: "Denotation Accuracy", + }, + ], + models: [ + { + description: "A table question answering model that is capable of neural SQL execution, i.e., employ TAPEX to execute a SQL query on a given table.", + id: "microsoft/tapex-base", + }, + { + description: "A robust table question answering model.", + id: "google/tapas-base-finetuned-wtq", + }, + ], + spaces: [ + { + description: "An application that answers questions based on table CSV files.", + id: "katanaml/table-query", + }, + ], + summary: "Table Question Answering (Table QA) is the answering a question about an information on a given table.", + widgetModels: ["google/tapas-base-finetuned-wtq"], +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfe5048481141e19695ee9459efa19ceda69949d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.d.ts @@ -0,0 +1,84 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Table Question Answering inference + */ +export interface TableQuestionAnsweringInput { + /** + * One (table, question) pair to answer + */ + inputs: TableQuestionAnsweringInputData; + /** + * Additional inference parameters for Table Question Answering + */ + parameters?: TableQuestionAnsweringParameters; + [property: string]: unknown; +} +/** + * One (table, question) pair to answer + */ +export interface TableQuestionAnsweringInputData { + /** + * The question to be answered about the table + */ + question: string; + /** + * The table to serve as context for the questions + */ + table: { + [key: string]: string[]; + }; + [property: string]: unknown; +} +/** + * Additional inference parameters for Table Question Answering + */ +export interface TableQuestionAnsweringParameters { + /** + * Activates and controls padding. + */ + padding?: Padding; + /** + * Whether to do inference sequentially or as a batch. Batching is faster, but models like + * SQA require the inference to be done sequentially to extract relations within sequences, + * given their conversational nature. + */ + sequential?: boolean; + /** + * Activates and controls truncation. + */ + truncation?: boolean; + [property: string]: unknown; +} +/** + * Activates and controls padding. + */ +export type Padding = "do_not_pad" | "longest" | "max_length"; +export type TableQuestionAnsweringOutput = TableQuestionAnsweringOutputElement[]; +/** + * Outputs of inference for the Table Question Answering task + */ +export interface TableQuestionAnsweringOutputElement { + /** + * If the model has an aggregator, this returns the aggregator. + */ + aggregator?: string; + /** + * The answer of the question given the table. If there is an aggregator, the answer will be + * preceded by `AGGREGATOR >`. + */ + answer: string; + /** + * List of strings made up of the answer cell values. + */ + cells: string[]; + /** + * Coordinates of the cells of the answers. + */ + coordinates: Array; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..662dc6b5c7390184441f95d326a449f226b02dbb --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/table-question-answering/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;OAEG;IACH,MAAM,EAAE,+BAA+B,CAAC;IACxC;;OAEG;IACH,UAAU,CAAC,EAAE,gCAAgC,CAAC;IAC9C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;KACxB,CAAC;IACF,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,CAAC;AAC9D,MAAM,MAAM,4BAA4B,GAAG,mCAAmC,EAAE,CAAC;AACjF;;GAEG;AACH,MAAM,WAAW,mCAAmC;IACnD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/table-question-answering/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5a327b8a6c01a349e8a3eb677fa7d63a604fd2a6 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/tabular-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA+Df,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.js new file mode 100644 index 0000000000000000000000000000000000000000..b84cc249aae2889eae65ee642dd10d08aa565667 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-classification/data.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A comprehensive curation of datasets covering all benchmarks.", + id: "inria-soda/tabular-benchmark", + }, + ], + demo: { + inputs: [ + { + table: [ + ["Glucose", "Blood Pressure ", "Skin Thickness", "Insulin", "BMI"], + ["148", "72", "35", "0", "33.6"], + ["150", "50", "30", "0", "35.1"], + ["141", "60", "29", "1", "39.2"], + ], + type: "tabular", + }, + ], + outputs: [ + { + table: [["Diabetes"], ["1"], ["1"], ["0"]], + type: "tabular", + }, + ], + }, + metrics: [ + { + description: "", + id: "accuracy", + }, + { + description: "", + id: "recall", + }, + { + description: "", + id: "precision", + }, + { + description: "", + id: "f1", + }, + ], + models: [ + { + description: "Breast cancer prediction model based on decision trees.", + id: "scikit-learn/cancer-prediction-trees", + }, + ], + spaces: [ + { + description: "An application that can predict defective products on a production line.", + id: "scikit-learn/tabular-playground", + }, + { + description: "An application that compares various tabular classification techniques on different datasets.", + id: "scikit-learn/classification", + }, + ], + summary: "Tabular classification is the task of classifying a target category (a group) based on set of attributes.", + widgetModels: ["scikit-learn/tabular-playground"], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8603a1fb917be27322c628610908f41d7228a969 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/tabular-regression/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAoDf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.js new file mode 100644 index 0000000000000000000000000000000000000000..12c17cbcea4da96e8059afe3a58338c069986912 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/tabular-regression/data.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A comprehensive curation of datasets covering all benchmarks.", + id: "inria-soda/tabular-benchmark", + }, + ], + demo: { + inputs: [ + { + table: [ + ["Car Name", "Horsepower", "Weight"], + ["ford torino", "140", "3,449"], + ["amc hornet", "97", "2,774"], + ["toyota corolla", "65", "1,773"], + ], + type: "tabular", + }, + ], + outputs: [ + { + table: [["MPG (miles per gallon)"], ["17"], ["18"], ["31"]], + type: "tabular", + }, + ], + }, + metrics: [ + { + description: "", + id: "mse", + }, + { + description: "Coefficient of determination (or R-squared) is a measure of how well the model fits the data. Higher R-squared is considered a better fit.", + id: "r-squared", + }, + ], + models: [ + { + description: "Fish weight prediction based on length measurements and species.", + id: "scikit-learn/Fish-Weight", + }, + ], + spaces: [ + { + description: "An application that can predict weight of a fish based on set of attributes.", + id: "scikit-learn/fish-weight-prediction", + }, + ], + summary: "Tabular regression is the task of predicting a numerical value given a set of attributes.", + widgetModels: ["scikit-learn/Fish-Weight"], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..90bc031f2e0d672008b73b37088e7779fba975a2 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAkGf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.js new file mode 100644 index 0000000000000000000000000000000000000000..caf9f204e61ec8e6fcd11d4b244378aa5188f1b2 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/data.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A widely used dataset used to benchmark multiple variants of text classification.", + id: "nyu-mll/glue", + }, + { + description: "A text classification dataset used to benchmark natural language inference models", + id: "stanfordnlp/snli", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "I love Hugging Face!", + type: "text", + }, + ], + outputs: [ + { + type: "chart", + data: [ + { + label: "POSITIVE", + score: 0.9, + }, + { + label: "NEUTRAL", + score: 0.1, + }, + { + label: "NEGATIVE", + score: 0.0, + }, + ], + }, + ], + }, + metrics: [ + { + description: "", + id: "accuracy", + }, + { + description: "", + id: "recall", + }, + { + description: "", + id: "precision", + }, + { + description: "The F1 metric is the harmonic mean of the precision and recall. It can be calculated as: F1 = 2 * (precision * recall) / (precision + recall)", + id: "f1", + }, + ], + models: [ + { + description: "A robust model trained for sentiment analysis.", + id: "distilbert/distilbert-base-uncased-finetuned-sst-2-english", + }, + { + description: "A sentiment analysis model specialized in financial sentiment.", + id: "ProsusAI/finbert", + }, + { + description: "A sentiment analysis model specialized in analyzing tweets.", + id: "cardiffnlp/twitter-roberta-base-sentiment-latest", + }, + { + description: "A model that can classify languages.", + id: "papluca/xlm-roberta-base-language-detection", + }, + { + description: "A model that can classify text generation attacks.", + id: "meta-llama/Prompt-Guard-86M", + }, + ], + spaces: [ + { + description: "An application that can classify financial sentiment.", + id: "IoannisTr/Tech_Stocks_Trading_Assistant", + }, + { + description: "A dashboard that contains various text classification tasks.", + id: "miesnerjacob/Multi-task-NLP", + }, + { + description: "An application that analyzes user reviews in healthcare.", + id: "spacy/healthsea-demo", + }, + ], + summary: "Text Classification is the task of assigning a label or class to a given text. Some use cases are sentiment analysis, natural language inference, and assessing grammatical correctness.", + widgetModels: ["distilbert/distilbert-base-uncased-finetuned-sst-2-english"], + youtubeId: "leNG9fN9FQU", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ff29b09e9a909bb94b21f96d8a939dadcd7deb3b --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.d.ts @@ -0,0 +1,53 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Text Classification inference + */ +export interface TextClassificationInput { + /** + * The text to classify + */ + inputs: string; + /** + * Additional inference parameters for Text Classification + */ + parameters?: TextClassificationParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Text Classification + */ +export interface TextClassificationParameters { + /** + * The function to apply to the model outputs in order to retrieve the scores. + */ + function_to_apply?: ClassificationOutputTransform; + /** + * When specified, limits the output to the top K most probable classes. + */ + top_k?: number; + [property: string]: unknown; +} +/** + * The function to apply to the model outputs in order to retrieve the scores. + */ +export type ClassificationOutputTransform = "sigmoid" | "softmax" | "none"; +export type TextClassificationOutput = TextClassificationOutputElement[]; +/** + * Outputs of inference for the Text Classification task + */ +export interface TextClassificationOutputElement { + /** + * The predicted class label. + */ + label: string; + /** + * The corresponding probability. + */ + score: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..328ab1be6f6979d09ce733cb3208285bba6b5fba --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAC1C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;OAEG;IACH,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,wBAAwB,GAAG,+BAA+B,EAAE,CAAC;AACzE;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-classification/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1cb375d4130e99f5926dd0eacd8fe90366df7b10 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA6Hf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.js new file mode 100644 index 0000000000000000000000000000000000000000..b7872517a9a01a24053f1782d39087b0213d144d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/data.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Multilingual dataset used to evaluate text generation models.", + id: "CohereForAI/Global-MMLU", + }, + { + description: "High quality multilingual data used to train text-generation models.", + id: "HuggingFaceFW/fineweb-2", + }, + { + description: "Truly open-source, curated and cleaned dialogue dataset.", + id: "HuggingFaceH4/ultrachat_200k", + }, + { + description: "A reasoning dataset.", + id: "open-r1/OpenThoughts-114k-math", + }, + { + description: "A multilingual instruction dataset with preference ratings on responses.", + id: "allenai/tulu-3-sft-mixture", + }, + { + description: "A large synthetic dataset for alignment of text generation models.", + id: "HuggingFaceTB/smoltalk", + }, + { + description: "A dataset made for training text generation models solving math questions.", + id: "HuggingFaceTB/finemath", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "Once upon a time,", + type: "text", + }, + ], + outputs: [ + { + label: "Output", + content: "Once upon a time, we knew that our ancestors were on the verge of extinction. The great explorers and poets of the Old World, from Alexander the Great to Chaucer, are dead and gone. A good many of our ancient explorers and poets have", + type: "text", + }, + ], + }, + metrics: [ + { + description: "Cross Entropy is a metric that calculates the difference between two probability distributions. Each probability distribution is the distribution of predicted words", + id: "Cross Entropy", + }, + { + description: "The Perplexity metric is the exponential of the cross-entropy loss. It evaluates the probabilities assigned to the next word by the model. Lower perplexity indicates better performance", + id: "Perplexity", + }, + ], + models: [ + { description: "A text-generation model trained to follow instructions.", id: "google/gemma-2-2b-it" }, + { + description: "Powerful text generation model for coding.", + id: "Qwen/Qwen3-Coder-480B-A35B-Instruct", + }, + { + description: "Great text generation model with top-notch tool calling capabilities.", + id: "openai/gpt-oss-120b", + }, + { + description: "Powerful text generation model.", + id: "zai-org/GLM-4.5", + }, + { + description: "A powerful small model with reasoning capabilities.", + id: "Qwen/Qwen3-4B-Thinking-2507", + }, + { + description: "Strong conversational model that supports very long instructions.", + id: "Qwen/Qwen2.5-7B-Instruct-1M", + }, + { + description: "Text generation model used to write code.", + id: "Qwen/Qwen2.5-Coder-32B-Instruct", + }, + { + description: "Powerful reasoning based open large language model.", + id: "deepseek-ai/DeepSeek-R1", + }, + ], + spaces: [ + { + description: "An application that writes and executes code from text instructions and supports many models.", + id: "akhaliq/anycoder", + }, + { + description: "An application that builds websites from natural language prompts.", + id: "enzostvs/deepsite", + }, + { + description: "A leaderboard for comparing chain-of-thought performance of models.", + id: "logikon/open_cot_leaderboard", + }, + { + description: "An text generation based application based on a very powerful LLaMA2 model.", + id: "ysharma/Explore_llamav2_with_TGI", + }, + { + description: "An text generation based application to converse with Zephyr model.", + id: "HuggingFaceH4/zephyr-chat", + }, + { + description: "A leaderboard that ranks text generation models based on blind votes from people.", + id: "lmsys/chatbot-arena-leaderboard", + }, + { + description: "An chatbot to converse with a very powerful text generation model.", + id: "mlabonne/phixtral-chat", + }, + ], + summary: "Generating text is the task of generating new text given another text. These models can, for example, fill in incomplete text or paraphrase.", + widgetModels: ["mistralai/Mistral-Nemo-Instruct-2407"], + youtubeId: "e9gNEAlsOvU", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0495ad64fc55455d8b2a2933ae99b37d86775f1f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.d.ts @@ -0,0 +1,188 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Text Generation Input. + * + * Auto-generated from TGI specs. + * For more details, check out + * https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tgi-import.ts. + */ +export interface TextGenerationInput { + inputs: string; + parameters?: TextGenerationInputGenerateParameters; + stream?: boolean; + [property: string]: unknown; +} +export interface TextGenerationInputGenerateParameters { + /** + * Lora adapter id + */ + adapter_id?: string; + /** + * Generate best_of sequences and return the one if the highest token logprobs. + */ + best_of?: number; + /** + * Whether to return decoder input token logprobs and ids. + */ + decoder_input_details?: boolean; + /** + * Whether to return generation details. + */ + details?: boolean; + /** + * Activate logits sampling. + */ + do_sample?: boolean; + /** + * The parameter for frequency penalty. 1.0 means no penalty + * Penalize new tokens based on their existing frequency in the text so far, + * decreasing the model's likelihood to repeat the same line verbatim. + */ + frequency_penalty?: number; + grammar?: TextGenerationInputGrammarType; + /** + * Maximum number of tokens to generate. + */ + max_new_tokens?: number; + /** + * The parameter for repetition penalty. 1.0 means no penalty. + * See [this paper](https://arxiv.org/pdf/1909.05858.pdf) for more details. + */ + repetition_penalty?: number; + /** + * Whether to prepend the prompt to the generated text + */ + return_full_text?: boolean; + /** + * Random sampling seed. + */ + seed?: number; + /** + * Stop generating tokens if a member of `stop` is generated. + */ + stop?: string[]; + /** + * The value used to module the logits distribution. + */ + temperature?: number; + /** + * The number of highest probability vocabulary tokens to keep for top-k-filtering. + */ + top_k?: number; + /** + * The number of highest probability vocabulary tokens to keep for top-n-filtering. + */ + top_n_tokens?: number; + /** + * Top-p value for nucleus sampling. + */ + top_p?: number; + /** + * Truncate inputs tokens to the given size. + */ + truncate?: number; + /** + * Typical Decoding mass + * See [Typical Decoding for Natural Language Generation](https://arxiv.org/abs/2202.00666) + * for more information. + */ + typical_p?: number; + /** + * Watermarking with [A Watermark for Large Language + * Models](https://arxiv.org/abs/2301.10226). + */ + watermark?: boolean; + [property: string]: unknown; +} +export interface TextGenerationInputGrammarType { + type: Type; + /** + * A string that represents a [JSON Schema](https://json-schema.org/). + * + * JSON Schema is a declarative language that allows to annotate JSON documents + * with types and descriptions. + */ + value: unknown; + [property: string]: unknown; +} +export type Type = "json" | "regex" | "json_schema"; +/** + * Text Generation Output. + * + * Auto-generated from TGI specs. + * For more details, check out + * https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tgi-import.ts. + */ +export interface TextGenerationOutput { + details?: TextGenerationOutputDetails; + generated_text: string; + [property: string]: unknown; +} +export interface TextGenerationOutputDetails { + best_of_sequences?: TextGenerationOutputBestOfSequence[]; + finish_reason: TextGenerationOutputFinishReason; + generated_tokens: number; + prefill: TextGenerationOutputPrefillToken[]; + seed?: number; + tokens: TextGenerationOutputToken[]; + top_tokens?: Array; + [property: string]: unknown; +} +export interface TextGenerationOutputBestOfSequence { + finish_reason: TextGenerationOutputFinishReason; + generated_text: string; + generated_tokens: number; + prefill: TextGenerationOutputPrefillToken[]; + seed?: number; + tokens: TextGenerationOutputToken[]; + top_tokens?: Array; + [property: string]: unknown; +} +export type TextGenerationOutputFinishReason = "length" | "eos_token" | "stop_sequence"; +export interface TextGenerationOutputPrefillToken { + id: number; + logprob: number; + text: string; + [property: string]: unknown; +} +export interface TextGenerationOutputToken { + id: number; + logprob: number; + special: boolean; + text: string; + [property: string]: unknown; +} +/** + * Text Generation Stream Output. + * + * Auto-generated from TGI specs. + * For more details, check out + * https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-tgi-import.ts. + */ +export interface TextGenerationStreamOutput { + details?: TextGenerationStreamOutputStreamDetails; + generated_text?: string; + index: number; + token: TextGenerationStreamOutputToken; + top_tokens?: TextGenerationStreamOutputToken[]; + [property: string]: unknown; +} +export interface TextGenerationStreamOutputStreamDetails { + finish_reason: TextGenerationOutputFinishReason; + generated_tokens: number; + input_length: number; + seed?: number; + [property: string]: unknown; +} +export interface TextGenerationStreamOutputToken { + id: number; + logprob: number; + special: boolean; + text: string; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..44c5f235fb539f2e65e39fae7af67582b0bf0a04 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-generation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,qCAAqC,CAAC;IACnD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,qCAAqC;IACrD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,8BAA8B,CAAC;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EA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ACD,MAAM,WAAW,+BAA+B;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-generation/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4e751a3bbd1ecc3171184413375e276af5c186d3 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-ranking/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAsFf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.js new file mode 100644 index 0000000000000000000000000000000000000000..15d031afcb84419a02e3b591704c238fe9d7aa2d --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-ranking/data.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Bing queries with relevant passages from various web sources.", + id: "microsoft/ms_marco", + }, + ], + demo: { + inputs: [ + { + label: "Source sentence", + content: "Machine learning is so easy.", + type: "text", + }, + { + label: "Sentences to compare to", + content: "Deep learning is so straightforward.", + type: "text", + }, + { + label: "", + content: "This is so difficult, like rocket science.", + type: "text", + }, + { + label: "", + content: "I can't believe how much I struggled with this.", + type: "text", + }, + ], + outputs: [ + { + type: "chart", + data: [ + { + label: "Deep learning is so straightforward.", + score: 2.2006407, + }, + { + label: "This is so difficult, like rocket science.", + score: -6.2634873, + }, + { + label: "I can't believe how much I struggled with this.", + score: -10.251488, + }, + ], + }, + ], + }, + metrics: [ + { + description: "Discounted Cumulative Gain (DCG) measures the gain, or usefulness, of search results discounted by their position. The normalization is done by dividing the DCG by the ideal DCG, which is the DCG of the perfect ranking.", + id: "Normalized Discounted Cumulative Gain", + }, + { + description: "Reciprocal Rank is a measure used to rank the relevancy of documents given a set of documents. Reciprocal Rank is the reciprocal of the rank of the document retrieved, meaning, if the rank is 3, the Reciprocal Rank is 0.33. If the rank is 1, the Reciprocal Rank is 1", + id: "Mean Reciprocal Rank", + }, + { + description: "Mean Average Precision (mAP) is the overall average of the Average Precision (AP) values, where AP is the Area Under the PR Curve (AUC-PR)", + id: "Mean Average Precision", + }, + ], + models: [ + { + description: "An extremely efficient text ranking model trained on a web search dataset.", + id: "cross-encoder/ms-marco-MiniLM-L6-v2", + }, + { + description: "A strong multilingual text reranker model.", + id: "Alibaba-NLP/gte-multilingual-reranker-base", + }, + { + description: "An efficient text ranking model that punches above its weight.", + id: "Alibaba-NLP/gte-reranker-modernbert-base", + }, + ], + spaces: [], + summary: "Text Ranking is the task of ranking a set of texts based on their relevance to a query. Text ranking models are trained on large datasets of queries and relevant documents to learn how to rank documents based on their relevance to the query. This task is particularly useful for search engines and information retrieval systems.", + widgetModels: ["cross-encoder/ms-marco-MiniLM-L6-v2"], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..a56f91f9a5ea203fe8a085e3c5d555f5306b119e --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-3d/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAmDf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.js new file mode 100644 index 0000000000000000000000000000000000000000..9ea2c46e6616a81b1fdd8bfd2e4a027ac71b5b3f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-3d/data.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A large dataset of over 10 million 3D objects.", + id: "allenai/objaverse-xl", + }, + { + description: "Descriptive captions for 3D objects in Objaverse.", + id: "tiange/Cap3D", + }, + ], + demo: { + inputs: [ + { + label: "Prompt", + content: "a cat statue", + type: "text", + }, + ], + outputs: [ + { + label: "Result", + content: "text-to-3d-3d-output-filename.glb", + type: "text", + }, + ], + }, + metrics: [], + models: [ + { + description: "Text-to-3D mesh model by OpenAI", + id: "openai/shap-e", + }, + { + description: "Generative 3D gaussian splatting model.", + id: "ashawkey/LGM", + }, + ], + spaces: [ + { + description: "Text-to-3D demo with mesh outputs.", + id: "hysts/Shap-E", + }, + { + description: "Text/image-to-3D demo with splat outputs.", + id: "ashawkey/LGM", + }, + ], + summary: "Text-to-3D models take in text input and produce 3D output.", + widgetModels: [], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..811850173233fed08a447e510bede7a576e09822 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.d.ts @@ -0,0 +1,134 @@ +/** + * Outputs of inference for the Text To Audio task + */ +export interface TextToAudioOutput { + /** + * The generated audio waveform. + */ + audio: Blob; + /** + * The sampling rate of the generated audio waveform. + */ + sampling_rate: number; + [property: string]: unknown; +} +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Text To Audio inference + */ +export interface TextToAudioInput { + /** + * The input text data + */ + inputs: string; + /** + * Additional inference parameters for Text To Audio + */ + parameters?: TextToAudioParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Text To Audio + */ +export interface TextToAudioParameters { + /** + * Parametrization of the text generation process + */ + generation_parameters?: GenerationParameters; + [property: string]: unknown; +} +/** + * Parametrization of the text generation process + */ +export interface GenerationParameters { + /** + * Whether to use sampling instead of greedy decoding when generating new tokens. + */ + do_sample?: boolean; + /** + * Controls the stopping condition for beam-based methods. + */ + early_stopping?: EarlyStoppingUnion; + /** + * If set to float strictly between 0 and 1, only tokens with a conditional probability + * greater than epsilon_cutoff will be sampled. In the paper, suggested values range from + * 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language + * Model Desmoothing](https://hf.co/papers/2210.15191) for more details. + */ + epsilon_cutoff?: number; + /** + * Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to + * float strictly between 0 and 1, a token is only considered if it is greater than either + * eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter + * term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In + * the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model. + * See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) + * for more details. + */ + eta_cutoff?: number; + /** + * The maximum length (in tokens) of the generated text, including the input. + */ + max_length?: number; + /** + * The maximum number of tokens to generate. Takes precedence over max_length. + */ + max_new_tokens?: number; + /** + * The minimum length (in tokens) of the generated text, including the input. + */ + min_length?: number; + /** + * The minimum number of tokens to generate. Takes precedence over min_length. + */ + min_new_tokens?: number; + /** + * Number of groups to divide num_beams into in order to ensure diversity among different + * groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details. + */ + num_beam_groups?: number; + /** + * Number of beams to use for beam search. + */ + num_beams?: number; + /** + * The value balances the model confidence and the degeneration penalty in contrastive + * search decoding. + */ + penalty_alpha?: number; + /** + * The value used to modulate the next token probabilities. + */ + temperature?: number; + /** + * The number of highest probability vocabulary tokens to keep for top-k-filtering. + */ + top_k?: number; + /** + * If set to float < 1, only the smallest set of most probable tokens with probabilities + * that add up to top_p or higher are kept for generation. + */ + top_p?: number; + /** + * Local typicality measures how similar the conditional probability of predicting a target + * token next is to the expected conditional probability of predicting a random token next, + * given the partial text already generated. If set to float < 1, the smallest set of the + * most locally typical tokens with probabilities that add up to typical_p or higher are + * kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details. + */ + typical_p?: number; + /** + * Whether the model should use the past last key/values attentions to speed up decoding + */ + use_cache?: boolean; + [property: string]: unknown; +} +/** + * Controls the stopping condition for beam-based methods. + */ +export type EarlyStoppingUnion = boolean | "never"; +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..eec3725373942525186fac3145889c21d7eab2d7 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-audio/inference.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,IAAI,CAAC;IACZ;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-audio/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..9f3b6ad845035578c7d5be1c8af56971c67a1f3f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-image/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAmGf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.js new file mode 100644 index 0000000000000000000000000000000000000000..6951db8903fa9e515362d64453764bc6e704c958 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/data.js @@ -0,0 +1,99 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "RedCaps is a large-scale dataset of 12M image-text pairs collected from Reddit.", + id: "red_caps", + }, + { + description: "Conceptual Captions is a dataset consisting of ~3.3M images annotated with captions.", + id: "conceptual_captions", + }, + { + description: "12M image-caption pairs.", + id: "Spawning/PD12M", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "A city above clouds, pastel colors, Victorian style", + type: "text", + }, + ], + outputs: [ + { + filename: "image.jpeg", + type: "img", + }, + ], + }, + metrics: [ + { + description: "The Inception Score (IS) measure assesses diversity and meaningfulness. It uses a generated image sample to predict its label. A higher score signifies more diverse and meaningful images.", + id: "IS", + }, + { + description: "The Fréchet Inception Distance (FID) calculates the distance between distributions between synthetic and real samples. A lower FID score indicates better similarity between the distributions of real and generated images.", + id: "FID", + }, + { + description: "R-precision assesses how the generated image aligns with the provided text description. It uses the generated images as queries to retrieve relevant text descriptions. The top 'r' relevant descriptions are selected and used to calculate R-precision as r/R, where 'R' is the number of ground truth descriptions associated with the generated images. A higher R-precision value indicates a better model.", + id: "R-Precision", + }, + ], + models: [ + { + description: "One of the most powerful image generation models that can generate realistic outputs.", + id: "black-forest-labs/FLUX.1-Krea-dev", + }, + { + description: "A powerful image generation model.", + id: "Qwen/Qwen-Image", + }, + { + description: "Powerful and fast image generation model.", + id: "ByteDance/SDXL-Lightning", + }, + { + description: "A powerful text-to-image model.", + id: "ByteDance/Hyper-SD", + }, + ], + spaces: [ + { + description: "A powerful text-to-image application.", + id: "stabilityai/stable-diffusion-3-medium", + }, + { + description: "A text-to-image application to generate comics.", + id: "jbilcke-hf/ai-comic-factory", + }, + { + description: "An application to match multiple custom image generation models.", + id: "multimodalart/flux-lora-lab", + }, + { + description: "A powerful yet very fast image generation application.", + id: "latent-consistency/lcm-lora-for-sdxl", + }, + { + description: "A gallery to explore various text-to-image models.", + id: "multimodalart/LoraTheExplorer", + }, + { + description: "An application for `text-to-image`, `image-to-image` and image inpainting.", + id: "ArtGAN/Stable-Diffusion-ControlNet-WebUI", + }, + { + description: "An application to generate realistic images given photos of a person and a prompt.", + id: "InstantX/InstantID", + }, + ], + summary: "Text-to-image is the task of generating images from input text. These pipelines can also be used to modify and edit images based on text prompts.", + widgetModels: ["black-forest-labs/FLUX.1-dev"], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af711fe85ee463c28cdd3f514466a6344a3a2cdb --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.d.ts @@ -0,0 +1,66 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Text To Image inference + */ +export interface TextToImageInput { + /** + * The input text data (sometimes called "prompt") + */ + inputs: string; + /** + * Additional inference parameters for Text To Image + */ + parameters?: TextToImageParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Text To Image + */ +export interface TextToImageParameters { + /** + * A higher guidance scale value encourages the model to generate images closely linked to + * the text prompt, but values too high may cause saturation and other artifacts. + */ + guidance_scale?: number; + /** + * The height in pixels of the output image + */ + height?: number; + /** + * One prompt to guide what NOT to include in image generation. + */ + negative_prompt?: string; + /** + * The number of denoising steps. More denoising steps usually lead to a higher quality + * image at the expense of slower inference. + */ + num_inference_steps?: number; + /** + * Override the scheduler with a compatible one. + */ + scheduler?: string; + /** + * Seed for the random number generator. + */ + seed?: number; + /** + * The width in pixels of the output image + */ + width?: number; + [property: string]: unknown; +} +/** + * Outputs of inference for the Text To Image task + */ +export interface TextToImageOutput { + /** + * The generated image returned as raw bytes in the payload. + */ + image: unknown; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..03467437eb89c69ccf8ef265aa92d9e6eae427e5 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-image/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..ed4c56895bf73bf3252bfe24ad8c688f910332fc --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-speech/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAiFf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.js new file mode 100644 index 0000000000000000000000000000000000000000..1683400355cc14648439e38a8e4ace2860b62bb1 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/data.js @@ -0,0 +1,84 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + canonicalId: "text-to-audio", + datasets: [ + { + description: "10K hours of multi-speaker English dataset.", + id: "parler-tts/mls_eng_10k", + }, + { + description: "Multi-speaker English dataset.", + id: "mythicinfinity/libritts_r", + }, + { + description: "Multi-lingual dataset.", + id: "facebook/multilingual_librispeech", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "I love audio models on the Hub!", + type: "text", + }, + ], + outputs: [ + { + filename: "audio.wav", + type: "audio", + }, + ], + }, + metrics: [ + { + description: "The Mel Cepstral Distortion (MCD) metric is used to calculate the quality of generated speech.", + id: "mel cepstral distortion", + }, + ], + models: [ + { + description: "Small yet powerful TTS model.", + id: "KittenML/kitten-tts-nano-0.1", + }, + { + description: "Bleeding edge TTS model.", + id: "ResembleAI/chatterbox", + }, + { + description: "A massively multi-lingual TTS model.", + id: "fishaudio/fish-speech-1.5", + }, + { + description: "A text-to-dialogue model.", + id: "nari-labs/Dia-1.6B-0626", + }, + ], + spaces: [ + { + description: "An application for generate high quality speech in different languages.", + id: "hexgrad/Kokoro-TTS", + }, + { + description: "A multilingual text-to-speech application.", + id: "fishaudio/fish-speech-1", + }, + { + description: "Performant TTS application.", + id: "ResembleAI/Chatterbox", + }, + { + description: "An application to compare different TTS models.", + id: "TTS-AGI/TTS-Arena-V2", + }, + { + description: "An application that generates podcast episodes.", + id: "ngxson/kokoro-podcast-generator", + }, + ], + summary: "Text-to-Speech (TTS) is the task of generating natural sounding speech given text input. TTS models can be extended to have a single model that generates speech for multiple speakers and multiple languages.", + widgetModels: ["suno/bark"], + youtubeId: "NW62DpzJ274", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6cc131914ae1bf76593f4a2958c5cda23baff842 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.d.ts @@ -0,0 +1,134 @@ +/** + * Outputs of inference for the Text To Speech task + */ +export interface TextToSpeechOutput { + /** + * The generated audio + */ + audio: Blob; + /** + * The sampling rate of the generated audio waveform. + */ + sampling_rate?: number; + [property: string]: unknown; +} +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Text To Speech inference + */ +export interface TextToSpeechInput { + /** + * The input text data + */ + inputs: string; + /** + * Additional inference parameters for Text To Speech + */ + parameters?: TextToSpeechParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Text To Speech + */ +export interface TextToSpeechParameters { + /** + * Parametrization of the text generation process + */ + generation_parameters?: GenerationParameters; + [property: string]: unknown; +} +/** + * Parametrization of the text generation process + */ +export interface GenerationParameters { + /** + * Whether to use sampling instead of greedy decoding when generating new tokens. + */ + do_sample?: boolean; + /** + * Controls the stopping condition for beam-based methods. + */ + early_stopping?: EarlyStoppingUnion; + /** + * If set to float strictly between 0 and 1, only tokens with a conditional probability + * greater than epsilon_cutoff will be sampled. In the paper, suggested values range from + * 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language + * Model Desmoothing](https://hf.co/papers/2210.15191) for more details. + */ + epsilon_cutoff?: number; + /** + * Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to + * float strictly between 0 and 1, a token is only considered if it is greater than either + * eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter + * term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In + * the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model. + * See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) + * for more details. + */ + eta_cutoff?: number; + /** + * The maximum length (in tokens) of the generated text, including the input. + */ + max_length?: number; + /** + * The maximum number of tokens to generate. Takes precedence over max_length. + */ + max_new_tokens?: number; + /** + * The minimum length (in tokens) of the generated text, including the input. + */ + min_length?: number; + /** + * The minimum number of tokens to generate. Takes precedence over min_length. + */ + min_new_tokens?: number; + /** + * Number of groups to divide num_beams into in order to ensure diversity among different + * groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details. + */ + num_beam_groups?: number; + /** + * Number of beams to use for beam search. + */ + num_beams?: number; + /** + * The value balances the model confidence and the degeneration penalty in contrastive + * search decoding. + */ + penalty_alpha?: number; + /** + * The value used to modulate the next token probabilities. + */ + temperature?: number; + /** + * The number of highest probability vocabulary tokens to keep for top-k-filtering. + */ + top_k?: number; + /** + * If set to float < 1, only the smallest set of most probable tokens with probabilities + * that add up to top_p or higher are kept for generation. + */ + top_p?: number; + /** + * Local typicality measures how similar the conditional probability of predicting a target + * token next is to the expected conditional probability of predicting a random token next, + * given the partial text already generated. If set to float < 1, the smallest set of the + * most locally typical tokens with probabilities that add up to typical_p or higher are + * kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details. + */ + typical_p?: number; + /** + * Whether the model should use the past last key/values attentions to speed up decoding + */ + use_cache?: boolean; + [property: string]: unknown; +} +/** + * Controls the stopping condition for beam-based methods. + */ +export type EarlyStoppingUnion = boolean | "never"; +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..47fb15af47a221be88e3d57de5fdb4b950d5af25 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-speech/inference.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,KAAK,EAAE,IAAI,CAAC;IACZ;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,CAAC;IAC7C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-speech/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..15f63d971713a969dbf522ff03184c46e982cf0e --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-video/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAqGf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.js new file mode 100644 index 0000000000000000000000000000000000000000..b15983167ef23a79decf6f6a296f795f39eaea9c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/data.js @@ -0,0 +1,99 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Microsoft Research Video to Text is a large-scale dataset for open domain video captioning", + id: "iejMac/CLIP-MSR-VTT", + }, + { + description: "UCF101 Human Actions dataset consists of 13,320 video clips from YouTube, with 101 classes.", + id: "quchenyuan/UCF101-ZIP", + }, + { + description: "A high-quality dataset for human action recognition in YouTube videos.", + id: "nateraw/kinetics", + }, + { + description: "A dataset of video clips of humans performing pre-defined basic actions with everyday objects.", + id: "HuggingFaceM4/something_something_v2", + }, + { + description: "This dataset consists of text-video pairs and contains noisy samples with irrelevant video descriptions", + id: "HuggingFaceM4/webvid", + }, + { + description: "A dataset of short Flickr videos for the temporal localization of events with descriptions.", + id: "iejMac/CLIP-DiDeMo", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "Darth Vader is surfing on the waves.", + type: "text", + }, + ], + outputs: [ + { + filename: "text-to-video-output.gif", + type: "img", + }, + ], + }, + metrics: [ + { + description: "Inception Score uses an image classification model that predicts class labels and evaluates how distinct and diverse the images are. A higher score indicates better video generation.", + id: "is", + }, + { + description: "Frechet Inception Distance uses an image classification model to obtain image embeddings. The metric compares mean and standard deviation of the embeddings of real and generated images. A smaller score indicates better video generation.", + id: "fid", + }, + { + description: "Frechet Video Distance uses a model that captures coherence for changes in frames and the quality of each frame. A smaller score indicates better video generation.", + id: "fvd", + }, + { + description: "CLIPSIM measures similarity between video frames and text using an image-text similarity model. A higher score indicates better video generation.", + id: "clipsim", + }, + ], + models: [ + { + description: "A strong model for consistent video generation.", + id: "tencent/HunyuanVideo", + }, + { + description: "A text-to-video model with high fidelity motion and strong prompt adherence.", + id: "Lightricks/LTX-Video", + }, + { + description: "A text-to-video model focusing on physics-aware applications like robotics.", + id: "nvidia/Cosmos-1.0-Diffusion-7B-Text2World", + }, + { + description: "Very fast model for video generation.", + id: "Lightricks/LTX-Video-0.9.8-13B-distilled", + }, + ], + spaces: [ + { + description: "An application that generates video from text.", + id: "VideoCrafter/VideoCrafter", + }, + { + description: "Consistent video generation application.", + id: "Wan-AI/Wan2.1", + }, + { + description: "A cutting edge video generation application.", + id: "Pyramid-Flow/pyramid-flow", + }, + ], + summary: "Text-to-video models can be used in any application that requires generating consistent sequence of images from text. ", + widgetModels: ["Wan-AI/Wan2.2-TI2V-5B"], + youtubeId: undefined, +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c3791350c974ef6ec40fc61866deb614344b143 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.d.ts @@ -0,0 +1,58 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Text To Video inference + */ +export interface TextToVideoInput { + /** + * The input text data (sometimes called "prompt") + */ + inputs: string; + /** + * Additional inference parameters for Text To Video + */ + parameters?: TextToVideoParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Text To Video + */ +export interface TextToVideoParameters { + /** + * A higher guidance scale value encourages the model to generate videos closely linked to + * the text prompt, but values too high may cause saturation and other artifacts. + */ + guidance_scale?: number; + /** + * One or several prompt to guide what NOT to include in video generation. + */ + negative_prompt?: string[]; + /** + * The num_frames parameter determines how many video frames are generated. + */ + num_frames?: number; + /** + * The number of denoising steps. More denoising steps usually lead to a higher quality + * video at the expense of slower inference. + */ + num_inference_steps?: number; + /** + * Seed for the random number generator. + */ + seed?: number; + [property: string]: unknown; +} +/** + * Outputs of inference for the Text To Video task + */ +export interface TextToVideoOutput { + /** + * The generated video returned as raw bytes in the payload. + */ + video: unknown; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..420f50f10ede66c1dfc384c98c82e226bb0a2f14 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-video/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/text-to-video/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..be4523e103c5a787df5558ad8ae91a69cda08bb5 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/token-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAuFf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.js new file mode 100644 index 0000000000000000000000000000000000000000..b7d37491e17b757d97e6aedef4241e42ea7d3614 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/data.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "A widely used dataset useful to benchmark named entity recognition models.", + id: "eriktks/conll2003", + }, + { + description: "A multilingual dataset of Wikipedia articles annotated for named entity recognition in over 150 different languages.", + id: "unimelb-nlp/wikiann", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "My name is Omar and I live in Zürich.", + type: "text", + }, + ], + outputs: [ + { + text: "My name is Omar and I live in Zürich.", + tokens: [ + { + type: "PERSON", + start: 11, + end: 15, + }, + { + type: "GPE", + start: 30, + end: 36, + }, + ], + type: "text-with-tokens", + }, + ], + }, + metrics: [ + { + description: "", + id: "accuracy", + }, + { + description: "", + id: "recall", + }, + { + description: "", + id: "precision", + }, + { + description: "", + id: "f1", + }, + ], + models: [ + { + description: "A robust performance model to identify people, locations, organizations and names of miscellaneous entities.", + id: "dslim/bert-base-NER", + }, + { + description: "A strong model to identify people, locations, organizations and names in multiple languages.", + id: "FacebookAI/xlm-roberta-large-finetuned-conll03-english", + }, + { + description: "A token classification model specialized on medical entity recognition.", + id: "blaze999/Medical-NER", + }, + { + description: "Flair models are typically the state of the art in named entity recognition tasks.", + id: "flair/ner-english", + }, + ], + spaces: [ + { + description: "An application that can recognizes entities, extracts noun chunks and recognizes various linguistic features of each token.", + id: "spacy/gradio_pipeline_visualizer", + }, + ], + summary: "Token classification is a natural language understanding task in which a label is assigned to some tokens in a text. Some popular token classification subtasks are Named Entity Recognition (NER) and Part-of-Speech (PoS) tagging. NER models could be trained to identify specific entities in a text, such as dates, individuals and places; and PoS tagging would identify, for example, which words in a text are verbs, nouns, and punctuation marks.", + widgetModels: ["FacebookAI/xlm-roberta-large-finetuned-conll03-english"], + youtubeId: "wVHdVlPScxA", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eac5ea3f3006f8f8909e67692888a5290d2c766f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.d.ts @@ -0,0 +1,84 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Token Classification inference + */ +export interface TokenClassificationInput { + /** + * The input text data + */ + inputs: string; + /** + * Additional inference parameters for Token Classification + */ + parameters?: TokenClassificationParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Token Classification + */ +export interface TokenClassificationParameters { + /** + * The strategy used to fuse tokens based on model predictions + */ + aggregation_strategy?: TokenClassificationAggregationStrategy; + /** + * A list of labels to ignore + */ + ignore_labels?: string[]; + /** + * The number of overlapping tokens between chunks when splitting the input text. + */ + stride?: number; + [property: string]: unknown; +} +/** + * Do not aggregate tokens + * + * Group consecutive tokens with the same label in a single entity. + * + * Similar to "simple", also preserves word integrity (use the label predicted for the first + * token in a word). + * + * Similar to "simple", also preserves word integrity (uses the label with the highest + * score, averaged across the word's tokens). + * + * Similar to "simple", also preserves word integrity (uses the label with the highest score + * across the word's tokens). + */ +export type TokenClassificationAggregationStrategy = "none" | "simple" | "first" | "average" | "max"; +export type TokenClassificationOutput = TokenClassificationOutputElement[]; +/** + * Outputs of inference for the Token Classification task + */ +export interface TokenClassificationOutputElement { + /** + * The character position in the input where this group ends. + */ + end: number; + /** + * The predicted label for a single token + */ + entity?: string; + /** + * The predicted label for a group of one or more tokens + */ + entity_group?: string; + /** + * The associated score / probability + */ + score: number; + /** + * The character position in the input where this group begins. + */ + start: number; + /** + * The corresponding text + */ + word: string; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c8afeae4c523c21a681a7a3453d1df2ec382d7a3 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/token-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,oBAAoB,CAAC,EAAE,sCAAsC,CAAC;IAC9D;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,sCAAsC,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;AACrG,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/token-classification/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..2db6b74c8d7f7cb9ecc51018f83b40c1749d641f --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/translation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAiEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.js new file mode 100644 index 0000000000000000000000000000000000000000..d5a05554ba0ea7b73627e0eddbf3515718fe329c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/data.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + canonicalId: "text-generation", + datasets: [ + { + description: "A dataset of copyright-free books translated into 16 different languages.", + id: "Helsinki-NLP/opus_books", + }, + { + description: "An example of translation between programming languages. This dataset consists of functions in Java and C#.", + id: "google/code_x_glue_cc_code_to_code_trans", + }, + ], + demo: { + inputs: [ + { + label: "Input", + content: "My name is Omar and I live in Zürich.", + type: "text", + }, + ], + outputs: [ + { + label: "Output", + content: "Mein Name ist Omar und ich wohne in Zürich.", + type: "text", + }, + ], + }, + metrics: [ + { + description: "BLEU score is calculated by counting the number of shared single or subsequent tokens between the generated sequence and the reference. Subsequent n tokens are called “n-grams”. Unigram refers to a single token while bi-gram refers to token pairs and n-grams refer to n subsequent tokens. The score ranges from 0 to 1, where 1 means the translation perfectly matched and 0 did not match at all", + id: "bleu", + }, + { + description: "", + id: "sacrebleu", + }, + ], + models: [ + { + description: "Very powerful model that can translate many languages between each other, especially low-resource languages.", + id: "facebook/nllb-200-1.3B", + }, + { + description: "A general-purpose Transformer that can be used to translate from English to German, French, or Romanian.", + id: "google-t5/t5-base", + }, + ], + spaces: [ + { + description: "An application that can translate between 100 languages.", + id: "Iker/Translate-100-languages", + }, + { + description: "An application that can translate between many languages.", + id: "Geonmo/nllb-translation-demo", + }, + ], + summary: "Translation is the task of converting text from one language to another.", + widgetModels: ["facebook/mbart-large-50-many-to-many-mmt"], + youtubeId: "1JvfrvZgi6c", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4df641a2cb758ae4ef24e0313e9dec7f9a4d8059 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.d.ts @@ -0,0 +1,64 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Translation inference + */ +export interface TranslationInput { + /** + * The text to translate. + */ + inputs: string; + /** + * Additional inference parameters for Translation + */ + parameters?: TranslationParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Translation + */ +export interface TranslationParameters { + /** + * Whether to clean up the potential extra spaces in the text output. + */ + clean_up_tokenization_spaces?: boolean; + /** + * Additional parametrization of the text generation algorithm. + */ + generate_parameters?: { + [key: string]: unknown; + }; + /** + * The source language of the text. Required for models that can translate from multiple + * languages. + */ + src_lang?: string; + /** + * Target language to translate to. Required for models that can translate to multiple + * languages. + */ + tgt_lang?: string; + /** + * The truncation strategy to use. + */ + truncation?: TranslationTruncationStrategy; + [property: string]: unknown; +} +/** + * The truncation strategy to use. + */ +export type TranslationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second"; +/** + * Outputs of inference for the Translation task + */ +export interface TranslationOutput { + /** + * The translated text. + */ + translation_text: string; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..03d7567511144732e069f733012ac65822b2e539 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/translation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;IACF;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,iBAAiB,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,CAAC;AAC/G;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/translation/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7ae1ca65807d46bdc5161ad0d750274be15306cb --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/unconditional-image-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAmEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.js new file mode 100644 index 0000000000000000000000000000000000000000..b361750c37c6cc44afa88bbceec3e55aeaefc74b --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/unconditional-image-generation/data.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "The CIFAR-100 dataset consists of 60000 32x32 colour images in 100 classes, with 600 images per class.", + id: "cifar100", + }, + { + description: "Multiple images of celebrities, used for facial expression translation.", + id: "CelebA", + }, + ], + demo: { + inputs: [ + { + label: "Seed", + content: "42", + type: "text", + }, + { + label: "Number of images to generate:", + content: "4", + type: "text", + }, + ], + outputs: [ + { + filename: "unconditional-image-generation-output.jpeg", + type: "img", + }, + ], + }, + metrics: [ + { + description: "The inception score (IS) evaluates the quality of generated images. It measures the diversity of the generated images (the model predictions are evenly distributed across all possible labels) and their 'distinction' or 'sharpness' (the model confidently predicts a single label for each image).", + id: "Inception score (IS)", + }, + { + description: "The Fréchet Inception Distance (FID) evaluates the quality of images created by a generative model by calculating the distance between feature vectors for real and generated images.", + id: "Frećhet Inception Distance (FID)", + }, + ], + models: [ + { + description: "High-quality image generation model trained on the CIFAR-10 dataset. It synthesizes images of the ten classes presented in the dataset using diffusion probabilistic models, a class of latent variable models inspired by considerations from nonequilibrium thermodynamics.", + id: "google/ddpm-cifar10-32", + }, + { + description: "High-quality image generation model trained on the 256x256 CelebA-HQ dataset. It synthesizes images of faces using diffusion probabilistic models, a class of latent variable models inspired by considerations from nonequilibrium thermodynamics.", + id: "google/ddpm-celebahq-256", + }, + ], + spaces: [ + { + description: "An application that can generate realistic faces.", + id: "CompVis/celeba-latent-diffusion", + }, + ], + summary: "Unconditional image generation is the task of generating images with no condition in any context (like a prompt text or another image). Once trained, the model will create images that resemble its training data distribution.", + widgetModels: [""], + // TODO: Add related video + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7ddd46629dd3f6fdc2e7bebd42b3cbe2cb701d6e --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/video-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA+Ef,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.js new file mode 100644 index 0000000000000000000000000000000000000000..9a83d475f76f64c7da35a8000180a1c24d639da5 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/data.js @@ -0,0 +1,82 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + // TODO write proper description + description: "Benchmark dataset used for video classification with videos that belong to 400 classes.", + id: "kinetics400", + }, + ], + demo: { + inputs: [ + { + filename: "video-classification-input.gif", + type: "img", + }, + ], + outputs: [ + { + type: "chart", + data: [ + { + label: "Playing Guitar", + score: 0.514, + }, + { + label: "Playing Tennis", + score: 0.193, + }, + { + label: "Cooking", + score: 0.068, + }, + ], + }, + ], + }, + metrics: [ + { + description: "", + id: "accuracy", + }, + { + description: "", + id: "recall", + }, + { + description: "", + id: "precision", + }, + { + description: "", + id: "f1", + }, + ], + models: [ + { + // TO DO: write description + description: "Strong Video Classification model trained on the Kinetics 400 dataset.", + id: "google/vivit-b-16x2-kinetics400", + }, + { + // TO DO: write description + description: "Strong Video Classification model trained on the Kinetics 400 dataset.", + id: "microsoft/xclip-base-patch32", + }, + ], + spaces: [ + { + description: "An application that classifies video at different timestamps.", + id: "nateraw/lavila", + }, + { + description: "An application that classifies video.", + id: "fcakyon/video-classification", + }, + ], + summary: "Video classification is the task of assigning a label or class to an entire video. Videos are expected to have only one class for each video. Video classification models take a video as input and return a prediction about which class the video belongs to.", + widgetModels: [], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97499d022d9a2406ecf3ae55c64b7855f16fcb62 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.d.ts @@ -0,0 +1,61 @@ +/** + * Inference code generated from the JSON schema spec in ./spec + * + * Using src/scripts/inference-codegen + */ +/** + * Inputs for Video Classification inference + */ +export interface VideoClassificationInput { + /** + * The input video data + */ + inputs: unknown; + /** + * Additional inference parameters for Video Classification + */ + parameters?: VideoClassificationParameters; + [property: string]: unknown; +} +/** + * Additional inference parameters for Video Classification + */ +export interface VideoClassificationParameters { + /** + * The sampling rate used to select frames from the video. + */ + frame_sampling_rate?: number; + /** + * The function to apply to the model outputs in order to retrieve the scores. + */ + function_to_apply?: ClassificationOutputTransform; + /** + * The number of sampled frames to consider for classification. + */ + num_frames?: number; + /** + * When specified, limits the output to the top K most probable classes. + */ + top_k?: number; + [property: string]: unknown; +} +/** + * The function to apply to the model outputs in order to retrieve the scores. + */ +export type ClassificationOutputTransform = "sigmoid" | "softmax" | "none"; +export type VideoClassificationOutput = VideoClassificationOutputElement[]; +/** + * Outputs of inference for the Video Classification task + */ +export interface VideoClassificationOutputElement { + /** + * The predicted class label. + */ + label: string; + /** + * The corresponding probability. + */ + score: number; + [property: string]: unknown; +} +//# sourceMappingURL=inference.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..becc24194891238147e7e67309e2d194a029bce1 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/video-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAClD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-classification/inference.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..9fd072183cf99733f8fa8c8d9917610b5984eca7 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/video-text-to-text/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cAqEf,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.js b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.js new file mode 100644 index 0000000000000000000000000000000000000000..d6c54bf7634edd019e6054baa5934bc3366dc44c --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-text-to-text/data.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const taskData = { + datasets: [ + { + description: "Multiple-choice questions and answers about videos.", + id: "lmms-lab/Video-MME", + }, + { + description: "A dataset of instructions and question-answer pairs about videos.", + id: "lmms-lab/VideoChatGPT", + }, + { + description: "Large video understanding dataset.", + id: "HuggingFaceFV/finevideo", + }, + ], + demo: { + inputs: [ + { + filename: "video-text-to-text-input.gif", + type: "img", + }, + { + label: "Text Prompt", + content: "What is happening in this video?", + type: "text", + }, + ], + outputs: [ + { + label: "Answer", + content: "The video shows a series of images showing a fountain with water jets and a variety of colorful flowers and butterflies in the background.", + type: "text", + }, + ], + }, + metrics: [], + models: [ + { + description: "A robust video-text-to-text model.", + id: "Vision-CAIR/LongVU_Qwen2_7B", + }, + { + description: "Strong video-text-to-text model with reasoning capabilities.", + id: "GoodiesHere/Apollo-LMMs-Apollo-7B-t32", + }, + { + description: "Strong video-text-to-text model.", + id: "HuggingFaceTB/SmolVLM2-2.2B-Instruct", + }, + ], + spaces: [ + { + description: "An application to chat with a video-text-to-text model.", + id: "llava-hf/video-llava", + }, + { + description: "A leaderboard for various video-text-to-text models.", + id: "opencompass/openvlm_video_leaderboard", + }, + { + description: "An application to generate highlights from a video.", + id: "HuggingFaceTB/SmolVLM2-HighlightGenerator", + }, + ], + summary: "Video-text-to-text models take in a video and a text prompt and output text. These models are also called video-language models.", + widgetModels: [""], + youtubeId: "", +}; +exports.default = taskData; diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-to-video/data.d.ts b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-to-video/data.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc8794d0d9385cdff0fd88a7c158222897e8ea50 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-to-video/data.d.ts @@ -0,0 +1,4 @@ +import type { TaskDataCustom } from "../index.js"; +declare const taskData: TaskDataCustom; +export default taskData; +//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-to-video/data.d.ts.map b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-to-video/data.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..69a3a40fc74e02b3eae44a8bc24cd05d4de41b61 --- /dev/null +++ b/node_modules/@huggingface/tasks/dist/commonjs/tasks/video-to-video/data.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/video-to-video/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,QAAA,MAAM,QAAQ,EAAE,cA8Df,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file