Skip to content

Commit e9becf5

Browse files
committed
useXet
1 parent 36d9d94 commit e9becf5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/hub/cli.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class UploadProgressManager {
1717
private fileBars: Map<string, SingleBar> = new Map();
1818
private readonly isQuiet: boolean;
1919
private cliProgressAvailable: boolean = false;
20-
private events: Array<CommitProgressEvent> = [];
2120

2221
constructor(isQuiet: boolean = false) {
2322
this.isQuiet = isQuiet;
@@ -53,7 +52,6 @@ class UploadProgressManager {
5352
} else if (event.event === "fileProgress") {
5453
this.updateFileProgress(event.path, event.progress, event.state);
5554
}
56-
this.events.push(event);
5755
}
5856

5957
private logPhase(phase: string): void {
@@ -211,6 +209,12 @@ const commands = {
211209
"The access token to use for authentication. If not provided, the HF_TOKEN environment variable will be used.",
212210
default: process.env.HF_TOKEN,
213211
},
212+
{
213+
name: "xet" as const,
214+
short: "x",
215+
description: "Use Xet to upload files",
216+
boolean: true,
217+
},
214218
] as const,
215219
} satisfies SingleCommand,
216220
branch: {
@@ -420,6 +424,7 @@ async function run() {
420424
commitMessage,
421425
pathInRepo,
422426
private: isPrivate,
427+
xet,
423428
} = parsedArgs;
424429

425430
const repoId = repoType ? { type: repoType as "model" | "dataset" | "space", name: repoName } : repoName;
@@ -460,6 +465,7 @@ async function run() {
460465
commitTitle: commitMessage?.trim().split("\n")[0],
461466
commitDescription: commitMessage?.trim().split("\n").slice(1).join("\n").trim(),
462467
hubUrl: process.env.HF_ENDPOINT ?? HUB_URL,
468+
useXet: xet ?? false,
463469
})) {
464470
progressManager.handleEvent(event);
465471
}

0 commit comments

Comments
 (0)