Allow unloading/loading/changing of models.

This commit is contained in:
Adam Treat
2023-04-18 11:42:16 -04:00
parent 3a82a1d96c
commit 1eda8f030e
3 changed files with 126 additions and 25 deletions

View File

@@ -32,18 +32,47 @@ Window {
visible: LLM.isModelLoaded
Label {
id: modelNameField
id: modelLabel
color: "#d1d5db"
padding: 20
font.pixelSize: 24
text: "GPT4ALL Model: " + LLM.modelName
text: ""
background: Rectangle {
color: "#202123"
}
horizontalAlignment: TextInput.AlignHCenter
Accessible.role: Accessible.Heading
Accessible.name: text
Accessible.description: qsTr("Displays the model name that is currently loaded")
horizontalAlignment: TextInput.AlignRight
}
ComboBox {
id: comboBox
width: 400
anchors.top: modelLabel.top
anchors.bottom: modelLabel.bottom
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 24
spacing: 0
model: LLM.modelList
Accessible.role: Accessible.ComboBox
Accessible.name: qsTr("ComboBox for displaying/picking the current model")
Accessible.description: qsTr("Use this for picking the current model to use; the first item is the current model")
contentItem: Text {
anchors.horizontalCenter: parent.horizontalCenter
leftPadding: 10
rightPadding: 10
text: comboBox.displayText
font: comboBox.font
color: "#d1d5db"
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
}
background: Rectangle {
color: "#242528"
}
onActivated: {
LLM.modelName = comboBox.currentText
}
}
}