Add thread count setting

This commit is contained in:
Aaron Miller
2023-04-18 06:46:03 -07:00
committed by AT
parent 169afbdc80
commit 00cb5fe2a5
6 changed files with 78 additions and 8 deletions

View File

@@ -659,6 +659,14 @@ bool GPTJ::loadModel(const std::string &modelPath, std::istream &fin) {
return true;
}
void GPTJ::setThreadCount(int32_t n_threads) {
d_ptr->n_threads = n_threads;
}
int32_t GPTJ::threadCount() {
return d_ptr->n_threads;
}
GPTJ::~GPTJ()
{
ggml_free(d_ptr->model.ctx);