mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-09 12:29:56 +00:00
Consolidate generation and application settings on the new settings object.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
#include <QUrl>
|
||||
|
||||
static double default_temperature = 0.7;
|
||||
static double default_topP = 0.1;
|
||||
@@ -309,11 +310,13 @@ QString MySettings::modelPath() const
|
||||
|
||||
void MySettings::setModelPath(const QString &p)
|
||||
{
|
||||
if (modelPath() == p)
|
||||
QString filePath = (p.startsWith("file://") ?
|
||||
QUrl(p).toLocalFile() : p);
|
||||
QString canonical = QFileInfo(filePath).canonicalFilePath() + "/";
|
||||
if (modelPath() == canonical)
|
||||
return;
|
||||
|
||||
QSettings setting;
|
||||
setting.setValue("modelPath", p);
|
||||
setting.setValue("modelPath", canonical);
|
||||
setting.sync();
|
||||
emit modelPathChanged();
|
||||
}
|
||||
|
Reference in New Issue
Block a user