@ -80,260 +98,189 @@ The prompt below is a question to answer, a task to complete, or a conversation
Item{
Accessible.role:Accessible.Dialog
Accessible.name:qsTr("Settings dialog")
Accessible.description:qsTr("Dialog containing various settings for model text generation")
Accessible.description:qsTr("Dialog containing various application settings")
}
TabBar{
id: settingsTabBar
width:parent.width
TabButton{
text:qsTr("Generation")
Accessible.role:Accessible.Button
Accessible.name:qsTr("Generation settings")
Accessible.description:qsTr("Settings related to how the model generates text")
}
GridLayout{
columns:2
rowSpacing:2
columnSpacing:10
anchors.fill:parent
Label{
id: tempLabel
text:qsTr("Temperature:")
color:theme.textColor
Layout.row:0
Layout.column:0
TabButton{
text:qsTr("Application")
Accessible.role:Accessible.Button
Accessible.name:qsTr("Application settings")
Accessible.description:qsTr("Settings related to general behavior of the application")
}
TextField{
text:settings.temperature.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Temperature increases the chances of choosing less likely tokens - higher temperature gives more creative but less predictable outputs")
ToolTip.visible:hovered
Layout.row:0
Layout.column:1
validator:DoubleValidator{}
onAccepted:{
varval=parseFloat(text)
if(!isNaN(val)){
settings.temperature=val
settings.sync()
focus=false
}else{
text=settings.temperature.toString()
}
StackLayout{
anchors.top:settingsTabBar.bottom
anchors.bottom:parent.bottom
width:parent.width
currentIndex:settingsTabBar.currentIndex
Item{
id: generationSettingsTab
GridLayout{
columns:2
rowSpacing:2
columnSpacing:10
anchors.fill:parent
Label{
id: tempLabel
text:qsTr("Temperature:")
color:theme.textColor
Layout.row:0
Layout.column:0
}
}
Accessible.role:Accessible.EditableText
Accessible.name:tempLabel.text
Accessible.description:ToolTip.text
}
Label{
id: topPLabel
text:qsTr("Top P:")
color:theme.textColor
Layout.row:1
Layout.column:0
}
TextField{
text:settings.topP.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Only the most likely tokens up to a total probability of top_p can be chosen, prevents choosing highly unlikely tokens, aka Nucleus Sampling")
ToolTip.visible:hovered
Layout.row:1
Layout.column:1
validator:DoubleValidator{}
onAccepted:{
varval=parseFloat(text)
if(!isNaN(val)){
settings.topP=val
settings.sync()
focus=false
}else{
text=settings.topP.toString()
TextField{
text:settings.temperature.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Temperature increases the chances of choosing less likely tokens - higher temperature gives more creative but less predictable outputs")
ToolTip.visible:hovered
Layout.row:0
Layout.column:1
validator:DoubleValidator{}
onAccepted:{
varval=parseFloat(text)
if(!isNaN(val)){
settings.temperature=val
settings.sync()
focus=false
}else{
text=settings.temperature.toString()
}
}
Accessible.role:Accessible.EditableText
Accessible.name:tempLabel.text
Accessible.description:ToolTip.text
}
}
Accessible.role:Accessible.EditableText
Accessible.name:topPLabel.text
Accessible.description:ToolTip.text
}
Label{
id: topKLabel
text:qsTr("Top K:")
color:theme.textColor
Layout.row:2
Layout.column:0
}
TextField{
text:settings.topK.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Only the top K most likely tokens will be chosen from")
ToolTip.visible:hovered
Layout.row:2
Layout.column:1
validator:IntValidator{bottom:1}
onAccepted:{
varval=parseInt(text)
if(!isNaN(val)){
settings.topK=val
settings.sync()
focus=false
}else{
text=settings.topK.toString()
Label{
id: topPLabel
text:qsTr("Top P:")
color:theme.textColor
Layout.row:1
Layout.column:0
}
TextField{
text:settings.topP.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Only the most likely tokens up to a total probability of top_p can be chosen, prevents choosing highly unlikely tokens, aka Nucleus Sampling")
ToolTip.visible:hovered
Layout.row:1
Layout.column:1
validator:DoubleValidator{}
onAccepted:{
varval=parseFloat(text)
if(!isNaN(val)){
settings.topP=val
settings.sync()
focus=false
}else{
text=settings.topP.toString()
}
}
Accessible.role:Accessible.EditableText
Accessible.name:topPLabel.text
Accessible.description:ToolTip.text
}
Label{
id: topKLabel
text:qsTr("Top K:")
color:theme.textColor
Layout.row:2
Layout.column:0
}
}
Accessible.role:Accessible.EditableText
Accessible.name:topKLabel.text
Accessible.description:ToolTip.text
}
Label{
id: maxLengthLabel
text:qsTr("Max Length:")
color:theme.textColor
Layout.row:3
Layout.column:0
}
TextField{
text:settings.maxLength.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Maximum length of response in tokens")
ToolTip.visible:hovered
Layout.row:3
Layout.column:1
validator:IntValidator{bottom:1}
onAccepted:{
varval=parseInt(text)
if(!isNaN(val)){
settings.maxLength=val
settings.sync()
focus=false
}else{
text=settings.maxLength.toString()
TextField{
text:settings.topK.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Only the top K most likely tokens will be chosen from")
ToolTip.visible:hovered
Layout.row:2
Layout.column:1
validator:IntValidator{bottom:1}
onAccepted:{
varval=parseInt(text)
if(!isNaN(val)){
settings.topK=val
settings.sync()
focus=false
}else{
text=settings.topK.toString()
}
}
Accessible.role:Accessible.EditableText
Accessible.name:topKLabel.text
Accessible.description:ToolTip.text
}
}
Accessible.role:Accessible.EditableText
Accessible.name:maxLengthLabel.text
Accessible.description:ToolTip.text
}
Label{
id: batchSizeLabel
text:qsTr("Prompt Batch Size:")
color:theme.textColor
Layout.row:4
Layout.column:0
}
TextField{
text:settings.promptBatchSize.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Amount of prompt tokens to process at once, higher values can speed up reading prompts but will use more RAM")
ToolTip.visible:hovered
Layout.row:4
Layout.column:1
validator:IntValidator{bottom:1}
onAccepted:{
varval=parseInt(text)
if(!isNaN(val)){
settings.promptBatchSize=val
settings.sync()
focus=false
}else{
text=settings.promptBatchSize.toString()
Label{
id: maxLengthLabel
text:qsTr("Max Length:")
color:theme.textColor
Layout.row:3
Layout.column:0
}
}
Accessible.role:Accessible.EditableText
Accessible.name:batchSizeLabel.text
Accessible.description:ToolTip.text
}
Label{
id: nThreadsLabel
text:qsTr("CPU Threads")
color:theme.textColor
Layout.row:5
Layout.column:0
}
TextField{
text:settingsDialog.threadCount.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Amount of processing threads to use, a setting of 0 will use the lesser of 4 or your number of CPU threads")
ToolTip.visible:hovered
Layout.row:5
Layout.column:1
validator:IntValidator{bottom:1}
onAccepted:{
varval=parseInt(text)
if(!isNaN(val)){
settingsDialog.threadCount=val
LLM.threadCount=val
focus=false
}else{
text=settingsDialog.threadCount.toString()
TextField{
text:settings.maxLength.toString()
color:theme.textColor
background:Rectangle{
implicitWidth:150
color:theme.backgroundLighter
radius:10
}
padding:10
ToolTip.text:qsTr("Maximum length of response in tokens")