mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-10 04:49:07 +00:00
Add Nomic Embed model for atlas with localdocs.
This commit is contained in:
@@ -48,6 +48,8 @@ QVariant LocalDocsModel::data(const QModelIndex &index, int role) const
|
||||
return item.installed;
|
||||
case IndexingRole:
|
||||
return item.indexing;
|
||||
case ErrorRole:
|
||||
return item.error;
|
||||
case CurrentDocsToIndexRole:
|
||||
return item.currentDocsToIndex;
|
||||
case TotalDocsToIndexRole:
|
||||
@@ -56,6 +58,10 @@ QVariant LocalDocsModel::data(const QModelIndex &index, int role) const
|
||||
return quint64(item.currentBytesToIndex);
|
||||
case TotalBytesToIndexRole:
|
||||
return quint64(item.totalBytesToIndex);
|
||||
case CurrentEmbeddingsToIndexRole:
|
||||
return quint64(item.currentEmbeddingsToIndex);
|
||||
case TotalEmbeddingsToIndexRole:
|
||||
return quint64(item.totalEmbeddingsToIndex);
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
@@ -68,10 +74,13 @@ QHash<int, QByteArray> LocalDocsModel::roleNames() const
|
||||
roles[FolderPathRole] = "folder_path";
|
||||
roles[InstalledRole] = "installed";
|
||||
roles[IndexingRole] = "indexing";
|
||||
roles[ErrorRole] = "error";
|
||||
roles[CurrentDocsToIndexRole] = "currentDocsToIndex";
|
||||
roles[TotalDocsToIndexRole] = "totalDocsToIndex";
|
||||
roles[CurrentBytesToIndexRole] = "currentBytesToIndex";
|
||||
roles[TotalBytesToIndexRole] = "totalBytesToIndex";
|
||||
roles[CurrentEmbeddingsToIndexRole] = "currentEmbeddingsToIndex";
|
||||
roles[TotalEmbeddingsToIndexRole] = "totalEmbeddingsToIndex";
|
||||
return roles;
|
||||
}
|
||||
|
||||
@@ -101,6 +110,12 @@ void LocalDocsModel::updateIndexing(int folder_id, bool b)
|
||||
[](CollectionItem& item, bool val) { item.indexing = val; }, {IndexingRole});
|
||||
}
|
||||
|
||||
void LocalDocsModel::updateError(int folder_id, const QString &error)
|
||||
{
|
||||
updateField<QString>(folder_id, error,
|
||||
[](CollectionItem& item, QString val) { item.error = val; }, {ErrorRole});
|
||||
}
|
||||
|
||||
void LocalDocsModel::updateCurrentDocsToIndex(int folder_id, size_t currentDocsToIndex)
|
||||
{
|
||||
updateField<size_t>(folder_id, currentDocsToIndex,
|
||||
@@ -131,6 +146,18 @@ void LocalDocsModel::updateTotalBytesToIndex(int folder_id, size_t totalBytesToI
|
||||
[](CollectionItem& item, size_t val) { item.totalBytesToIndex = val; }, {TotalBytesToIndexRole});
|
||||
}
|
||||
|
||||
void LocalDocsModel::updateCurrentEmbeddingsToIndex(int folder_id, size_t currentEmbeddingsToIndex)
|
||||
{
|
||||
updateField<size_t>(folder_id, currentEmbeddingsToIndex,
|
||||
[](CollectionItem& item, size_t val) { item.currentEmbeddingsToIndex += val; }, {CurrentEmbeddingsToIndexRole});
|
||||
}
|
||||
|
||||
void LocalDocsModel::updateTotalEmbeddingsToIndex(int folder_id, size_t totalEmbeddingsToIndex)
|
||||
{
|
||||
updateField<size_t>(folder_id, totalEmbeddingsToIndex,
|
||||
[](CollectionItem& item, size_t val) { item.totalEmbeddingsToIndex += val; }, {TotalEmbeddingsToIndexRole});
|
||||
}
|
||||
|
||||
void LocalDocsModel::addCollectionItem(const CollectionItem &item)
|
||||
{
|
||||
beginInsertRows(QModelIndex(), m_collectionList.size(), m_collectionList.size());
|
||||
|
Reference in New Issue
Block a user