Update examples/common.cpp

This commit is contained in:
Georgi Gerganov 2023-07-23 16:32:03 +03:00 committed by GitHub
parent ad9c9be5d2
commit 94a3e568de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,8 +117,9 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
break;
}
params.n_threads = std::stoi(argv[i]);
if (params.n_threads <= 0)
if (params.n_threads <= 0) {
params.n_threads = std::thread::hardware_concurrency();
}
} else if (arg == "-p" || arg == "--prompt") {
if (++i >= argc) {
invalid_param = true;