mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-05 10:30:29 +00:00
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
@@ -163,7 +163,7 @@ MySettingsTab {
|
||||
MySettingsLabel {
|
||||
id: deviceLabel
|
||||
text: qsTr("Embeddings Device")
|
||||
helpText: qsTr('The compute device used for embeddings. "Auto" uses the CPU. Requires restart.')
|
||||
helpText: qsTr('The compute device used for embeddings. Requires restart.')
|
||||
}
|
||||
MyComboBox {
|
||||
id: deviceBox
|
||||
@@ -172,11 +172,18 @@ MySettingsTab {
|
||||
Layout.maximumWidth: 400
|
||||
Layout.fillWidth: false
|
||||
Layout.alignment: Qt.AlignRight
|
||||
model: MySettings.embeddingsDeviceList
|
||||
model: ListModel {
|
||||
ListElement { text: qsTr("Application default") }
|
||||
Component.onCompleted: {
|
||||
MySettings.embeddingsDeviceList.forEach(d => append({"text": d}));
|
||||
}
|
||||
}
|
||||
Accessible.name: deviceLabel.text
|
||||
Accessible.description: deviceLabel.helpText
|
||||
function updateModel() {
|
||||
deviceBox.currentIndex = deviceBox.indexOfValue(MySettings.localDocsEmbedDevice);
|
||||
var device = MySettings.localDocsEmbedDevice;
|
||||
// This usage of 'Auto' should not be translated
|
||||
deviceBox.currentIndex = device === "Auto" ? 0 : deviceBox.indexOfValue(device);
|
||||
}
|
||||
Component.onCompleted: {
|
||||
deviceBox.updateModel();
|
||||
@@ -188,7 +195,8 @@ MySettingsTab {
|
||||
}
|
||||
}
|
||||
onActivated: {
|
||||
MySettings.localDocsEmbedDevice = deviceBox.currentText;
|
||||
// This usage of 'Auto' should not be translated
|
||||
MySettings.localDocsEmbedDevice = deviceBox.currentIndex === 0 ? "Auto" : deviceBox.currentText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user