Fix crash with chatgpt and gpu layers.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
Adam Treat
2024-02-22 12:51:44 -05:00
committed by AT
parent e7f2ff189f
commit ef518fae3e
2 changed files with 17 additions and 16 deletions

View File

@@ -135,6 +135,7 @@ void ModelInfo::setGpuLayers(int l)
int ModelInfo::maxGpuLayers() const
{
if (isOnline) return -1;
if (m_maxGpuLayers != -1) return m_maxGpuLayers;
auto path = (dirpath + filename()).toStdString();
int layers = LLModel::Implementation::layerCount(path);