mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-08-03 09:09:07 +00:00
Use a global constant and remove a debug line.
This commit is contained in:
parent
eecf351c64
commit
59ed2a0bea
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
//#define USE_LOCAL_MODELSJSON
|
//#define USE_LOCAL_MODELSJSON
|
||||||
|
|
||||||
|
#define DEFAULT_EMBEDDING_MODEL "all-MiniLM-L6-v2-f16.gguf"
|
||||||
|
|
||||||
QString ModelInfo::id() const
|
QString ModelInfo::id() const
|
||||||
{
|
{
|
||||||
return m_id;
|
return m_id;
|
||||||
@ -153,7 +155,7 @@ bool EmbeddingModels::filterAcceptsRow(int sourceRow,
|
|||||||
{
|
{
|
||||||
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
|
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||||
bool isInstalled = sourceModel()->data(index, ModelList::InstalledRole).toBool();
|
bool isInstalled = sourceModel()->data(index, ModelList::InstalledRole).toBool();
|
||||||
bool isEmbedding = sourceModel()->data(index, ModelList::FilenameRole).toString() == "all-MiniLM-L6-v2-f16.gguf";
|
bool isEmbedding = sourceModel()->data(index, ModelList::FilenameRole).toString() == DEFAULT_EMBEDDING_MODEL;
|
||||||
return isInstalled && isEmbedding;
|
return isInstalled && isEmbedding;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,7 +333,7 @@ int ModelList::defaultEmbeddingModelIndex() const
|
|||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
for (int i = 0; i < m_models.size(); ++i) {
|
for (int i = 0; i < m_models.size(); ++i) {
|
||||||
const ModelInfo *info = m_models.at(i);
|
const ModelInfo *info = m_models.at(i);
|
||||||
const bool isEmbedding = info->filename() == "all-MiniLM-L6-v2-f16.gguf";
|
const bool isEmbedding = info->filename() == DEFAULT_EMBEDDING_MODEL;
|
||||||
if (isEmbedding) return i;
|
if (isEmbedding) return i;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -24,7 +24,6 @@ MyDialog {
|
|||||||
if (showEmbeddingModels) {
|
if (showEmbeddingModels) {
|
||||||
ModelList.downloadableModels.expanded = true
|
ModelList.downloadableModels.expanded = true
|
||||||
var targetModelIndex = ModelList.defaultEmbeddingModelIndex
|
var targetModelIndex = ModelList.defaultEmbeddingModelIndex
|
||||||
console.log("targetModelIndex " + targetModelIndex)
|
|
||||||
modelListView.positionViewAtIndex(targetModelIndex, ListView.Contain)
|
modelListView.positionViewAtIndex(targetModelIndex, ListView.Contain)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user