@ -80,260 +98,189 @@ The prompt below is a question to answer, a task to complete, or a conversation
Item{
Item{
Accessible.role:Accessible.Dialog
Accessible.role:Accessible.Dialog
Accessible.name:qsTr("Settings 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{
TabButton{
columns:2
text:qsTr("Application")
rowSpacing:2
Accessible.role:Accessible.Button
columnSpacing:10
Accessible.name:qsTr("Application settings")
anchors.fill:parent
Accessible.description:qsTr("Settings related to general behavior of the application")
Label{
id: tempLabel
text:qsTr("Temperature:")
color:theme.textColor
Layout.row:0
Layout.column:0
}
}
TextField{
}
text:settings.temperature.toString()
color:theme.textColor
StackLayout{
background:Rectangle{
anchors.top:settingsTabBar.bottom
implicitWidth:150
anchors.bottom:parent.bottom
color:theme.backgroundLighter
width:parent.width
radius:10
currentIndex:settingsTabBar.currentIndex
}
Item{
padding:10
id: generationSettingsTab
ToolTip.text:qsTr("Temperature increases the chances of choosing less likely tokens - higher temperature gives more creative but less predictable outputs")
GridLayout{
ToolTip.visible:hovered
columns:2
Layout.row:0
rowSpacing:2
Layout.column:1
columnSpacing:10
validator:DoubleValidator{}
anchors.fill:parent
onAccepted:{
varval=parseFloat(text)
Label{
if(!isNaN(val)){
id: tempLabel
settings.temperature=val
text:qsTr("Temperature:")
settings.sync()
color:theme.textColor
focus=false
Layout.row:0
}else{
Layout.column:0
text=settings.temperature.toString()
}
}
}
TextField{
Accessible.role:Accessible.EditableText
text:settings.temperature.toString()
Accessible.name:tempLabel.text
color:theme.textColor
Accessible.description:ToolTip.text
background:Rectangle{
}
implicitWidth:150
Label{
color:theme.backgroundLighter
id: topPLabel
radius:10
text:qsTr("Top P:")
}
color:theme.textColor
padding:10
Layout.row:1
ToolTip.text:qsTr("Temperature increases the chances of choosing less likely tokens - higher temperature gives more creative but less predictable outputs")
Layout.column:0
ToolTip.visible:hovered
}
Layout.row:0
TextField{
Layout.column:1
text:settings.topP.toString()
validator:DoubleValidator{}
color:theme.textColor
onAccepted:{
background:Rectangle{
varval=parseFloat(text)
implicitWidth:150
if(!isNaN(val)){
color:theme.backgroundLighter
settings.temperature=val
radius:10
settings.sync()
}
focus=false
padding:10
}else{
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")
text=settings.temperature.toString()
ToolTip.visible:hovered
}
Layout.row:1
}
Layout.column:1
Accessible.role:Accessible.EditableText
validator:DoubleValidator{}
Accessible.name:tempLabel.text
onAccepted:{
Accessible.description:ToolTip.text
varval=parseFloat(text)
if(!isNaN(val)){
settings.topP=val
settings.sync()
focus=false
}else{
text=settings.topP.toString()
}
}
}
Label{
Accessible.role:Accessible.EditableText
id: topPLabel
Accessible.name:topPLabel.text
text:qsTr("Top P:")
Accessible.description:ToolTip.text
color:theme.textColor
}
Layout.row:1
Label{
Layout.column:0
id: topKLabel
}
text:qsTr("Top K:")
TextField{
color:theme.textColor
text:settings.topP.toString()
Layout.row:2
color:theme.textColor
Layout.column:0
background:Rectangle{
}
implicitWidth:150
TextField{
color:theme.backgroundLighter
text:settings.topK.toString()
radius:10
color:theme.textColor
}
background:Rectangle{
padding:10
implicitWidth:150
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")
color:theme.backgroundLighter
ToolTip.visible:hovered
radius:10
Layout.row:1
}
Layout.column:1
padding:10
validator:DoubleValidator{}
ToolTip.text:qsTr("Only the top K most likely tokens will be chosen from")
onAccepted:{
ToolTip.visible:hovered
varval=parseFloat(text)
Layout.row:2
if(!isNaN(val)){
Layout.column:1
settings.topP=val
validator:IntValidator{bottom:1}
settings.sync()
onAccepted:{
focus=false
varval=parseInt(text)
}else{
if(!isNaN(val)){
text=settings.topP.toString()
settings.topK=val
}
settings.sync()
}
focus=false
Accessible.role:Accessible.EditableText
}else{
Accessible.name:topPLabel.text
text=settings.topK.toString()
Accessible.description:ToolTip.text
}
Label{
id: topKLabel
text:qsTr("Top K:")
color:theme.textColor
Layout.row:2
Layout.column:0
}
}
}
TextField{
Accessible.role:Accessible.EditableText
text:settings.topK.toString()
Accessible.name:topKLabel.text
color:theme.textColor
Accessible.description:ToolTip.text
background:Rectangle{
}
implicitWidth:150
Label{
color:theme.backgroundLighter
id: maxLengthLabel
radius:10
text:qsTr("Max Length:")
}
color:theme.textColor
padding:10
Layout.row:3
ToolTip.text:qsTr("Only the top K most likely tokens will be chosen from")
Layout.column:0
ToolTip.visible:hovered
}
Layout.row:2
TextField{
Layout.column:1
text:settings.maxLength.toString()
validator:IntValidator{bottom:1}
color:theme.textColor
onAccepted:{
background:Rectangle{
varval=parseInt(text)
implicitWidth:150
if(!isNaN(val)){
color:theme.backgroundLighter
settings.topK=val
radius:10
settings.sync()
}
focus=false
padding:10
}else{
ToolTip.text:qsTr("Maximum length of response in tokens")
text=settings.topK.toString()
ToolTip.visible:hovered
}
Layout.row:3
}
Layout.column:1
Accessible.role:Accessible.EditableText
validator:IntValidator{bottom:1}
Accessible.name:topKLabel.text
onAccepted:{
Accessible.description:ToolTip.text
varval=parseInt(text)
if(!isNaN(val)){
settings.maxLength=val
settings.sync()
focus=false
}else{
text=settings.maxLength.toString()
}
}
}
Label{
Accessible.role:Accessible.EditableText
id: maxLengthLabel
Accessible.name:maxLengthLabel.text
text:qsTr("Max Length:")
Accessible.description:ToolTip.text
color:theme.textColor
}
Layout.row:3
Layout.column:0
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()
}
}
}
TextField{
Accessible.role:Accessible.EditableText
text:settings.maxLength.toString()
Accessible.name:batchSizeLabel.text
color:theme.textColor
Accessible.description:ToolTip.text
background:Rectangle{
}
implicitWidth:150
color:theme.backgroundLighter
Label{
radius:10
id: nThreadsLabel
}
text:qsTr("CPU Threads")
padding:10
color:theme.textColor
ToolTip.text:qsTr("Maximum length of response in tokens")
Layout.row:5
ToolTip.visible:hovered
Layout.column:0
Layout.row:3
}
Layout.column:1
TextField{
validator:IntValidator{bottom:1}
text:settingsDialog.threadCount.toString()
onAccepted:{
color:theme.textColor
varval=parseInt(text)
background:Rectangle{
if(!isNaN(val)){
implicitWidth:150
settings.maxLength=val
color:theme.backgroundLighter
settings.sync()
radius:10
focus=false
}
}else{
padding:10
text=settings.maxLength.toString()
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")