mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-17 17:02:09 +00:00
We can't return early here as nChunks > 0 (#3137)
Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
parent
57c0974f4a
commit
da00527101
@ -12,6 +12,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
### Changed
|
||||
- Implement Qt 6.8 compatibility ([#3121](https://github.com/nomic-ai/gpt4all/pull/3121))
|
||||
|
||||
### Fixed
|
||||
- Fix bug in GUI when localdocs encounters binary data ([#3137](https://github.com/nomic-ai/gpt4all/pull/3137))
|
||||
|
||||
## [3.4.2] - 2024-10-16
|
||||
|
||||
### Fixed
|
||||
|
@ -1355,7 +1355,8 @@ ChunkStreamer::Status ChunkStreamer::step()
|
||||
for (;;) {
|
||||
if (auto error = m_reader->getError()) {
|
||||
m_docKey.reset(); // done processing
|
||||
return *error;
|
||||
retval = *error;
|
||||
break;
|
||||
}
|
||||
|
||||
// get a word, if needed
|
||||
@ -1515,8 +1516,22 @@ void Database::handleEmbeddingsGenerated(const QVector<EmbeddingResult> &embeddi
|
||||
for (const auto &[key, stat]: std::as_const(stats).asKeyValueRange()) {
|
||||
if (!m_collectionMap.contains(key.folder_id)) continue;
|
||||
CollectionItem item = guiCollectionItem(key.folder_id);
|
||||
Q_ASSERT(item.currentEmbeddingsToIndex >= stat.nAdded + stat.nSkipped);
|
||||
if (item.currentEmbeddingsToIndex < stat.nAdded + stat.nSkipped) {
|
||||
qWarning() << "Database ERROR: underflow in current embeddings to index statistics";
|
||||
item.currentEmbeddingsToIndex = 0;
|
||||
} else {
|
||||
item.currentEmbeddingsToIndex -= stat.nAdded + stat.nSkipped;
|
||||
}
|
||||
|
||||
Q_ASSERT(item.totalEmbeddingsToIndex >= stat.nSkipped);
|
||||
if (item.totalEmbeddingsToIndex < stat.nSkipped) {
|
||||
qWarning() << "Database ERROR: underflow in total embeddings to index statistics";
|
||||
item.totalEmbeddingsToIndex = 0;
|
||||
} else {
|
||||
item.totalEmbeddingsToIndex -= stat.nSkipped;
|
||||
}
|
||||
|
||||
if (!stat.lastFile.isNull())
|
||||
item.fileCurrentlyProcessing = stat.lastFile;
|
||||
|
||||
@ -1746,7 +1761,13 @@ void Database::scanQueue()
|
||||
|
||||
dequeue:
|
||||
auto item = guiCollectionItem(folder_id);
|
||||
Q_ASSERT(item.currentBytesToIndex >= info.file.size());
|
||||
if (item.currentBytesToIndex < info.file.size()) {
|
||||
qWarning() << "Database ERROR: underflow in current bytes to index statistics";
|
||||
item.currentBytesToIndex = 0;
|
||||
} else {
|
||||
item.currentBytesToIndex -= info.file.size();
|
||||
}
|
||||
updateGuiForCollectionItem(item);
|
||||
return updateFolderToIndex(folder_id, countForFolder);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user