mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-07 19:40:21 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user