2023-04-14 14:44:28 -04:00
|
|
|
import QtCore
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2023-04-23 23:56:33 -04:00
|
|
|
import QtQuick.Controls.Basic
|
2023-04-14 14:44:28 -04:00
|
|
|
import QtQuick.Layouts
|
|
|
|
import download
|
|
|
|
import network
|
|
|
|
import llm
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: networkDialog
|
|
|
|
anchors.centerIn: parent
|
|
|
|
modal: true
|
|
|
|
opacity: 0.9
|
|
|
|
padding: 20
|
|
|
|
|
2023-04-23 09:42:35 -04:00
|
|
|
Theme {
|
|
|
|
id: theme
|
|
|
|
}
|
|
|
|
|
2023-04-14 14:44:28 -04:00
|
|
|
Settings {
|
|
|
|
id: settings
|
2023-04-28 10:54:05 -04:00
|
|
|
category: "network"
|
2023-04-14 14:44:28 -04:00
|
|
|
property string attribution: ""
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onDestruction: {
|
|
|
|
settings.sync()
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: column
|
|
|
|
spacing: 20
|
|
|
|
Item {
|
|
|
|
width: childrenRect.width
|
|
|
|
height: childrenRect.height
|
|
|
|
Image {
|
|
|
|
id: img
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
width: 60
|
|
|
|
height: 60
|
2023-04-23 09:42:35 -04:00
|
|
|
source: "qrc:/gpt4all/icons/logo.svg"
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
Text {
|
|
|
|
anchors.left: img.right
|
|
|
|
anchors.leftMargin: 30
|
|
|
|
anchors.verticalCenter: img.verticalCenter
|
|
|
|
text: qsTr("Contribute data to the GPT4All Opensource Datalake.")
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.textColor
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
clip: true
|
|
|
|
height: 300
|
|
|
|
width: 1024 - 40
|
|
|
|
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
id: textOptIn
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
width: 1024 - 40
|
|
|
|
padding: 20
|
|
|
|
text: qsTr("By enabling this feature, you will be able to participate in the democratic process of training a large language model by contributing data for future model improvements.
|
|
|
|
|
2023-05-03 07:54:45 -04:00
|
|
|
When a GPT4All model responds to you and you have opted-in, your conversation will be sent to the GPT4All Open Source Datalake. Additionally, you can like/dislike its response. If you dislike a response, you can suggest an alternative response. This data will be collected and aggregated in the GPT4All Datalake.
|
2023-04-14 14:44:28 -04:00
|
|
|
|
|
|
|
NOTE: By turning on this feature, you will be sending your data to the GPT4All Open Source Datalake. You should have no expectation of chat privacy when this feature is enabled. You should; however, have an expectation of an optional attribution if you wish. Your chat data will be openly available for anyone to download and will be used by Nomic AI to improve future GPT4All models. Nomic AI will retain all attribution information attached to your data and you will be credited as a contributor to any GPT4All model release that uses your data!")
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.textColor
|
2023-04-14 14:44:28 -04:00
|
|
|
focus: false
|
|
|
|
readOnly: true
|
|
|
|
Accessible.role: Accessible.Paragraph
|
|
|
|
Accessible.name: qsTr("Terms for opt-in")
|
|
|
|
Accessible.description: qsTr("Describes what will happen when you opt-in")
|
|
|
|
background: Rectangle {
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundLight
|
2023-04-14 14:44:28 -04:00
|
|
|
radius: 10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: attribution
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.textColor
|
2023-04-14 14:44:28 -04:00
|
|
|
padding: 20
|
|
|
|
width: parent.width
|
|
|
|
text: settings.attribution
|
2023-04-23 11:23:02 -04:00
|
|
|
font.pixelSize: theme.fontSizeLarge
|
2023-04-14 14:44:28 -04:00
|
|
|
placeholderText: qsTr("Please provide a name for attribution (optional)")
|
2023-04-23 09:42:35 -04:00
|
|
|
placeholderTextColor: theme.backgroundLightest
|
2023-04-14 14:44:28 -04:00
|
|
|
background: Rectangle {
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundLighter
|
2023-04-14 14:44:28 -04:00
|
|
|
radius: 10
|
|
|
|
}
|
|
|
|
Accessible.role: Accessible.EditableText
|
|
|
|
Accessible.name: qsTr("Attribution (optional)")
|
|
|
|
Accessible.description: qsTr("Textfield for providing attribution")
|
|
|
|
onEditingFinished: {
|
|
|
|
settings.attribution = attribution.text;
|
|
|
|
settings.sync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
anchors.fill: parent
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundDarkest
|
2023-04-14 14:44:28 -04:00
|
|
|
border.width: 1
|
2023-04-23 09:42:35 -04:00
|
|
|
border.color: theme.dialogBorder
|
2023-04-14 14:44:28 -04:00
|
|
|
radius: 10
|
|
|
|
}
|
|
|
|
|
|
|
|
footer: DialogButtonBox {
|
|
|
|
id: dialogBox
|
|
|
|
padding: 20
|
|
|
|
alignment: Qt.AlignRight
|
|
|
|
spacing: 10
|
|
|
|
Button {
|
2023-04-24 00:14:52 -04:00
|
|
|
contentItem: Text {
|
|
|
|
color: theme.textColor
|
|
|
|
text: qsTr("Enable")
|
|
|
|
}
|
2023-04-14 14:44:28 -04:00
|
|
|
background: Rectangle {
|
2023-04-23 09:42:35 -04:00
|
|
|
border.color: theme.backgroundLightest
|
2023-04-14 14:44:28 -04:00
|
|
|
border.width: 1
|
|
|
|
radius: 10
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundLight
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
Accessible.description: qsTr("Enable opt-in button")
|
|
|
|
|
|
|
|
padding: 15
|
|
|
|
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
|
|
|
}
|
|
|
|
Button {
|
2023-04-24 00:14:52 -04:00
|
|
|
contentItem: Text {
|
|
|
|
color: theme.textColor
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
}
|
2023-04-14 14:44:28 -04:00
|
|
|
background: Rectangle {
|
2023-04-23 09:42:35 -04:00
|
|
|
border.color: theme.backgroundLightest
|
2023-04-14 14:44:28 -04:00
|
|
|
border.width: 1
|
|
|
|
radius: 10
|
2023-04-23 09:42:35 -04:00
|
|
|
color: theme.backgroundLight
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
Accessible.description: qsTr("Cancel opt-in button")
|
|
|
|
|
|
|
|
padding: 15
|
|
|
|
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onAccepted: {
|
2023-05-02 20:31:17 -04:00
|
|
|
if (Network.isActive)
|
|
|
|
return
|
2023-04-14 14:44:28 -04:00
|
|
|
Network.isActive = true;
|
2023-05-02 20:31:17 -04:00
|
|
|
Network.sendNetworkToggled(true);
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
onRejected: {
|
2023-05-02 20:31:17 -04:00
|
|
|
if (!Network.isActive)
|
|
|
|
return
|
2023-04-14 14:44:28 -04:00
|
|
|
Network.isActive = false;
|
2023-05-02 20:31:17 -04:00
|
|
|
Network.sendNetworkToggled(false);
|
2023-04-14 14:44:28 -04:00
|
|
|
}
|
|
|
|
}
|