mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-06 11:00:48 +00:00
Consolidate generation and application settings on the new settings object.
This commit is contained in:
@@ -7,6 +7,7 @@ import chatlistmodel
|
||||
import llm
|
||||
import download
|
||||
import network
|
||||
import mysettings
|
||||
|
||||
Drawer {
|
||||
id: chatDrawer
|
||||
@@ -80,7 +81,7 @@ Drawer {
|
||||
property bool isCurrent: ChatListModel.currentChat === ChatListModel.get(index)
|
||||
property bool isServer: ChatListModel.get(index) && ChatListModel.get(index).isServer
|
||||
property bool trashQuestionDisplayed: false
|
||||
visible: !isServer || LLM.serverEnabled
|
||||
visible: !isServer || MySettings.serverChat
|
||||
z: isCurrent ? 199 : 1
|
||||
color: isServer ? theme.backgroundDarkest : (index % 2 === 0 ? theme.backgroundLight : theme.backgroundLighter)
|
||||
border.width: isCurrent
|
||||
|
@@ -9,6 +9,7 @@ import download
|
||||
import llm
|
||||
import modellist
|
||||
import network
|
||||
import mysettings
|
||||
|
||||
Dialog {
|
||||
id: modelDownloaderDialog
|
||||
@@ -29,21 +30,6 @@ Dialog {
|
||||
Network.sendModelDownloaderDialog();
|
||||
}
|
||||
|
||||
property string defaultModelPath: ModelList.defaultLocalModelsPath()
|
||||
property alias modelPath: settings.modelPath
|
||||
Settings {
|
||||
id: settings
|
||||
property string modelPath: modelDownloaderDialog.defaultModelPath
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
ModelList.localModelsPath = settings.modelPath
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
settings.sync()
|
||||
}
|
||||
|
||||
PopupDialog {
|
||||
id: downloadingErrorPopup
|
||||
anchors.centerIn: parent
|
||||
@@ -416,12 +402,9 @@ Dialog {
|
||||
FolderDialog {
|
||||
id: modelPathDialog
|
||||
title: "Please choose a directory"
|
||||
currentFolder: "file://" + ModelList.localModelsPath
|
||||
currentFolder: "file://" + MySettings.modelsPath
|
||||
onAccepted: {
|
||||
modelPathDisplayField.text = selectedFolder
|
||||
ModelList.localModelsPath = modelPathDisplayField.text
|
||||
settings.modelPath = ModelList.localModelsPath
|
||||
settings.sync()
|
||||
MySettings.modelsPath = selectedFolder
|
||||
}
|
||||
}
|
||||
Label {
|
||||
@@ -433,7 +416,7 @@ Dialog {
|
||||
}
|
||||
MyDirectoryField {
|
||||
id: modelPathDisplayField
|
||||
text: ModelList.localModelsPath
|
||||
text: MySettings.modelPath
|
||||
Layout.fillWidth: true
|
||||
ToolTip.text: qsTr("Path where model files will be downloaded to")
|
||||
ToolTip.visible: hovered
|
||||
@@ -442,11 +425,9 @@ Dialog {
|
||||
Accessible.description: ToolTip.text
|
||||
onEditingFinished: {
|
||||
if (isValid) {
|
||||
ModelList.localModelsPath = modelPathDisplayField.text
|
||||
settings.modelPath = ModelList.localModelsPath
|
||||
settings.sync()
|
||||
MySettings.modelsPath = modelPathDisplayField.text
|
||||
} else {
|
||||
text = ModelList.localModelsPath
|
||||
text = MySettings.modelPath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,20 +43,6 @@ Dialog {
|
||||
|
||||
function restoreApplicationDefaults() {
|
||||
MySettings.restoreApplicationDefaults();
|
||||
ModelList.localModelsPath = MySettings.modelPath
|
||||
LLM.threadCount = MySettings.threadCount
|
||||
LLM.serverEnabled = MySettings.serverChat
|
||||
ChatListModel.shouldSaveChats = MySettings.saveChats
|
||||
ChatListModel.shouldSaveChatGPTChats = MySettings.saveChatGPTChats
|
||||
MySettings.forceMetal = false
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
LLM.threadCount = MySettings.threadCount
|
||||
LLM.serverEnabled = MySettings.serverChat
|
||||
ChatListModel.shouldSaveChats = MySettings.saveChats
|
||||
ChatListModel.shouldSaveChatGPTChats = MySettings.saveChatGPTChats
|
||||
ModelList.localModelsPath = MySettings.modelPath
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -572,11 +558,9 @@ Dialog {
|
||||
FolderDialog {
|
||||
id: modelPathDialog
|
||||
title: "Please choose a directory"
|
||||
currentFolder: "file://" + ModelList.localModelsPath
|
||||
currentFolder: "file://" + MySettings.modelPath
|
||||
onAccepted: {
|
||||
modelPathDisplayField.text = selectedFolder
|
||||
ModelList.localModelsPath = modelPathDisplayField.text
|
||||
MySettings.modelPath = ModelList.localModelsPath
|
||||
MySettings.modelPath = selectedFolder
|
||||
}
|
||||
}
|
||||
Label {
|
||||
@@ -588,7 +572,7 @@ Dialog {
|
||||
}
|
||||
MyDirectoryField {
|
||||
id: modelPathDisplayField
|
||||
text: ModelList.localModelsPath
|
||||
text: MySettings.modelPath
|
||||
implicitWidth: 300
|
||||
Layout.row: 2
|
||||
Layout.column: 1
|
||||
@@ -600,10 +584,9 @@ Dialog {
|
||||
Accessible.description: ToolTip.text
|
||||
onEditingFinished: {
|
||||
if (isValid) {
|
||||
ModelList.localModelsPath = modelPathDisplayField.text
|
||||
MySettings.modelPath = ModelList.localModelsPath
|
||||
MySettings.modelPath = modelPathDisplayField.text
|
||||
} else {
|
||||
text = ModelList.localModelsPath
|
||||
text = MySettings.modelPath
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -635,7 +618,6 @@ Dialog {
|
||||
var val = parseInt(text)
|
||||
if (!isNaN(val)) {
|
||||
MySettings.threadCount = val
|
||||
LLM.threadCount = val
|
||||
focus = false
|
||||
} else {
|
||||
text = MySettings.threadCount
|
||||
@@ -660,7 +642,6 @@ Dialog {
|
||||
onClicked: {
|
||||
Network.sendSaveChatsToggled(saveChatsBox.checked);
|
||||
MySettings.saveChats = !MySettings.saveChats
|
||||
ChatListModel.shouldSaveChats = saveChatsBox.checked
|
||||
}
|
||||
ToolTip.text: qsTr("WARNING: Saving chats to disk can be ~2GB per chat")
|
||||
ToolTip.visible: hovered
|
||||
@@ -679,7 +660,6 @@ Dialog {
|
||||
checked: MySettings.saveChatGPTChats
|
||||
onClicked: {
|
||||
MySettings.saveChatGPTChats = !MySettings.saveChatGPTChats
|
||||
ChatListModel.shouldSaveChatGPTChats = saveChatGPTChatsBox.checked
|
||||
}
|
||||
}
|
||||
Label {
|
||||
@@ -696,7 +676,6 @@ Dialog {
|
||||
checked: MySettings.serverChat
|
||||
onClicked: {
|
||||
MySettings.serverChat = !MySettings.serverChat
|
||||
LLM.serverEnabled = serverChatBox.checked
|
||||
}
|
||||
ToolTip.text: qsTr("WARNING: This enables the gui to act as a local REST web server(OpenAI API compliant) for API requests and will increase your RAM usage as well")
|
||||
ToolTip.visible: hovered
|
||||
|
Reference in New Issue
Block a user