Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 2dc4733

Browse files
chore: add log downloading model (#936)
1 parent ceb23ed commit 2dc4733

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cortex-js/src/infrastructure/commanders/models/model-pull.command.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { BaseCommand } from '../base.command';
1818
import { downloadProgress } from '@/utils/download-progress';
1919
import { CortexClient } from '../services/cortex.client';
2020
import { DownloadType } from '@/domain/models/download.interface';
21+
import ora from 'ora';
2122

2223
@SubCommand({
2324
name: 'pull',
@@ -52,13 +53,16 @@ export class ModelPullCommand extends BaseCommand {
5253
exit(1);
5354
}
5455

56+
console.log('Downloading model...');
5557
await this.cortex.models.download(modelId).catch((e: Error) => {
5658
if (e instanceof ModelNotFoundException)
5759
console.error('Model does not exist.');
5860
else console.error(e.message ?? e);
5961
exit(1);
6062
});
6163

64+
ora().succeed('Model downloaded');
65+
6266
await downloadProgress(this.cortex, modelId);
6367

6468
const existingModel = await this.cortex.models.retrieve(modelId);

cortex-js/src/infrastructure/commanders/run.command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ export class RunCommand extends BaseCommand {
6262
if (!(await this.cortex.models.retrieve(modelId))) {
6363
checkingSpinner.succeed();
6464

65+
console.log('Downloading model...');
6566
await this.cortex.models.download(modelId).catch((e: Error) => {
6667
checkingSpinner.fail(e.message ?? e);
6768
exit(1);
6869
});
6970
await downloadProgress(this.cortex, modelId);
7071
}
72+
ora().succeed('Model downloaded');
7173

7274
// Second check if model is available
7375
const existingModel = await this.cortex.models.retrieve(modelId);

0 commit comments

Comments
 (0)