@@ -4,7 +4,8 @@ import {Octokit} from "octokit";
4
4
import fs from "fs-extra" ;
5
5
import chalk from "chalk" ;
6
6
import {
7
- defaultLlamaCppCudaSupport , defaultLlamaCppGitHubRepo , defaultLlamaCppMetalSupport , defaultLlamaCppRelease , isCI , llamaCppDirectory
7
+ defaultLlamaCppCudaSupport , defaultLlamaCppGitHubRepo , defaultLlamaCppMetalSupport , defaultLlamaCppRelease , isCI ,
8
+ llamaCppDirectory , llamaCppDirectoryTagFilePath
8
9
} from "../../config.js" ;
9
10
import { compileLlamaCpp } from "../../utils/compileLLamaCpp.js" ;
10
11
import withOra from "../../utils/withOra.js" ;
@@ -20,14 +21,16 @@ import {
20
21
import { cloneLlamaCppRepo } from "../../utils/cloneLlamaCppRepo.js" ;
21
22
22
23
type DownloadCommandArgs = {
23
- repo : string ,
24
- release : "latest" | string ,
24
+ repo ? : string ,
25
+ release ? : "latest" | string ,
25
26
arch ?: string ,
26
27
nodeTarget ?: string ,
27
- metal : boolean ,
28
- cuda : boolean ,
28
+ metal ? : boolean ,
29
+ cuda ? : boolean ,
29
30
skipBuild ?: boolean ,
30
31
noBundle ?: boolean ,
32
+
33
+ /** @internal */
31
34
updateBinariesReleaseMetadataAndSaveGitBundle ?: boolean
32
35
} ;
33
36
@@ -92,7 +95,15 @@ export const DownloadCommand: CommandModule<object, DownloadCommandArgs> = {
92
95
} ;
93
96
94
97
export async function DownloadLlamaCppCommand ( {
95
- repo, release, arch, nodeTarget, metal, cuda, skipBuild, noBundle, updateBinariesReleaseMetadataAndSaveGitBundle
98
+ repo = defaultLlamaCppGitHubRepo ,
99
+ release = defaultLlamaCppRelease ,
100
+ arch = undefined ,
101
+ nodeTarget = undefined ,
102
+ metal = defaultLlamaCppMetalSupport ,
103
+ cuda = defaultLlamaCppCudaSupport ,
104
+ skipBuild = false ,
105
+ noBundle = false ,
106
+ updateBinariesReleaseMetadataAndSaveGitBundle = false
96
107
} : DownloadCommandArgs ) {
97
108
const useBundle = noBundle != true ;
98
109
const octokit = new Octokit ( ) ;
@@ -162,6 +173,7 @@ export async function DownloadLlamaCppCommand({
162
173
fail : chalk . blue ( "Failed to remove existing llama.cpp directory" )
163
174
} , async ( ) => {
164
175
await fs . remove ( llamaCppDirectory ) ;
176
+ await fs . remove ( llamaCppDirectoryTagFilePath ) ;
165
177
} ) ;
166
178
167
179
console . log ( chalk . blue ( "Cloning llama.cpp" ) ) ;
0 commit comments