fix download condition

This commit is contained in:
Thien Tran 2025-05-30 10:17:07 +08:00 committed by Louis
parent f32ae402d5
commit 494a47aaa5
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -98,22 +98,22 @@ export async function downloadBackend(backend: string, version: string): Promise
]
// also download CUDA runtime + cuBLAS + cuBLASLt if needed
if (backend.includes('cu11.7') && (await _isCudaInstalled('11.7'))) {
if (backend.includes('cu11.7') && !(await _isCudaInstalled('11.7'))) {
downloadItems.push({
url: `https://github.com/menloresearch/llama.cpp/releases/download/${version}/cudart-llama-bin-linux-cu11.7-x64.tar.gz`,
save_path: await joinPath([llamacppPath, 'lib', 'cuda.tar.gz']),
save_path: await joinPath([llamacppPath, 'lib', 'cuda11.tar.gz']),
})
} else if (backend.includes('cu12.0') && (await _isCudaInstalled('12.0'))) {
} else if (backend.includes('cu12.0') && !(await _isCudaInstalled('12.0'))) {
downloadItems.push({
url: `https://github.com/menloresearch/llama.cpp/releases/download/${version}/cudart-llama-bin-linux-cu12.0-x64.tar.gz`,
save_path: await joinPath([llamacppPath, 'lib', 'cuda.tar.gz']),
save_path: await joinPath([llamacppPath, 'lib', 'cuda12.tar.gz']),
})
}
const taskId = `llamacpp-${version}-${backend}`.replace(/\./g, '-')
const downloadType = 'Engine'
console.log(`Downloading backend ${backend} version ${version}: ${downloadItems}`)
console.log(`Downloading backend ${backend} version ${version}: ${JSON.stringify(downloadItems)}`)
let downloadCompleted = false
try {
const onProgress = (transferred: number, total: number) => {