mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-27 07:48:19 +00:00
Have to be able to change the download path from the download dialog and other fixes.
This commit is contained in:
parent
6f94c7e84b
commit
a6679b18bd
@ -30,7 +30,10 @@ Download::Download()
|
|||||||
&Download::handleSslErrors);
|
&Download::handleSslErrors);
|
||||||
connect(this, &Download::downloadLocalModelsPathChanged, this, &Download::updateModelList);
|
connect(this, &Download::downloadLocalModelsPathChanged, this, &Download::updateModelList);
|
||||||
updateModelList();
|
updateModelList();
|
||||||
m_downloadLocalModelsPath = defaultLocalModelsPath();
|
QSettings settings;
|
||||||
|
settings.sync();
|
||||||
|
m_downloadLocalModelsPath = settings.value("modelPath",
|
||||||
|
defaultLocalModelsPath()).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const ModelInfo& lhs, const ModelInfo& rhs) {
|
bool operator==(const ModelInfo& lhs, const ModelInfo& rhs) {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
import QtCore
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Controls.Basic
|
import QtQuick.Controls.Basic
|
||||||
|
import QtQuick.Dialogs
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import download
|
import download
|
||||||
import llm
|
import llm
|
||||||
@ -82,6 +84,7 @@ Dialog {
|
|||||||
id: description
|
id: description
|
||||||
text: " - " + modelData.description
|
text: " - " + modelData.description
|
||||||
leftPadding: 20
|
leftPadding: 20
|
||||||
|
rightPadding: 20
|
||||||
anchors.top: modelName.bottom
|
anchors.top: modelName.bottom
|
||||||
anchors.left: modelName.left
|
anchors.left: modelName.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@ -135,7 +138,8 @@ Dialog {
|
|||||||
objectName: "itemProgressBar"
|
objectName: "itemProgressBar"
|
||||||
anchors.top: modelName.top
|
anchors.top: modelName.top
|
||||||
anchors.right: downloadButton.left
|
anchors.right: downloadButton.left
|
||||||
padding: 20
|
anchors.topMargin: 20
|
||||||
|
anchors.rightMargin: 20
|
||||||
width: 100
|
width: 100
|
||||||
visible: downloading
|
visible: downloading
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
@ -153,7 +157,7 @@ Dialog {
|
|||||||
width: itemProgressBar.visualPosition * parent.width
|
width: itemProgressBar.visualPosition * parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
radius: 2
|
radius: 2
|
||||||
color: theme.backgroundLightest
|
color: theme.assistantColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Accessible.role: Accessible.ProgressBar
|
Accessible.role: Accessible.ProgressBar
|
||||||
@ -211,7 +215,8 @@ Dialog {
|
|||||||
}
|
}
|
||||||
anchors.top: modelName.top
|
anchors.top: modelName.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
padding: 20
|
anchors.topMargin: 15
|
||||||
|
anchors.rightMargin: 20
|
||||||
visible: !modelData.installed && !modelData.calcHash
|
visible: !modelData.installed && !modelData.calcHash
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!downloading) {
|
if (!downloading) {
|
||||||
@ -303,16 +308,72 @@ Dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
property string defaultModelPath: Download.defaultLocalModelsPath()
|
||||||
Layout.alignment: Qt.AlignLeft
|
property alias modelPath: settings.modelPath
|
||||||
|
Settings {
|
||||||
|
id: settings
|
||||||
|
property string modelPath: settingsDialog.defaultModelPath
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
Download.downloadLocalModelsPath = settings.modelPath
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
settings.sync()
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr("NOTE: models will be downloaded to\n") + Download.downloadLocalModelsPath
|
spacing: 20
|
||||||
wrapMode: Text.WrapAnywhere
|
FolderDialog {
|
||||||
|
id: modelPathDialog
|
||||||
|
title: "Please choose a directory"
|
||||||
|
onAccepted: {
|
||||||
|
Download.downloadLocalModelsPath = selectedFolder
|
||||||
|
settings.modelPath = Download.downloadLocalModelsPath
|
||||||
|
settings.sync()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
id: modelPathLabel
|
||||||
|
text: qsTr("Download path:")
|
||||||
|
color: theme.textColor
|
||||||
|
Layout.row: 1
|
||||||
|
Layout.column: 0
|
||||||
|
}
|
||||||
|
TextField {
|
||||||
|
id: modelPathDisplayLabel
|
||||||
|
text: Download.downloadLocalModelsPath
|
||||||
|
readOnly: true
|
||||||
|
color: theme.textColor
|
||||||
|
Layout.fillWidth: true
|
||||||
|
ToolTip.text: qsTr("Path where model files will be downloaded to")
|
||||||
|
ToolTip.visible: hovered
|
||||||
|
Accessible.role: Accessible.ToolTip
|
||||||
|
Accessible.name: modelPathDisplayLabel.text
|
||||||
|
Accessible.description: ToolTip.text
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
text: qsTr("Browse")
|
||||||
|
contentItem: Text {
|
||||||
|
text: qsTr("Browse")
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
color: theme.textColor
|
color: theme.textColor
|
||||||
Accessible.role: Accessible.Paragraph
|
Accessible.role: Accessible.Button
|
||||||
Accessible.name: qsTr("Model download path")
|
Accessible.name: text
|
||||||
Accessible.description: qsTr("The path where downloaded models will be saved.")
|
Accessible.description: qsTr("Opens a folder picker dialog to choose where to save model files")
|
||||||
|
}
|
||||||
|
background: Rectangle {
|
||||||
|
opacity: .5
|
||||||
|
border.color: theme.backgroundLightest
|
||||||
|
border.width: 1
|
||||||
|
radius: 10
|
||||||
|
color: theme.backgroundLight
|
||||||
|
}
|
||||||
|
onClicked: modelPathDialog.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@ import llm
|
|||||||
Dialog {
|
Dialog {
|
||||||
id: settingsDialog
|
id: settingsDialog
|
||||||
modal: true
|
modal: true
|
||||||
|
width: 1024
|
||||||
height: 600
|
height: 600
|
||||||
width: 600
|
|
||||||
opacity: 0.9
|
opacity: 0.9
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -537,7 +537,7 @@ The prompt below is a question to answer, a task to complete, or a conversation
|
|||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
id: modelPathLabel
|
id: modelPathLabel
|
||||||
text: qsTr("Model file path:")
|
text: qsTr("Download path:")
|
||||||
color: theme.textColor
|
color: theme.textColor
|
||||||
Layout.row: 1
|
Layout.row: 1
|
||||||
Layout.column: 0
|
Layout.column: 0
|
||||||
@ -550,10 +550,11 @@ The prompt below is a question to answer, a task to complete, or a conversation
|
|||||||
implicitWidth: 300
|
implicitWidth: 300
|
||||||
Layout.row: 1
|
Layout.row: 1
|
||||||
Layout.column: 1
|
Layout.column: 1
|
||||||
|
Layout.fillWidth: true
|
||||||
ToolTip.text: qsTr("Path where model files will be downloaded to")
|
ToolTip.text: qsTr("Path where model files will be downloaded to")
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
Accessible.role: Accessible.ToolTip
|
Accessible.role: Accessible.ToolTip
|
||||||
Accessible.name: topKLabel.text
|
Accessible.name: modelPathDisplayLabel.text
|
||||||
Accessible.description: ToolTip.text
|
Accessible.description: ToolTip.text
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
|
@ -19,6 +19,7 @@ Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property alias response: thumbsDownNewResponse.text
|
property alias response: thumbsDownNewResponse.text
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 20
|
spacing: 20
|
||||||
|
Loading…
Reference in New Issue
Block a user