Support loading files if 'ggml' is found anywhere in the name not just at (#1001)

the beginning and add deprecated flag to models.json so older versions will
show a model, but later versions don't. This will allow us to transition
away from models < ggmlv2 and still allow older installs of gpt4all to work.
This commit is contained in:
AT
2023-06-16 08:09:33 -07:00
committed by GitHub
parent abc081e48d
commit a576220b18
5 changed files with 58 additions and 22 deletions

View File

@@ -13,10 +13,10 @@
static inline QString modelToName(const ModelInfo &info)
{
QString modelName = info.filename;
Q_ASSERT(modelName.startsWith("ggml-"));
modelName = modelName.remove(0, 5);
Q_ASSERT(modelName.endsWith(".bin"));
modelName.chop(4);
if (modelName.startsWith("ggml-"))
modelName = modelName.remove(0, 5);
if (modelName.endsWith(".bin"))
modelName.chop(4);
return modelName;
}