Don't persist the force metal setting.

This commit is contained in:
Adam Treat 2023-06-27 13:02:54 -04:00 committed by AT
parent 267601d670
commit 42c0a6673a
2 changed files with 4 additions and 13 deletions

View File

@ -12,9 +12,6 @@ MySettings *MySettings::globalInstance()
MySettings::MySettings() MySettings::MySettings()
: QObject{nullptr} : QObject{nullptr}
{ {
QSettings settings;
settings.sync();
m_forceMetal = settings.value("forceMetal", false).toBool();
} }
bool MySettings::forceMetal() const bool MySettings::forceMetal() const

View File

@ -52,7 +52,6 @@ Dialog {
### Assistant:\n" ### Assistant:\n"
property string defaultModelPath: ModelList.defaultLocalModelsPath() property string defaultModelPath: ModelList.defaultLocalModelsPath()
property string defaultUserDefaultModel: "Application default" property string defaultUserDefaultModel: "Application default"
property bool defaultForceMetal: false
property alias temperature: settings.temperature property alias temperature: settings.temperature
property alias topP: settings.topP property alias topP: settings.topP
@ -68,7 +67,6 @@ Dialog {
property alias serverChat: settings.serverChat property alias serverChat: settings.serverChat
property alias modelPath: settings.modelPath property alias modelPath: settings.modelPath
property alias userDefaultModel: settings.userDefaultModel property alias userDefaultModel: settings.userDefaultModel
property alias forceMetal: settings.forceMetal
Settings { Settings {
id: settings id: settings
@ -86,7 +84,6 @@ Dialog {
property string promptTemplate: settingsDialog.defaultPromptTemplate property string promptTemplate: settingsDialog.defaultPromptTemplate
property string modelPath: settingsDialog.defaultModelPath property string modelPath: settingsDialog.defaultModelPath
property string userDefaultModel: settingsDialog.defaultUserDefaultModel property string userDefaultModel: settingsDialog.defaultUserDefaultModel
property bool forceMetal: settingsDialog.defaultForceMetal
} }
function restoreGenerationDefaults() { function restoreGenerationDefaults() {
@ -113,7 +110,7 @@ Dialog {
LLM.serverEnabled = settings.serverChat LLM.serverEnabled = settings.serverChat
ChatListModel.shouldSaveChats = settings.saveChats ChatListModel.shouldSaveChats = settings.saveChats
ChatListModel.shouldSaveChatGPTChats = settings.saveChatGPTChats ChatListModel.shouldSaveChatGPTChats = settings.saveChatGPTChats
MySettings.forceMetal = settings.forceMetal MySettings.forceMetal = false
settings.sync() settings.sync()
} }
@ -123,7 +120,6 @@ Dialog {
ChatListModel.shouldSaveChats = settings.saveChats ChatListModel.shouldSaveChats = settings.saveChats
ChatListModel.shouldSaveChatGPTChats = settings.saveChatGPTChats ChatListModel.shouldSaveChatGPTChats = settings.saveChatGPTChats
ModelList.localModelsPath = settings.modelPath ModelList.localModelsPath = settings.modelPath
MySettings.forceMetal = settings.forceMetal
} }
Connections { Connections {
@ -817,11 +813,9 @@ Dialog {
Layout.columnSpan: 2 Layout.columnSpan: 2
MyCheckBox { MyCheckBox {
id: gpuOverrideBox id: gpuOverrideBox
checked: settings.forceMetal checked: MySettings.forceMetal
onClicked: { onClicked: {
settingsDialog.forceMetal = gpuOverrideBox.checked MySettings.forceMetal = !MySettings.forceMetal
MySettings.forceMetal = gpuOverrideBox.checked
settings.sync()
} }
} }
Label { Label {
@ -830,7 +824,7 @@ Dialog {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
color: theme.textErrorColor color: theme.textErrorColor
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("WARNING: On macOS with arm architecture (M1+), this setting forces usage of the GPU if it is detected. Can cause a crash if the model requires more RAM than the OS + GPU supports. Setting has no effect on non-macs or intel macs.") text: qsTr("WARNING: On macOS with arm (M1+) this setting forces usage of the GPU. Can cause crashes if the model requires more RAM than the system supports. Because of crash possibilty the setting will not persist across restarts of the application. This has no effect on non-macs or intel.")
} }
} }
MyButton { MyButton {