Skip to content

Commit

Permalink
feat(refresh): add hubUrl, verifyQuant, brainDir options to refresh b…
Browse files Browse the repository at this point in the history
…rain
  • Loading branch information
snowyu committed Aug 11, 2024
1 parent 88590c7 commit 85b0386
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ Specific script instruction manual see: [Programmable Prompt Engine Specificatio
* [`ai brain down [NAME]`](#ai-brain-down-name)
* [`ai brain download [NAME]`](#ai-brain-download-name)
* [`ai brain list [NAME]`](#ai-brain-list-name)
* [`ai brain refresh`](#ai-brain-refresh)
* [`ai brain search [NAME]`](#ai-brain-search-name)
* [`ai config [ITEM_NAME]`](#ai-config-item_name)
* [`ai config save [DATA]`](#ai-config-save-data)
Expand Down Expand Up @@ -550,6 +551,29 @@ ALIASES

_See code: [src/commands/brain/list.ts](https://github.com/offline-ai/cli/blob/v0.0.14/src/commands/brain/list.ts)_

## `ai brain refresh`

🔄 refresh online brains.

```
USAGE
$ ai brain refresh [--json] [-c <value>] [--banner]
FLAGS
-c, --config=<value> the config file
--[no-]banner show banner
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
🔄 refresh online brains.
refresh brain index from huggingface.co
```

_See code: [src/commands/brain/refresh.ts](https://github.com/offline-ai/cli/blob/v0.0.14/src/commands/brain/refresh.ts)_

## `ai brain search [NAME]`

📜 List downloaded or online brains, defaults to downloaded.
Expand Down
15 changes: 15 additions & 0 deletions src/oclif/commands/brain/refresh.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Flags } from '@oclif/core'
import { upgradeBrains } from '../../../lib/brain.js'
import { AICommand } from '../../lib/ai-command.js'
import { showBanner } from '../../lib/help.js'
Expand All @@ -6,6 +7,20 @@ export default class AIBrainRefreshCommand extends AICommand {
static summary = '🔄 refresh online brains.'

static description = 'refresh brain index from huggingface.co'
static flags = {
brainDir: Flags.directory({char: 'b', description: 'the brains(LLM) directory', exists: true}),
hubUrl: Flags.string({
char: 'u',
aliases: ['hub-url'],
description: 'the hub mirror url',
}),
verifyQuant: Flags.boolean({
char: 'v',
aliases: ['verify-quant'],
description: 'whether verify quant when refresh',
}),
}

async run(): Promise<any> {
const opts = await this.parse(AIBrainRefreshCommand)
const isJson = this.jsonEnabled()
Expand Down

0 comments on commit 85b0386

Please sign in to comment.