Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash with chatgpt and gpu layers. #2003

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gpt4all-chat/modellist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ void ModelInfo::setGpuLayers(int l)

int ModelInfo::maxGpuLayers() const
{
if (isOnline) return -1;
if (m_maxGpuLayers != -1) return m_maxGpuLayers;
auto path = (dirpath + filename()).toStdString();
int layers = LLModel::Implementation::layerCount(path);
Expand Down
32 changes: 16 additions & 16 deletions gpt4all-chat/qml/ModelSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ MySettingsTab {
}

MySettingsLabel {
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: qsTr("System Prompt")
Layout.row: 6
Layout.column: 0
Expand All @@ -163,7 +163,7 @@ MySettingsTab {

Rectangle {
id: systemPrompt
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
Layout.row: 7
Layout.column: 0
Layout.columnSpan: 2
Expand Down Expand Up @@ -317,14 +317,14 @@ MySettingsTab {

MySettingsLabel {
id: contextLengthLabel
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: qsTr("Context Length")
Layout.row: 0
Layout.column: 0
}
MyTextField {
id: contextLengthField
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: root.currentModelInfo.contextLength
font.pixelSize: theme.fontSizeLarge
color: theme.textColor
Expand Down Expand Up @@ -454,14 +454,14 @@ MySettingsTab {
}
MySettingsLabel {
id: topKLabel
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: qsTr("Top K")
Layout.row: 2
Layout.column: 2
}
MyTextField {
id: topKField
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: root.currentModelInfo.topK
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Expand Down Expand Up @@ -499,14 +499,14 @@ MySettingsTab {
}
MySettingsLabel {
id: maxLengthLabel
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: qsTr("Max Length")
Layout.row: 0
Layout.column: 2
}
MyTextField {
id: maxLengthField
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: root.currentModelInfo.maxLength
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Expand Down Expand Up @@ -545,14 +545,14 @@ MySettingsTab {

MySettingsLabel {
id: batchSizeLabel
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: qsTr("Prompt Batch Size")
Layout.row: 1
Layout.column: 0
}
MyTextField {
id: batchSizeField
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: root.currentModelInfo.promptBatchSize
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Expand Down Expand Up @@ -590,14 +590,14 @@ MySettingsTab {
}
MySettingsLabel {
id: repeatPenaltyLabel
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: qsTr("Repeat Penalty")
Layout.row: 3
Layout.column: 0
}
MyTextField {
id: repeatPenaltyField
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: root.currentModelInfo.repeatPenalty
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Expand Down Expand Up @@ -635,14 +635,14 @@ MySettingsTab {
}
MySettingsLabel {
id: repeatPenaltyTokensLabel
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: qsTr("Repeat Penalty Tokens")
Layout.row: 3
Layout.column: 2
}
MyTextField {
id: repeatPenaltyTokenField
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: root.currentModelInfo.repeatPenaltyTokens
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Expand Down Expand Up @@ -681,14 +681,14 @@ MySettingsTab {

MySettingsLabel {
id: gpuLayersLabel
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: qsTr("GPU Layers")
Layout.row: 4
Layout.column: 0
}
MyTextField {
id: gpuLayersField
visible: !root.currentModelInfo.isChatGPT
visible: !root.currentModelInfo.isOnline
text: root.currentModelInfo.gpuLayers
font.pixelSize: theme.fontSizeLarge
color: theme.textColor
Expand Down
Loading