1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-08-17 06:00:33 +03:00

feat(scripts): add Apple Metal developer tools error hint on Apple Silicon for llama.cpp setup

This commit is contained in:
louistiti 2024-06-01 21:57:20 +08:00
parent f1c6db6053
commit e9f1aadc67
No known key found for this signature in database
GPG Key ID: 92CD6A2E497E1669

View File

@ -93,6 +93,8 @@ async function downloadLLM() {
}
async function downloadAndCompileLlamaCPP() {
const { type: osType, cpuArchitecture } = SystemHelper.getInformation()
try {
LogHelper.info(
`Downloading and compiling "${LLM_LLAMA_CPP_RELEASE_TAG}" llama.cpp release...`
@ -108,7 +110,6 @@ async function downloadAndCompileLlamaCPP() {
LogHelper.info(`Updating llama.cpp to ${LLM_LLAMA_CPP_RELEASE_TAG}...`)
}
const { type: osType, cpuArchitecture } = SystemHelper.getInformation()
let llamaCPPDownloadCommand = `npx --no node-llama-cpp download --release "${LLM_LLAMA_CPP_RELEASE_TAG}"`
if (
@ -144,6 +145,18 @@ async function downloadAndCompileLlamaCPP() {
}
} catch (e) {
LogHelper.error(`Failed to set up llama.cpp: ${e}`)
if (
osType === OSTypes.MacOS &&
cpuArchitecture === CPUArchitectures.ARM64
) {
LogHelper.error(
`Please verify that the Metal developer tools for macOS are installed.\n
You can verify by running the following command in your terminal: xcode-select --install\n
Otherwise download them here and retry: https://developer.apple.com/xcode/`
)
}
process.exit(1)
}
}