From 36d054f104fc487bef22e66d9fab56c193952e55 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 05:35:48 +0000 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=F0=9F=A4=96=20integrate=20transfor?= =?UTF-8?q?mers=20model=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli/package.json | 5 +- packages/core/package.json | 1 + packages/core/src/chat.ts | 24 +--- packages/core/src/connection.ts | 11 ++ packages/core/src/constants.ts | 8 ++ packages/core/src/lm.ts | 4 + packages/core/src/ollama.ts | 2 +- packages/core/src/transformers.ts | 119 ++++++++++++++++++ packages/core/src/types/prompt_template.d.ts | 1 + .../sample/genaisrc/transformers.genai.mjs | 4 + packages/vscode/package.json | 2 +- 11 files changed, 154 insertions(+), 27 deletions(-) create mode 100644 packages/core/src/transformers.ts create mode 100644 packages/sample/genaisrc/transformers.genai.mjs diff --git a/packages/cli/package.json b/packages/cli/package.json index 2a107c8ea0..98bba50d13 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -53,6 +53,7 @@ "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz" }, "optionalDependencies": { + "@huggingface/transformers": "^3.0.2", "@lvce-editor/ripgrep": "^1.4.0", "pdfjs-dist": "4.8.69", "playwright": "^1.49.0", @@ -94,8 +95,8 @@ "zx": "^8.2.2" }, "scripts": { - "compile": "esbuild src/main.ts --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas && node ../../scripts/patch-cli.mjs", - "compile-debug": "esbuild src/main.ts --sourcemap --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas", + "compile": "esbuild src/main.ts --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas --external:@huggingface/transformers && node ../../scripts/patch-cli.mjs", + "compile-debug": "esbuild src/main.ts --sourcemap --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas --external:@huggingface/transformers", "postcompile": "node built/genaiscript.cjs info help > ../../docs/src/content/docs/reference/cli/commands.md", "vis:treemap": "npx --yes esbuild-visualizer --metadata esbuild.meta.json --filename esbuild.treemap.html", "vis:network": "npx --yes esbuild-visualizer --metadata esbuild.meta.json --filename esbuild.network.html --template network", diff --git a/packages/core/package.json b/packages/core/package.json index 7124224a6a..13401244b1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,6 +21,7 @@ "@anthropic-ai/sdk": "^0.32.1", "@azure/identity": "^4.5.0", "@huggingface/jinja": "^0.3.2", + "@huggingface/transformers": "^3.0.2", "@octokit/plugin-paginate-rest": "^11.3.5", "@octokit/plugin-retry": "^7.1.2", "@octokit/plugin-throttling": "^9.3.2", diff --git a/packages/core/src/chat.ts b/packages/core/src/chat.ts index 8cd7594c41..cfbfcd2ecb 100644 --- a/packages/core/src/chat.ts +++ b/packages/core/src/chat.ts @@ -106,29 +106,7 @@ export function toChatCompletionUserMessage( content: expanded, } } -/* -function encodeMessagesForLlama(req: CreateChatCompletionRequest) { - return ( - req.messages - .map((msg) => { - switch (msg.role) { - case "user": - return `[INST]\n${msg.content}\n[/INST]` - case "system": - return `[INST] <>\n${msg.content}\n<>\n[/INST]` - case "assistant": - return msg.content - case "function": - return "???function" - default: - return "???role " + msg.role - } - }) - .join("\n") - .replace(/\[\/INST\]\n\[INST\]/g, "\n") + "\n" - ) -} -*/ + export type ChatCompletionHandler = ( req: CreateChatCompletionRequest, connection: LanguageModelConfiguration, diff --git a/packages/core/src/connection.ts b/packages/core/src/connection.ts index 7ae61b8467..0c9cdea220 100644 --- a/packages/core/src/connection.ts +++ b/packages/core/src/connection.ts @@ -25,6 +25,7 @@ import { OLLAMA_DEFAUT_PORT, MODEL_PROVIDER_GOOGLE, GOOGLE_API_BASE, + MODEL_PROVIDER_TRANSFORMERS, } from "./constants" import { fileExists, readText, writeText } from "./fs" import { @@ -407,6 +408,16 @@ export async function parseTokenFromEnv( } } + if (provider === MODEL_PROVIDER_TRANSFORMERS) { + return { + provider, + model, + base: undefined, + token: "transformers", + source: "default", + } + } + if (provider === MODEL_PROVIDER_CLIENT && host.clientLanguageModel) { return { provider, diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 3a3812f922..f12d40f00f 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -172,6 +172,7 @@ export const MODEL_PROVIDER_AICI = "aici" export const MODEL_PROVIDER_CLIENT = "client" export const MODEL_PROVIDER_ANTHROPIC = "anthropic" export const MODEL_PROVIDER_HUGGINGFACE = "huggingface" +export const MODEL_PROVIDER_TRANSFORMERS = "transformers" export const TRACE_FILE_PREVIEW_MAX_LENGTH = 240 @@ -210,6 +211,8 @@ export const DOCS_CONFIGURATION_GOOGLE_URL = "https://microsoft.github.io/genaiscript/getting-started/configuration/#google" export const DOCS_CONFIGURATION_HUGGINGFACE_URL = "https://microsoft.github.io/genaiscript/getting-started/configuration/#huggingface" +export const DOCS_CONFIGURATION_HUGGINGFACE_TRANSFORMERS_URL = + "https://microsoft.github.io/genaiscript/getting-started/configuration/#transformers" export const DOCS_CONFIGURATION_CONTENT_SAFETY_URL = "https://microsoft.github.io/genaiscript/reference/scripts/content-safety" export const DOCS_DEF_FILES_IS_EMPTY_URL = @@ -262,6 +265,11 @@ export const MODEL_PROVIDERS = Object.freeze([ detail: "Hugging Face models", url: DOCS_CONFIGURATION_HUGGINGFACE_URL, }, + { + id: MODEL_PROVIDER_TRANSFORMERS, + detail: "Hugging Face Transformers", + url: DOCS_CONFIGURATION_HUGGINGFACE_TRANSFORMERS_URL, + }, { id: MODEL_PROVIDER_OLLAMA, detail: "Ollama local model", diff --git a/packages/core/src/lm.ts b/packages/core/src/lm.ts index 3826dec4c8..63f69d8004 100644 --- a/packages/core/src/lm.ts +++ b/packages/core/src/lm.ts @@ -1,3 +1,4 @@ +import { Transform } from "stream" import { AICIModel } from "./aici" import { AnthropicModel } from "./anthropic" import { LanguageModel } from "./chat" @@ -6,10 +7,12 @@ import { MODEL_PROVIDER_ANTHROPIC, MODEL_PROVIDER_CLIENT, MODEL_PROVIDER_OLLAMA, + MODEL_PROVIDER_TRANSFORMERS, } from "./constants" import { host } from "./host" import { OllamaModel } from "./ollama" import { OpenAIModel } from "./openai" +import { TransformersModel } from "./transformers" export function resolveLanguageModel(provider: string): LanguageModel { if (provider === MODEL_PROVIDER_CLIENT) { @@ -20,5 +23,6 @@ export function resolveLanguageModel(provider: string): LanguageModel { if (provider === MODEL_PROVIDER_OLLAMA) return OllamaModel if (provider === MODEL_PROVIDER_AICI) return AICIModel if (provider === MODEL_PROVIDER_ANTHROPIC) return AnthropicModel + if (provider === MODEL_PROVIDER_TRANSFORMERS) return TransformersModel return OpenAIModel } diff --git a/packages/core/src/ollama.ts b/packages/core/src/ollama.ts index 1d0eba3c4b..5a3dc3ae13 100644 --- a/packages/core/src/ollama.ts +++ b/packages/core/src/ollama.ts @@ -24,7 +24,7 @@ import { URL } from "url" * @returns The result of the chat completion. * @throws Will throw an error if the model cannot be pulled or any other request error occurs. */ -export const OllamaCompletion: ChatCompletionHandler = async ( +const OllamaCompletion: ChatCompletionHandler = async ( req, cfg, options, diff --git a/packages/core/src/transformers.ts b/packages/core/src/transformers.ts new file mode 100644 index 0000000000..733411fbfb --- /dev/null +++ b/packages/core/src/transformers.ts @@ -0,0 +1,119 @@ +import { ChatCompletionHandler, LanguageModel } from "./chat" +import { renderMessageContent } from "./chatrender" +import { MODEL_PROVIDER_TRANSFORMERS } from "./constants" +import type { + Chat, + Message, + TextGenerationOutput, +} from "@huggingface/transformers" +import { NotSupportedError } from "./error" +import { ChatCompletionMessageParam, ChatCompletionResponse } from "./chattypes" +import { deleteUndefinedValues, dotGenaiscriptPath, logVerbose } from "./util" +import { parseModelIdentifier } from "./models" +import prettyBytes from "pretty-bytes" + +type GeneratorProgress = + | { + status: "initiate" + } + | { + status: "progress" + file: string + name: string + progress: number + loaded: number + total: number + } + +function progressBar() { + const progress: Record = {} + return (cb: GeneratorProgress) => { + if (cb.status !== "progress") return + const p = progress[cb.file] || 0 + const cp = Math.floor(cb.progress) + if (cp > p) { + progress[cb.file] = cp + logVerbose(`${cb.file}: ${cp}% (${prettyBytes(cb.loaded)})`) + } + } +} + +export const TransformersCompletion: ChatCompletionHandler = async ( + req, + cfg, + options, + trace +) => { + const { messages, temperature, top_p, max_tokens } = req + const { partialCb, inner } = options + const { model } = parseModelIdentifier(req.model) + try { + trace.startDetails(`transformer`) + trace.itemValue("model", model) + + const { pipeline } = await import("@huggingface/transformers") + // Create a text generation pipeline + const generator = await pipeline("text-generation", model, { + dtype: "q4", + cache_dir: dotGenaiscriptPath("transformers"), + progress_callback: progressBar(), + device: "cpu" + }) + logVerbose(`transformers model ${model} loaded`) + logVerbose(``) + const msgs: Chat = chatMessagesToTranformerMessages(messages) + trace.detailsFenced("messages", msgs, "yaml") + const output = (await generator( + msgs, + deleteUndefinedValues({ + max_new_tokens: max_tokens || 4000, + temperature, + top_p, + early_stopping: true, + }) + )) as TextGenerationOutput + const text = output + .map((msg) => (msg.generated_text.at(-1) as Message).content) + .join("\n") + trace.fence(text, "markdown") + partialCb?.({ + responseSoFar: text, + responseChunk: text, + tokensSoFar: 0, + inner, + }) + return { + text, + finishReason: "stop", + } satisfies ChatCompletionResponse + } catch (e) { + logVerbose(e) + throw e + } finally { + trace.endDetails() + } +} + +// Define the Ollama model with its completion handler and model listing function +export const TransformersModel = Object.freeze({ + completer: TransformersCompletion, + id: MODEL_PROVIDER_TRANSFORMERS, +}) + +function chatMessagesToTranformerMessages( + messages: ChatCompletionMessageParam[] +): Chat { + return messages.map((msg) => { + switch (msg.role) { + case "function": + case "aici": + case "tool": + throw new NotSupportedError(`role ${msg.role} not supported`) + default: + return { + role: msg.role, + content: renderMessageContent(msg), + } satisfies Message + } + }) +} diff --git a/packages/core/src/types/prompt_template.d.ts b/packages/core/src/types/prompt_template.d.ts index fa6453e18b..25d3c0dde6 100644 --- a/packages/core/src/types/prompt_template.d.ts +++ b/packages/core/src/types/prompt_template.d.ts @@ -152,6 +152,7 @@ type ModelType = OptionsOrString< | "google:gemini-1.5-pro" | "google:gemini-1.5-pro-002" | "google:gemini-1-pro" + | "transformers:onnx-community/Qwen2.5-0.5B-Instruct" > type ModelSmallType = OptionsOrString< diff --git a/packages/sample/genaisrc/transformers.genai.mjs b/packages/sample/genaisrc/transformers.genai.mjs new file mode 100644 index 0000000000..fa03487619 --- /dev/null +++ b/packages/sample/genaisrc/transformers.genai.mjs @@ -0,0 +1,4 @@ +script({ + model: "transformers:onnx-community/Qwen2.5-0.5B-Instruct", +}) +$`Write a poem with 2 paragraphs.` diff --git a/packages/vscode/package.json b/packages/vscode/package.json index a503fb0421..bfdc49bc2b 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -415,7 +415,7 @@ "vscode:update-dts": "npx @vscode/dts dev && mv vscode.*.d.ts src/", "vscode:prepublish": "yarn run compile", "compile:icons": "node updatefonts.mjs", - "compile:extension": "esbuild src/extension.ts --sourcemap --metafile=./esbuild.meta.json --bundle --format=cjs --platform=node --target=node20 --outfile=built/extension.js --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:vscode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:skia-canvas", + "compile:extension": "esbuild src/extension.ts --sourcemap --metafile=./esbuild.meta.json --bundle --format=cjs --platform=node --target=node20 --outfile=built/extension.js --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:vscode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:skia-canvas --external:@huggingface/transformers", "compile": "yarn compile:icons && yarn compile:extension", "vis:treemap": "npx --yes esbuild-visualizer --metadata esbuild.meta.json --filename esbuild.treemap.html", "vis:network": "npx --yes esbuild-visualizer --metadata esbuild.meta.json --filename esbuild.network.html --template network", From f6f42c1dfddd800b1742dc5a1c48d02c232a8b93 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 05:54:44 +0000 Subject: [PATCH 2/8] basic transformers support --- packages/core/src/transformers.ts | 10 +++++----- packages/core/src/usage.ts | 2 ++ packages/sample/genaisrc/transformers.genai.mjs | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/core/src/transformers.ts b/packages/core/src/transformers.ts index 733411fbfb..d4b4bcd4ca 100644 --- a/packages/core/src/transformers.ts +++ b/packages/core/src/transformers.ts @@ -46,18 +46,18 @@ export const TransformersCompletion: ChatCompletionHandler = async ( ) => { const { messages, temperature, top_p, max_tokens } = req const { partialCb, inner } = options - const { model } = parseModelIdentifier(req.model) + const { model, tag, family } = parseModelIdentifier(req.model) try { trace.startDetails(`transformer`) trace.itemValue("model", model) const { pipeline } = await import("@huggingface/transformers") // Create a text generation pipeline - const generator = await pipeline("text-generation", model, { - dtype: "q4", - cache_dir: dotGenaiscriptPath("transformers"), + const generator = await pipeline("text-generation", family, { + dtype: tag as any, + cache_dir: dotGenaiscriptPath("cache", "transformers"), progress_callback: progressBar(), - device: "cpu" + device: "cpu", }) logVerbose(`transformers model ${model} loaded`) logVerbose(``) diff --git a/packages/core/src/usage.ts b/packages/core/src/usage.ts index 931e0225bc..7f9a926070 100644 --- a/packages/core/src/usage.ts +++ b/packages/core/src/usage.ts @@ -283,6 +283,8 @@ export class GenerationStats { * @param indent - The indentation used for logging. */ private logTokens(indent: string) { + if (!this.resolvedModel) return + const unknowns = new Set() const c = this.cost() if (this.model && isNaN(c) && isCosteable(this.model)) diff --git a/packages/sample/genaisrc/transformers.genai.mjs b/packages/sample/genaisrc/transformers.genai.mjs index fa03487619..652ce2cbd3 100644 --- a/packages/sample/genaisrc/transformers.genai.mjs +++ b/packages/sample/genaisrc/transformers.genai.mjs @@ -1,4 +1,4 @@ script({ - model: "transformers:onnx-community/Qwen2.5-0.5B-Instruct", + model: "transformers:onnx-community/Qwen2.5-Coder-0.5B-Instruct:q4", }) $`Write a poem with 2 paragraphs.` From 640acac5355fd48d465cd51e5386a41e99f1e85c Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 05:57:41 +0000 Subject: [PATCH 3/8] missing quant info --- packages/core/src/types/prompt_template.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/types/prompt_template.d.ts b/packages/core/src/types/prompt_template.d.ts index 25d3c0dde6..ab6c69f87f 100644 --- a/packages/core/src/types/prompt_template.d.ts +++ b/packages/core/src/types/prompt_template.d.ts @@ -152,7 +152,7 @@ type ModelType = OptionsOrString< | "google:gemini-1.5-pro" | "google:gemini-1.5-pro-002" | "google:gemini-1-pro" - | "transformers:onnx-community/Qwen2.5-0.5B-Instruct" + | "transformers:onnx-community/Qwen2.5-0.5B-Instruct:q4" > type ModelSmallType = OptionsOrString< From be9459a687515f495b320349d607caf58f069000 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 06:04:45 +0000 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20=F0=9F=94=84=20Update=20text=20join?= =?UTF-8?q?ing=20and=20add=20poem=20prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/transformers.ts | 2 +- packages/sample/genaisrc/transformers.genai.mjs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/core/src/transformers.ts b/packages/core/src/transformers.ts index d4b4bcd4ca..fe2764b31d 100644 --- a/packages/core/src/transformers.ts +++ b/packages/core/src/transformers.ts @@ -74,7 +74,7 @@ export const TransformersCompletion: ChatCompletionHandler = async ( )) as TextGenerationOutput const text = output .map((msg) => (msg.generated_text.at(-1) as Message).content) - .join("\n") + .join("") trace.fence(text, "markdown") partialCb?.({ responseSoFar: text, diff --git a/packages/sample/genaisrc/transformers.genai.mjs b/packages/sample/genaisrc/transformers.genai.mjs index 652ce2cbd3..606e137fbd 100644 --- a/packages/sample/genaisrc/transformers.genai.mjs +++ b/packages/sample/genaisrc/transformers.genai.mjs @@ -1,4 +1,13 @@ script({ model: "transformers:onnx-community/Qwen2.5-Coder-0.5B-Instruct:q4", }) + +const res = await runPrompt( + (ctx) => { + ctx.$`Write a poem in python.` + }, + { + model: "transformers:onnx-community/Qwen2.5-Coder-0.5B-Instruct:q4", + } +) $`Write a poem with 2 paragraphs.` From c57ac4a500896da225ed95f4155bb0d833edcbb8 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 06:17:59 +0000 Subject: [PATCH 5/8] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20add=20Hugging?= =?UTF-8?q?=20Face=20Transformer.js=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/getting-started/configuration.mdx | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/src/content/docs/getting-started/configuration.mdx b/docs/src/content/docs/getting-started/configuration.mdx index 01584dac55..496733ba40 100644 --- a/docs/src/content/docs/getting-started/configuration.mdx +++ b/docs/src/content/docs/getting-started/configuration.mdx @@ -1059,6 +1059,27 @@ OPENROUTER_SITE_URL=... # populates HTTP-Referer header OPENROUTER_SITE_NAME=... # populate X-Title header ``` +## Hugging Face Transformer.js (experimental) + +This `transformers` provider runs models on device using [Hugging Face Transformers.js](https://huggingface.co/docs/transformers.js/index). + +The model syntax is `transformers::` where + +- `repo` is the model repository on Hugging Face, +- [`dtype`](https://huggingface.co/docs/transformers.js/guides/dtypes) is the quantization type. + +```js "transformers:" +script({ + model: "transformers:onnx-community/Qwen2.5-Coder-0.5B-Instruct:q4", +}) +``` + +:::note + +This provider is experimental and may not work with all models. + +::: + ## Model specific environment variables You can provide different environment variables From 8128ce396742d6e2597d19136c127976d3c37716 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 06:23:54 +0000 Subject: [PATCH 6/8] updated yarn.lock --- THIRD_PARTY_LICENSES.md | 1063 ++++++++++++++++++++++++++++++++++++++- docs/yarn.lock | 6 +- slides/yarn.lock | 6 +- yarn.lock | 6 +- 4 files changed, 1060 insertions(+), 21 deletions(-) diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index a8e235d389..e452edbadb 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -186,6 +186,218 @@ Apache License ----------- +The following npm packages may be included in this product: + + - @huggingface/transformers@3.0.2 + - flatbuffers@1.12.0 + - long@5.2.3 + +These packages each contain the following license: + +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +----------- + The following npm package may be included in this product: - @balena/dockerignore@1.0.2 @@ -1702,7 +1914,7 @@ MIT License The following npm package may be included in this product: - - genaiscript-vscode@1.76.2 + - genaiscript-vscode@1.77.3 This package contains the following license: @@ -2111,6 +2323,134 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ----------- +The following npm package may be included in this product: + + - path-scurry@1.11.1 + +This package contains the following license: + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** + +----------- + +The following npm package may be included in this product: + + - jackspeak@3.4.3 + +This package contains the following license: + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** + +----------- + The following npm package may be included in this product: - axios@1.7.7 @@ -2250,6 +2590,80 @@ The above copyright notice and this permission notice shall be included in all c ----------- +The following npm packages may be included in this product: + + - chownr@3.0.0 + - package-json-from-dist@1.0.1 + - yallist@5.0.0 + +These packages each contain the following license: + +All packages under `src/` are licensed according to the terms in +their respective `LICENSE` or `LICENSE.md` files. + +The remainder of this project is licensed under the Blue Oak +Model License, as follows: + +----- + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** + +----------- + The following npm package may be included in this product: - tunnel-agent@0.6.0 @@ -2524,6 +2938,206 @@ Apache License ----------- +The following npm package may be included in this product: + + - sharp@0.33.5 + +This package contains the following license: + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +----------- + The following npm package may be included in this product: - typescript@5.6.3 @@ -2721,6 +3335,35 @@ THE SOFTWARE. ----------- +The following npm package may be included in this product: + + - color-string@1.9.1 + +This package contains the following license: + +Copyright (c) 2011 Heather Arthur + +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. + +----------- + The following npm package may be included in this product: - asn1@0.2.6 @@ -2813,6 +3456,36 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------- +The following npm package may be included in this product: + + - mkdirp@3.0.1 + +This package contains the following license: + +Copyright (c) 2011-2023 James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me) + +This project is free software released under the MIT license: + +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. + +----------- + The following npm package may be included in this product: - setimmediate@1.0.5 @@ -2926,6 +3599,35 @@ Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors ----------- +The following npm package may be included in this product: + + - color@4.2.3 + +This package contains the following license: + +Copyright (c) 2012 Heather Arthur + +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. + +----------- + The following npm packages may be included in this product: - jwa@1.4.1 @@ -3269,11 +3971,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------- -The following npm package may be included in this product: +The following npm packages may be included in this product: + - @isaacs/cliui@8.0.2 - cliui@8.0.1 -This package contains the following license: +These packages each contain the following license: Copyright (c) 2015, Contributors @@ -3415,6 +4118,50 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----------- +The following npm packages may be included in this product: + + - @protobufjs/aspromise@1.1.2 + - @protobufjs/base64@1.1.2 + - @protobufjs/codegen@2.0.4 + - @protobufjs/eventemitter@1.1.0 + - @protobufjs/fetch@1.1.0 + - @protobufjs/float@1.0.2 + - @protobufjs/inquire@1.1.0 + - @protobufjs/path@1.1.2 + - @protobufjs/pool@1.1.0 + - @protobufjs/utf8@1.1.0 + +These packages each contain the following license: + +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +----------- + The following npm package may be included in this product: - strtok3@6.3.0 @@ -3777,6 +4524,36 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------- +The following npm package may be included in this product: + + - platform@1.3.6 + +This package contains the following license: + +Copyright 2014-2020 Benjamin Tan +Copyright 2011-2013 John-David Dalton + +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. + +----------- + The following npm package may be included in this product: - follow-redirects@1.15.9 @@ -3977,11 +4754,12 @@ terms above. ----------- -The following npm package may be included in this product: +The following npm packages may be included in this product: - emoji-regex@8.0.0 + - emoji-regex@9.2.2 -This package contains the following license: +These packages each contain the following license: Copyright Mathias Bynens @@ -4067,6 +4845,7 @@ https://github.com/mscdex/cpu-features/raw/master/LICENSE The following npm packages may be included in this product: - boolbase@1.0.0 + - guid-typescript@1.0.9 - split-ca@1.0.1 These packages each contain the following license: @@ -4821,6 +5600,41 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ----------- +The following npm package may be included in this product: + + - minizlib@3.0.1 + +This package contains the following license: + +Minizlib was created by Isaac Z. Schlueter. +It is a derivative work of the Node.js project. + +""" +Copyright (c) 2017-2023 Isaac Z. Schlueter and Contributors +Copyright (c) 2017-2023 Node.js contributors. All rights reserved. +Copyright (c) 2017-2023 Joyent, Inc. and other Node contributors. All rights reserved. + +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. +""" + +----------- + The following npm package may be included in this product: - minizlib@2.1.2 @@ -4862,14 +5676,19 @@ The following npm packages may be included in this product: - @tokenizer/token@0.3.0 - agent-base@6.0.2 - canvas@3.0.0-rc2 - - genaiscript-core-internal@1.76.2 - - genaiscript-sample@1.76.2 - - genaiscript@1.76.2 + - eastasianwidth@0.2.0 + - genaiscript-core-internal@1.77.3 + - genaiscript-sample@1.77.3 + - genaiscript@1.77.3 - https-proxy-agent@5.0.1 - isarray@1.0.0 - javascript-natural-sort@0.7.1 - keyv@4.5.4 - omggif@1.0.10 + - onnxruntime-common@1.19.2 + - onnxruntime-common@1.20.0-dev.20241016-2b8fc5529b + - onnxruntime-node@1.19.2 + - onnxruntime-web@1.21.0-dev.20241024-d9ca84ef96 - parse-bmfont-ascii@1.0.6 - readable-web-to-node-stream@3.0.2 - seedrandom@3.0.5 @@ -5694,6 +6513,36 @@ SOFTWARE. ----------- +The following npm package may be included in this product: + + - @huggingface/jinja@0.3.2 + +This package contains the following license: + +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. + +----------- + The following npm package may be included in this product: - @lvce-editor/ripgrep@1.4.0 @@ -5949,6 +6798,8 @@ The following npm packages may be included in this product: - @sindresorhus/is@7.0.1 - @sindresorhus/merge-streams@4.0.0 - ansi-escapes@4.3.2 + - ansi-regex@6.1.0 + - ansi-styles@6.2.1 - crypto-random-string@4.0.0 - decompress-response@6.0.0 - execa@9.5.1 @@ -5974,6 +6825,8 @@ The following npm packages may be included in this product: - path-exists@5.0.0 - path-key@4.0.0 - pretty-ms@9.2.0 + - string-width@5.1.2 + - strip-ansi@7.1.0 - strip-final-newline@4.0.0 - temp-dir@3.0.0 - tempy@3.1.0 @@ -5982,6 +6835,7 @@ The following npm packages may be included in this product: - unicorn-magic@0.3.0 - unique-string@3.0.0 - wrap-ansi@7.0.0 + - wrap-ansi@8.1.0 - xdg-basedir@5.1.0 - yoctocolors-cjs@2.1.2 - yoctocolors@2.1.1 @@ -6562,6 +7416,54 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----------- +The following npm package may be included in this product: + + - glob@10.4.5 + +This package contains the following license: + +The ISC License + +Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors + +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. + +----------- + +The following npm package may be included in this product: + + - lru-cache@10.4.3 + +This package contains the following license: + +The ISC License + +Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors + +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. + +----------- + The following npm package may be included in this product: - sax@1.4.1 @@ -6636,11 +7538,13 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----------- -The following npm package may be included in this product: +The following npm packages may be included in this product: - minimatch@5.1.6 + - minimatch@9.0.5 + - rimraf@5.0.10 -This package contains the following license: +These packages each contain the following license: The ISC License @@ -6685,6 +7589,30 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----------- +The following npm package may be included in this product: + + - foreground-child@3.3.0 + +This package contains the following license: + +The ISC License + +Copyright (c) 2015-2023 Isaac Z. Schlueter and Contributors + +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. + +----------- + The following npm package may be included in this product: - signal-exit@3.0.7 @@ -6734,11 +7662,12 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----------- -The following npm package may be included in this product: +The following npm packages may be included in this product: - minipass@5.0.0 + - minipass@7.1.2 -This package contains the following license: +These packages each contain the following license: The ISC License @@ -6808,6 +7737,7 @@ PERFORMANCE OF THIS SOFTWARE. The following npm packages may be included in this product: + - @isaacs/fs-minipass@4.0.1 - chownr@1.1.4 - chownr@2.0.0 - color-support@1.1.3 @@ -6823,6 +7753,7 @@ The following npm packages may be included in this product: - semver@6.3.1 - semver@7.6.3 - tar@6.2.1 + - tar@7.4.3 - which@2.0.2 - wrappy@1.0.2 - yallist@4.0.0 @@ -7682,6 +8613,66 @@ SOFTWARE. ----------- +The following npm package may be included in this product: + + - is-arrayish@0.3.2 + +This package contains the following license: + +The MIT License (MIT) + +Copyright (c) 2015 JD Ballard + +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. + +----------- + +The following npm package may be included in this product: + + - simple-swizzle@0.2.2 + +This package contains the following license: + +The MIT License (MIT) + +Copyright (c) 2015 Josh Junon + +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. + +----------- + The following npm package may be included in this product: - any-base@1.1.0 @@ -8633,6 +9624,54 @@ For more information, please refer to ----------- +The following npm package may be included in this product: + + - protobufjs@7.4.0 + +This package contains the following license: + +This license applies to all parts of protobuf.js except those files +either explicitly including or referencing a different license or +located in a directory containing a different LICENSE file. + +--- + +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +Code generated by the command line utilities is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + +----------- + The following npm package may be included in this product: - abbrev@1.1.1 diff --git a/docs/yarn.lock b/docs/yarn.lock index 0cad71a0f8..e63848d922 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -2260,9 +2260,9 @@ dset@^3.1.3, dset@^3.1.4: integrity sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA== electron-to-chromium@^1.5.41: - version "1.5.63" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.63.tgz#69444d592fbbe628d129866c2355691ea93eda3e" - integrity sha512-ddeXKuY9BHo/mw145axlyWjlJ1UBt4WK3AlvkT7W2AbqfRQoacVoRUCF6wL3uIx/8wT9oLKXzI+rFqHHscByaA== + version "1.5.64" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.64.tgz#ac8c4c89075d35a1514b620f47dfe48a71ec3697" + integrity sha512-IXEuxU+5ClW2IGEYFC2T7szbyVgehupCWQe5GNh+H065CD6U6IFN0s4KeAMFGNmQolRU4IV7zGBWSYMmZ8uuqQ== emmet@^2.4.3: version "2.4.11" diff --git a/slides/yarn.lock b/slides/yarn.lock index ce1f238e10..feddf3dff3 100644 --- a/slides/yarn.lock +++ b/slides/yarn.lock @@ -2770,9 +2770,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.5.41: - version "1.5.63" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.63.tgz#69444d592fbbe628d129866c2355691ea93eda3e" - integrity sha512-ddeXKuY9BHo/mw145axlyWjlJ1UBt4WK3AlvkT7W2AbqfRQoacVoRUCF6wL3uIx/8wT9oLKXzI+rFqHHscByaA== + version "1.5.64" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.64.tgz#ac8c4c89075d35a1514b620f47dfe48a71ec3697" + integrity sha512-IXEuxU+5ClW2IGEYFC2T7szbyVgehupCWQe5GNh+H065CD6U6IFN0s4KeAMFGNmQolRU4IV7zGBWSYMmZ8uuqQ== emoji-regex-xs@^1.0.0: version "1.0.0" diff --git a/yarn.lock b/yarn.lock index 856be5a967..bcec1ba71b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4209,9 +4209,9 @@ minipass@^5.0.0: integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== minisearch@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/minisearch/-/minisearch-7.1.0.tgz#f5830e9109b5919ee7b291c29a304f381aa68770" - integrity sha512-tv7c/uefWdEhcu6hvrfTihflgeEi2tN6VV7HJnCjK6VxM75QQJh4t9FwJCsA2EsRS8LCnu3W87CuGPWMocOLCA== + version "7.1.1" + resolved "https://registry.yarnpkg.com/minisearch/-/minisearch-7.1.1.tgz#901d0367f078233cdc7a10be7264e09c6248cf5f" + integrity sha512-b3YZEYCEH4EdCAtYP7OlDyx7FdPwNzuNwLQ34SfJpM9dlbBZzeXndGavTrC+VCiRWomL21SWfMc6SCKO/U2ZNw== minizlib@^2.1.1: version "2.1.2" From 26482c49afe453cd56d45883f892eb0b256fa98c Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 13:55:43 +0000 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20add=20caching=20and=20improve=20gen?= =?UTF-8?q?erator=20handling=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/transformers.ts | 148 ++++++++++++++++++++---------- 1 file changed, 101 insertions(+), 47 deletions(-) diff --git a/packages/core/src/transformers.ts b/packages/core/src/transformers.ts index fe2764b31d..fee9ffd9cb 100644 --- a/packages/core/src/transformers.ts +++ b/packages/core/src/transformers.ts @@ -5,12 +5,19 @@ import type { Chat, Message, TextGenerationOutput, + TextGenerationPipeline, } from "@huggingface/transformers" import { NotSupportedError } from "./error" import { ChatCompletionMessageParam, ChatCompletionResponse } from "./chattypes" import { deleteUndefinedValues, dotGenaiscriptPath, logVerbose } from "./util" import { parseModelIdentifier } from "./models" import prettyBytes from "pretty-bytes" +import { hash } from "./crypto" +import { + ChatCompletionRequestCacheKey, + getChatCompletionCache, +} from "./chatcache" +import { PLimitPromiseQueue } from "./concurrency" type GeneratorProgress = | { @@ -24,20 +31,46 @@ type GeneratorProgress = loaded: number total: number } + | { status: "ready"; task: string; model: string } function progressBar() { const progress: Record = {} return (cb: GeneratorProgress) => { - if (cb.status !== "progress") return - const p = progress[cb.file] || 0 - const cp = Math.floor(cb.progress) - if (cp > p) { - progress[cb.file] = cp - logVerbose(`${cb.file}: ${cp}% (${prettyBytes(cb.loaded)})`) + switch (cb.status) { + case "progress": + const p = progress[cb.file] || 0 + const cp = Math.floor(cb.progress) + if (cp > p + 5) { + progress[cb.file] = cp + logVerbose(`${cb.file}: ${cp}% (${prettyBytes(cb.loaded)})`) + } + break + case "ready": { + logVerbose(`model ${cb.model} ready`) + logVerbose(``) + break + } } } } +const generators: Record> = {} +const generationQueue = new PLimitPromiseQueue(1) + +async function loadGenerator(family: string, options: object) { + const h = await hash({ family, options }) + let p = generators[h] + if (!p) { + const { pipeline } = await import("@huggingface/transformers") + p = generators[h] = pipeline("text-generation", family, { + ...options, + cache_dir: dotGenaiscriptPath("cache", "transformers"), + progress_callback: progressBar(), + }) + } + return p +} + export const TransformersCompletion: ChatCompletionHandler = async ( req, cfg, @@ -45,53 +78,74 @@ export const TransformersCompletion: ChatCompletionHandler = async ( trace ) => { const { messages, temperature, top_p, max_tokens } = req - const { partialCb, inner } = options + const { partialCb, inner, cache: cacheOrName, cacheName } = options const { model, tag, family } = parseModelIdentifier(req.model) - try { - trace.startDetails(`transformer`) - trace.itemValue("model", model) - const { pipeline } = await import("@huggingface/transformers") - // Create a text generation pipeline - const generator = await pipeline("text-generation", family, { - dtype: tag as any, - cache_dir: dotGenaiscriptPath("cache", "transformers"), - progress_callback: progressBar(), - device: "cpu", - }) - logVerbose(`transformers model ${model} loaded`) - logVerbose(``) - const msgs: Chat = chatMessagesToTranformerMessages(messages) - trace.detailsFenced("messages", msgs, "yaml") - const output = (await generator( - msgs, - deleteUndefinedValues({ - max_new_tokens: max_tokens || 4000, - temperature, - top_p, - early_stopping: true, - }) - )) as TextGenerationOutput - const text = output - .map((msg) => (msg.generated_text.at(-1) as Message).content) - .join("") - trace.fence(text, "markdown") + trace.itemValue("model", model) + + const cache = !!cacheOrName || !!cacheName + const cacheStore = getChatCompletionCache( + typeof cacheOrName === "string" ? cacheOrName : cacheName + ) + const cachedKey = cache + ? { + ...req, + model: req.model, + temperature: req.temperature, + top_p: req.top_p, + max_tokens: req.max_tokens, + logit_bias: req.logit_bias, + } + : undefined + trace.itemValue(`caching`, cache) + trace.itemValue(`cache`, cacheStore?.name) + const { text: cached, finishReason: cachedFinishReason } = + (await cacheStore.get(cachedKey)) || {} + if (cached !== undefined) { partialCb?.({ - responseSoFar: text, - responseChunk: text, - tokensSoFar: 0, + tokensSoFar: 0, // TODO + responseSoFar: cached, + responseChunk: cached, inner, }) - return { - text, - finishReason: "stop", - } satisfies ChatCompletionResponse - } catch (e) { - logVerbose(e) - throw e - } finally { - trace.endDetails() + trace.itemValue(`cache hit`, await cacheStore.getKeySHA(cachedKey)) + return { text: cached, finishReason: cachedFinishReason, cached: true } } + + const generator = await generationQueue.add(() => loadGenerator(family, { + dtype: tag, + device: "cpu", + })) + const msgs: Chat = chatMessagesToTranformerMessages(messages) + trace.detailsFenced("messages", msgs, "yaml") + const output = (await generator( + msgs, + deleteUndefinedValues({ + max_new_tokens: max_tokens || 4000, + temperature, + top_p, + early_stopping: true, + }) + )) as TextGenerationOutput + const text = output + .map((msg) => (msg.generated_text.at(-1) as Message).content) + .join("") + trace.fence(text, "markdown") + partialCb?.({ + responseSoFar: text, + responseChunk: text, + tokensSoFar: 0, + inner, + }) + + const finishReason = "stop" + if (finishReason === "stop") + await cacheStore.set(cachedKey, { text, finishReason }) + + return { + text, + finishReason: "stop", + } satisfies ChatCompletionResponse } // Define the Ollama model with its completion handler and model listing function From a0cf652227c26b3fa75f7b4dc74f053e725634f0 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 22 Nov 2024 13:59:03 +0000 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=F0=9F=8C=9F=20add=20poem=20generat?= =?UTF-8?q?ion=20in=20TypeScript=20using=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sample/genaisrc/transformers.genai.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/sample/genaisrc/transformers.genai.mjs b/packages/sample/genaisrc/transformers.genai.mjs index 606e137fbd..fabbaf28e3 100644 --- a/packages/sample/genaisrc/transformers.genai.mjs +++ b/packages/sample/genaisrc/transformers.genai.mjs @@ -10,4 +10,13 @@ const res = await runPrompt( model: "transformers:onnx-community/Qwen2.5-Coder-0.5B-Instruct:q4", } ) +const res2 = await runPrompt( + (ctx) => { + ctx.$`Write a poem in typescript.` + }, + { + cache: "trfs", + model: "transformers:onnx-community/Qwen2.5-Coder-0.5B-Instruct:q4", + } +) $`Write a poem with 2 paragraphs.`