Skip to content

Commit cd02717

Browse files
committed
Add a reasoning model to models3.json and make it easily discoverable.
Signed-off-by: Adam Treat <[email protected]>
1 parent 1918a5d commit cd02717

File tree

4 files changed

+79
-2
lines changed

4 files changed

+79
-2
lines changed

gpt4all-chat/metadata/models3.json

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
[
22
{
33
"order": "a",
4+
"md5sum": "a54c08a7b90e4029a8c2ab5b5dc936aa",
5+
"name": "Reasoner v1",
6+
"filename": "qwen2.5-coder-7b-instruct-q4_0.gguf",
7+
"filesize": "4431390720",
8+
"requires": "3.5.4-dev0",
9+
"ramrequired": "8",
10+
"parameters": "8 billion",
11+
"quant": "q4_0",
12+
"type": "qwen2",
13+
"description": "<ul><li>Based on <a href=\"https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct\">Qwen2.5-Coder 7B</a></li><li>Uses built-in javascript code interpreter</li><li>Use for complex reasoning tasks that can be aided by computation analysis</li><li>License: <a href=\"https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct/blob/main/LICENSE\">Apache License Version 2.0</a></li><li>#reasoning</li></ul>",
14+
"url": "https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/main/qwen2.5-coder-7b-instruct-q4_0.gguf",
15+
"chatTemplate": "{{- '<|im_start|>system\\n' }}\n{% if toolList|length > 0 %}You have access to the following functions:\n{% for tool in toolList %}\nUse the function '{{tool.function}}' to: '{{tool.description}}'\n{% if tool.parameters|length > 0 %}\nparameters:\n{% for info in tool.parameters %}\n {{info.name}}:\n type: {{info.type}}\n description: {{info.description}}\n required: {{info.required}}\n{% endfor %}\n{% endif %}\n# Tool Instructions\nIf you CHOOSE to call this function ONLY reply with the following format:\n'{{tool.symbolicFormat}}'\nHere is an example. If the user says, '{{tool.examplePrompt}}', then you reply\n'{{tool.exampleCall}}'\nAfter the result you might reply with, '{{tool.exampleReply}}'\n{% endfor %}\nYou MUST include both the start and end tags when you use a function.\n\nYou are a helpful AI assistant who uses the functions to break down, analyze, perform, and verify complex reasoning tasks. You SHOULD try to verify your answers using the functions where possible.\n{% endif %}\n{{- '<|im_end|>\\n' }}\n{% for message in messages %}\n{{'<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n' }}\n{% endfor %}\n{% if add_generation_prompt %}\n{{ '<|im_start|>assistant\\n' }}\n{% endif %}\n",
16+
"systemPrompt": ""
17+
},
18+
{
19+
"order": "aa",
420
"md5sum": "c87ad09e1e4c8f9c35a5fcef52b6f1c9",
521
"name": "Llama 3 8B Instruct",
622
"filename": "Meta-Llama-3-8B-Instruct.Q4_0.gguf",

gpt4all-chat/qml/AddGPT4AllModelView.qml

+46
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,52 @@ ColumnLayout {
5656
Accessible.description: qsTr("Displayed when the models request is ongoing")
5757
}
5858

59+
RowLayout {
60+
ButtonGroup {
61+
id: buttonGroup
62+
exclusive: true
63+
}
64+
MyButton {
65+
text: qsTr("All")
66+
checked: true
67+
borderWidth: 0
68+
backgroundColor: checked ? theme.lightButtonBackground : "transparent"
69+
backgroundColorHovered: theme.lighterButtonBackgroundHovered
70+
backgroundRadius: 5
71+
padding: 15
72+
topPadding: 8
73+
bottomPadding: 8
74+
textColor: theme.lighterButtonForeground
75+
fontPixelSize: theme.fontSizeLarge
76+
fontPixelBold: true
77+
checkable: true
78+
ButtonGroup.group: buttonGroup
79+
onClicked: {
80+
ModelList.gpt4AllDownloadableModels.filter("");
81+
}
82+
83+
}
84+
MyButton {
85+
text: qsTr("Reasoning")
86+
borderWidth: 0
87+
backgroundColor: checked ? theme.lightButtonBackground : "transparent"
88+
backgroundColorHovered: theme.lighterButtonBackgroundHovered
89+
backgroundRadius: 5
90+
padding: 15
91+
topPadding: 8
92+
bottomPadding: 8
93+
textColor: theme.lighterButtonForeground
94+
fontPixelSize: theme.fontSizeLarge
95+
fontPixelBold: true
96+
checkable: true
97+
ButtonGroup.group: buttonGroup
98+
onClicked: {
99+
ModelList.gpt4AllDownloadableModels.filter("#reasoning");
100+
}
101+
}
102+
Layout.bottomMargin: 10
103+
}
104+
59105
ScrollView {
60106
id: scrollView
61107
ScrollBar.vertical.policy: ScrollBar.AsNeeded

gpt4all-chat/src/modellist.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,24 @@ GPT4AllDownloadableModels::GPT4AllDownloadableModels(QObject *parent)
473473
connect(this, &GPT4AllDownloadableModels::modelReset, this, &GPT4AllDownloadableModels::countChanged);
474474
}
475475

476+
void GPT4AllDownloadableModels::filter(const QVector<QString> &keywords)
477+
{
478+
m_keywords = keywords;
479+
invalidateFilter();
480+
}
481+
476482
bool GPT4AllDownloadableModels::filterAcceptsRow(int sourceRow,
477483
const QModelIndex &sourceParent) const
478484
{
479485
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
480-
bool hasDescription = !sourceModel()->data(index, ModelList::DescriptionRole).toString().isEmpty();
486+
const QString description = sourceModel()->data(index, ModelList::DescriptionRole).toString();
487+
bool hasDescription = !description.isEmpty();
481488
bool isClone = sourceModel()->data(index, ModelList::IsCloneRole).toBool();
482489
bool isDiscovered = sourceModel()->data(index, ModelList::IsDiscoveredRole).toBool();
483-
return !isDiscovered && hasDescription && !isClone;
490+
bool satisfiesKeyword = m_keywords.isEmpty();
491+
for (const QString &k : m_keywords)
492+
satisfiesKeyword = description.contains(k) ? true : satisfiesKeyword;
493+
return !isDiscovered && hasDescription && !isClone && satisfiesKeyword;
484494
}
485495

486496
int GPT4AllDownloadableModels::count() const

gpt4all-chat/src/modellist.h

+5
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,16 @@ class GPT4AllDownloadableModels : public QSortFilterProxyModel
302302
explicit GPT4AllDownloadableModels(QObject *parent);
303303
int count() const;
304304

305+
Q_INVOKABLE void filter(const QVector<QString> &keywords);
306+
305307
Q_SIGNALS:
306308
void countChanged();
307309

308310
protected:
309311
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
312+
313+
private:
314+
QVector<QString> m_keywords;
310315
};
311316

312317
class HuggingFaceDownloadableModels : public QSortFilterProxyModel

0 commit comments

Comments
 (0)