is necessary to get rid of technical debt before we drastically increase
the complexity of settings by adding per model settings and mirostat and
other fun things. Right now the settings are divided between QML and C++
and some convenience methods to deal with settings sync and so on that are
in other singletons. This change consolidates all the logic for settings
into a single class with a single API for both C++ and QML.
ToolTip.text:qsTr("Temperature increases the chances of choosing less likely tokens.\nNOTE: Higher temperature gives more creative but less predictable outputs.")
ToolTip.visible:hovered
@ -321,11 +250,10 @@ Dialog {
onEditingFinished:{
varval=parseFloat(text)
if(!isNaN(val)){
settings.temperature=val
settings.sync()
MySettings.temperature=val
focus=false
}else{
text=settings.temperature.toString()
text=MySettings.temperature
}
}
Accessible.role:Accessible.EditableText
@ -340,7 +268,7 @@ Dialog {
Layout.column:0
}
MyTextField{
text:settings.topP.toString()
text:MySettings.topP
color:theme.textColor
ToolTip.text:qsTr("Only the most likely tokens up to a total probability of top_p can be chosen.\nNOTE: Prevents choosing highly unlikely tokens, aka Nucleus Sampling")
ToolTip.visible:hovered
@ -352,11 +280,10 @@ Dialog {
onEditingFinished:{
varval=parseFloat(text)
if(!isNaN(val)){
settings.topP=val
settings.sync()
MySettings.topP=val
focus=false
}else{
text=settings.topP.toString()
text=MySettings.topP
}
}
Accessible.role:Accessible.EditableText
@ -371,7 +298,7 @@ Dialog {
Layout.column:0
}
MyTextField{
text:settings.topK.toString()
text:MySettings.topK
color:theme.textColor
ToolTip.text:qsTr("Only the top K most likely tokens will be chosen from")
ToolTip.visible:hovered
@ -383,11 +310,10 @@ Dialog {
onEditingFinished:{
varval=parseInt(text)
if(!isNaN(val)){
settings.topK=val
settings.sync()
MySettings.topK=val
focus=false
}else{
text=settings.topK.toString()
text=MySettings.topK
}
}
Accessible.role:Accessible.EditableText
@ -402,7 +328,7 @@ Dialog {
Layout.column:0
}
MyTextField{
text:settings.maxLength.toString()
text:MySettings.maxLength
color:theme.textColor
ToolTip.text:qsTr("Maximum length of response in tokens")
ToolTip.visible:hovered
@ -414,11 +340,10 @@ Dialog {
onEditingFinished:{
varval=parseInt(text)
if(!isNaN(val)){
settings.maxLength=val
settings.sync()
MySettings.maxLength=val
focus=false
}else{
text=settings.maxLength.toString()
text=MySettings.maxLength
}
}
Accessible.role:Accessible.EditableText
@ -434,7 +359,7 @@ Dialog {
Layout.column:0
}
MyTextField{
text:settings.promptBatchSize.toString()
text:MySettings.promptBatchSize
color:theme.textColor
ToolTip.text:qsTr("Amount of prompt tokens to process at once.\nNOTE: Higher values can speed up reading prompts but will use more RAM")
ToolTip.visible:hovered
@ -446,11 +371,10 @@ Dialog {
onEditingFinished:{
varval=parseInt(text)
if(!isNaN(val)){
settings.promptBatchSize=val
settings.sync()
MySettings.promptBatchSize=val
focus=false
}else{
text=settings.promptBatchSize.toString()
text=MySettings.promptBatchSize
}
}
Accessible.role:Accessible.EditableText
@ -465,7 +389,7 @@ Dialog {
Layout.column:0
}
MyTextField{
text:settings.repeatPenalty.toString()
text:MySettings.repeatPenalty
color:theme.textColor
ToolTip.text:qsTr("Amount to penalize repetitiveness of the output")
ToolTip.visible:hovered
@ -477,11 +401,10 @@ Dialog {
onEditingFinished:{
varval=parseFloat(text)
if(!isNaN(val)){
settings.repeatPenalty=val
settings.sync()
MySettings.repeatPenalty=val
focus=false
}else{
text=settings.repeatPenalty.toString()
text=MySettings.repeatPenalty
}
}
Accessible.role:Accessible.EditableText
@ -496,7 +419,7 @@ Dialog {
Layout.column:0
}
MyTextField{
text:settings.repeatPenaltyTokens.toString()
text:MySettings.repeatPenaltyTokens
color:theme.textColor
ToolTip.text:qsTr("How far back in output to apply repeat penalty")
ToolTip.visible:hovered
@ -508,11 +431,10 @@ Dialog {
onEditingFinished:{
varval=parseInt(text)
if(!isNaN(val)){
settings.repeatPenaltyTokens=val
settings.sync()
MySettings.repeatPenaltyTokens=val
focus=false
}else{
text=settings.repeatPenaltyTokens.toString()
text=MySettings.repeatPenaltyTokens
}
}
Accessible.role:Accessible.EditableText
@ -558,7 +480,7 @@ Dialog {
anchors.fill:parent
TextArea{
id: templateTextArea
text:settings.promptTemplate
text:MySettings.promptTemplate
color:theme.textColor
background:Rectangle{
implicitWidth:150
@ -569,8 +491,7 @@ Dialog {
wrapMode:TextArea.Wrap
onTextChanged:{
if(templateTextArea.text.indexOf("%1")!==-1){
settings.promptTemplate=text
settings.sync()
MySettings.promptTemplate=text
}
}
bottomPadding:10
@ -633,21 +554,19 @@ Dialog {
Accessible.name:qsTr("ComboBox for displaying/picking the default model")
Accessible.description:qsTr("Use this for picking the default model to use; the first item is the current default model")
ToolTip.text:qsTr("WARNING: This enables the gui to act as a local REST web server(OpenAI API compliant) for API requests and will increase your RAM usage as well")