Skip to content

Commit

Permalink
docs: improve terminology
Browse files Browse the repository at this point in the history
  • Loading branch information
giladgd committed Sep 29, 2024
1 parent 3a85c2c commit 9462a83
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions docs/cli/pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ The supported URI schemes are:
- **HTTP:** `https://`, `http://`
- **Hugging Face:** `hf:<user>/<model>/<file-path>#<branch>` (`#<branch>` 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
Expand Down
4 changes: 4 additions & 0 deletions docs/guide/choosing-a-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,7 @@ npx --no node-llama-cpp pull --dir ./models <model-file-url>
>
> 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.
:::
2 changes: 1 addition & 1 deletion docs/guide/downloading-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ To reference a model from Hugging Face, you can use the scheme
<br/>
`hf:<user>/<model>/<file-path>#<branch>` (`#<branch>` 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
```
Expand Down
22 changes: 11 additions & 11 deletions src/cli/commands/PullCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -22,19 +22,19 @@ type PullCommand = {
};

export const PullCommand: CommandModule<object, PullCommand> = {
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.",
Expand Down Expand Up @@ -100,17 +100,17 @@ export const PullCommand: CommandModule<object, PullCommand> = {
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,
Expand Down Expand Up @@ -155,7 +155,7 @@ export const PullCommand: CommandModule<object, PullCommand> = {
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,
Expand Down

0 comments on commit 9462a83

Please sign in to comment.