From 9462a83ca54d1c2c31c932115b2d0015b4acd9b6 Mon Sep 17 00:00:00 2001 From: Gilad S Date: Mon, 30 Sep 2024 00:58:36 +0300 Subject: [PATCH] docs: improve terminology --- docs/cli/pull.md | 2 ++ docs/guide/choosing-a-model.md | 4 ++++ docs/guide/downloading-models.md | 2 +- src/cli/commands/PullCommand.ts | 22 +++++++++++----------- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/cli/pull.md b/docs/cli/pull.md index 2d79760a..607ffa6e 100644 --- a/docs/cli/pull.md +++ b/docs/cli/pull.md @@ -21,6 +21,8 @@ The supported URI schemes are: - **HTTP:** `https://`, `http://` - **Hugging Face:** `hf://#` (`#` is optional) +Learn more about using model URIs in the [Downloading Models guide](../guide/downloading-models.md#model-uris). + > To programmatically download a model file in your code, use [`createModelDownloader()`](../api/functions/createModelDownloader.md) ## Usage diff --git a/docs/guide/choosing-a-model.md b/docs/guide/choosing-a-model.md index 9740b23b..d1a4891a 100644 --- a/docs/guide/choosing-a-model.md +++ b/docs/guide/choosing-a-model.md @@ -164,3 +164,7 @@ npx --no node-llama-cpp pull --dir ./models > > If the model file URL is of a single part of a multi-part model (for example, [this model](https://huggingface.co/bartowski/Meta-Llama-3-70B-Instruct-GGUF/blob/main/Meta-Llama-3-70B-Instruct-Q5_K_L.gguf/Meta-Llama-3-70B-Instruct-Q5_K_L-00001-of-00002.gguf)), > it will also download all the other parts as well into the same directory. + +::: tip +Consider using [model URIs](./downloading-models.md#model-uris) to download and load models. +::: diff --git a/docs/guide/downloading-models.md b/docs/guide/downloading-models.md index 01978507..1a112b49 100644 --- a/docs/guide/downloading-models.md +++ b/docs/guide/downloading-models.md @@ -78,7 +78,7 @@ To reference a model from Hugging Face, you can use the scheme
`hf://#` (`#` is optional). -Here's an example usage of the Hugging Face scheme: +Here's an example usage of the Hugging Face URI scheme: ``` hf:mradermacher/Meta-Llama-3.1-8B-Instruct-GGUF/Meta-Llama-3.1-8B-Instruct.Q4_K_M.gguf ``` diff --git a/src/cli/commands/PullCommand.ts b/src/cli/commands/PullCommand.ts index 53bea83d..567e3c6b 100644 --- a/src/cli/commands/PullCommand.ts +++ b/src/cli/commands/PullCommand.ts @@ -11,7 +11,7 @@ import {resolveHeaderFlag} from "../utils/resolveHeaderFlag.js"; import {withCliCommandDescriptionDocsUrl} from "../utils/withCliCommandDescriptionDocsUrl.js"; type PullCommand = { - uris: string[], + urls: string[], header?: string[], override: boolean, noProgress: boolean, @@ -22,19 +22,19 @@ type PullCommand = { }; export const PullCommand: CommandModule = { - command: "pull [uris..]", + command: "pull [urls..]", aliases: ["get"], describe: withCliCommandDescriptionDocsUrl( - "Download models from URIs", + "Download models from URLs", documentationPageUrls.CLI.Pull ), builder(yargs) { const isInDocumentationMode = getIsInDocumentationMode(); return yargs - .option("uris", { + .option("urls", { type: "string", - alias: ["uri", "urls", "url"], + alias: ["url", "uris", "uri"], array: true, description: [ "A `.gguf` model URI to pull.", @@ -100,17 +100,17 @@ export const PullCommand: CommandModule = { group: "Optional:" }); }, - async handler({uris, header: headerArg, override, noProgress, noTempFile, directory, filename, parallel}: PullCommand) { + async handler({urls, header: headerArg, override, noProgress, noTempFile, directory, filename, parallel}: PullCommand) { const headers = resolveHeaderFlag(headerArg); - if (uris.length === 0) + if (urls.length === 0) throw new Error("At least one URI must be provided"); - else if (uris.length > 1 && filename != null) + else if (urls.length > 1 && filename != null) throw new Error("The `--filename` flag can only be used when a single URI is passed"); - if (uris.length === 1) { + if (urls.length === 1) { const downloader = await createModelDownloader({ - modelUri: uris[0]!, + modelUri: urls[0]!, dirPath: directory, headers, showCliProgress: !noProgress, @@ -155,7 +155,7 @@ export const PullCommand: CommandModule = { console.info(`Downloaded to ${chalk.yellow(getReadablePath(downloader.entrypointFilePath))}`); } else { const downloader = await combineModelDownloaders( - uris.map((uri) => createModelDownloader({ + urls.map((uri) => createModelDownloader({ modelUri: uri, dirPath: directory, headers,