Fix guaranteed YAML::InvalidNode when compiled with COMPILE_CPU=Off (#944)

This commit is contained in:
Jelmer 2022-09-02 12:25:42 +01:00 committed by GitHub
parent bf5eafab0c
commit 7d654603bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,8 +54,10 @@ void ConfigValidator::validateOptionsTranslation() const {
ABORT_IF(models.empty() && configs.empty(),
"You need to provide at least one model file or a config file");
#ifdef COMPILE_CPU
ABORT_IF(get<bool>("model-mmap") && get<size_t>("cpu-threads") == 0,
"Model MMAP is CPU-only, please use --cpu-threads");
#endif
for(const auto& modelFile : models) {
filesystem::Path modelPath(modelFile);