Add thread count setting

This commit is contained in:
Aaron Miller
2023-04-18 06:46:03 -07:00
committed by AT
parent e6cb6a2ae3
commit f1b87d0b56
6 changed files with 78 additions and 8 deletions

View File

@@ -107,7 +107,6 @@ Window {
property int defaultTopK: 40
property int defaultMaxLength: 4096
property int defaultPromptBatchSize: 9
property string defaultPromptTemplate: "The prompt below is a question to answer, a task to complete, or a conversation to respond to; decide which and write an appropriate response.
### Prompt:
%1
@@ -141,7 +140,7 @@ Window {
GridLayout {
columns: 2
rowSpacing: 10
rowSpacing: 2
columnSpacing: 10
anchors.fill: parent
@@ -278,14 +277,41 @@ Window {
}
Label {
id: promptTemplateLabel
text: qsTr("Prompt Template:")
id: nThreadsLabel
text: qsTr("CPU Threads")
Layout.row: 5
Layout.column: 0
}
Rectangle {
TextField {
text: LLM.threadCount.toString()
ToolTip.text: qsTr("Amount of processing threads to use")
ToolTip.visible: hovered
Layout.row: 5
Layout.column: 1
validator: IntValidator { bottom: 1 }
onAccepted: {
var val = parseInt(text)
if (!isNaN(val)) {
LLM.threadCount = val
focus = false
} else {
text = settingsDialog.nThreads.toString()
}
}
Accessible.role: Accessible.EditableText
Accessible.name: nThreadsLabel.text
Accessible.description: ToolTip.text
}
Label {
id: promptTemplateLabel
text: qsTr("Prompt Template:")
Layout.row: 6
Layout.column: 0
}
Rectangle {
Layout.row: 6
Layout.column: 1
Layout.fillWidth: true
height: 200
color: "transparent"
@@ -319,7 +345,7 @@ Window {
}
}
Button {
Layout.row: 6
Layout.row: 7
Layout.column: 1
Layout.fillWidth: true
padding: 15