Fix up model names that don't begin with 'ggml-'

This commit is contained in:
Adam Treat
2023-06-16 14:43:14 -04:00
parent b39a7d4fd9
commit 782e1e77a4
2 changed files with 3 additions and 2 deletions

View File

@@ -412,7 +412,8 @@ QList<QString> Chat::modelList() const
for (const QString& f : fileNames) {
QString filePath = exePath + f;
QFileInfo info(filePath);
QString name = info.completeBaseName().remove(0, 5);
QString basename = info.completeBaseName();
QString name = basename.startsWith("ggml-") ? basename.remove(0, 5) : basename;
if (info.exists()) {
if (name == currentModelName)
list.prepend(name);