gpt4all
115 строк · 4.1 Кб
1import QtCore
2import QtQuick
3import QtQuick.Controls
4import QtQuick.Controls.Basic
5import QtQuick.Layouts
6import download
7import network
8import llm
9import mysettings
10
11MyDialog {
12id: networkDialog
13anchors.centerIn: parent
14modal: true
15padding: 20
16
17Theme {
18id: theme
19}
20
21Column {
22id: column
23spacing: 20
24Item {
25width: childrenRect.width
26height: childrenRect.height
27Image {
28id: img
29anchors.top: parent.top
30anchors.left: parent.left
31width: 60
32height: 60
33source: "qrc:/gpt4all/icons/logo.svg"
34}
35Text {
36anchors.left: img.right
37anchors.leftMargin: 30
38anchors.verticalCenter: img.verticalCenter
39text: qsTr("Contribute data to the GPT4All Opensource Datalake.")
40color: theme.textColor
41font.pixelSize: theme.fontSizeLarge
42}
43}
44
45ScrollView {
46clip: true
47height: 300
48width: 1024 - 40
49ScrollBar.vertical.policy: ScrollBar.AlwaysOn
50ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
51
52MyTextArea {
53id: textOptIn
54width: 1024 - 40
55text: 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.
56
57When 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.
58
59NOTE: 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!")
60focus: false
61readOnly: true
62Accessible.role: Accessible.Paragraph
63Accessible.name: qsTr("Terms for opt-in")
64Accessible.description: qsTr("Describes what will happen when you opt-in")
65}
66}
67
68MyTextField {
69id: attribution
70width: parent.width
71text: MySettings.networkAttribution
72placeholderText: qsTr("Please provide a name for attribution (optional)")
73Accessible.role: Accessible.EditableText
74Accessible.name: qsTr("Attribution (optional)")
75Accessible.description: qsTr("Provide attribution")
76onEditingFinished: {
77MySettings.networkAttribution = attribution.text;
78}
79}
80}
81
82footer: DialogButtonBox {
83id: dialogBox
84padding: 20
85alignment: Qt.AlignRight
86spacing: 10
87MySettingsButton {
88text: qsTr("Enable")
89Accessible.description: qsTr("Enable opt-in")
90DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
91}
92MySettingsButton {
93text: qsTr("Cancel")
94Accessible.description: qsTr("Cancel opt-in")
95DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
96}
97background: Rectangle {
98color: "transparent"
99}
100}
101
102onAccepted: {
103if (MySettings.networkIsActive)
104return
105MySettings.networkIsActive = true;
106Network.sendNetworkToggled(true);
107}
108
109onRejected: {
110if (!MySettings.networkIsActive)
111return
112MySettings.networkIsActive = false;
113Network.sendNetworkToggled(false);
114}
115}
116