llmodel: skip attempting Metal if model+kvcache > 53% of system ram

This commit is contained in:
Aaron Miller
2023-06-26 14:53:17 -07:00
committed by AT
parent 57fa8644d6
commit db34a2f670
2 changed files with 17 additions and 1 deletions

View File

@@ -178,7 +178,9 @@ int32_t LLamaModel::threadCount() const {
LLamaModel::~LLamaModel()
{
llama_free(d_ptr->ctx);
if(d_ptr->ctx) {
llama_free(d_ptr->ctx);
}
}
bool LLamaModel::isModelLoaded() const