mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-08-28 05:25:04 +00:00
refactor(memory_store): simplify list comprehension expressions
This commit is contained in:
parent
bb0c2df97d
commit
40eddf442a
1 changed files with 2 additions and 4 deletions
|
|
@ -185,8 +185,7 @@ class LocalMemoryStore(BaseMemoryStore):
|
|||
for source_key, source_meta in self._files.items():
|
||||
if path in source_meta:
|
||||
source_meta[path].chunk_count = sum(
|
||||
1 for chunk in self._chunks.values()
|
||||
if chunk.path == path and chunk.source.value == source_key
|
||||
1 for chunk in self._chunks.values() if chunk.path == path and chunk.source.value == source_key
|
||||
)
|
||||
|
||||
async def upsert_chunks(
|
||||
|
|
@ -249,8 +248,7 @@ class LocalMemoryStore(BaseMemoryStore):
|
|||
|
||||
# Collect candidate chunks with embeddings
|
||||
candidates = [
|
||||
chunk for chunk in self._chunks.values()
|
||||
if (not sources or chunk.source in sources) and chunk.embedding
|
||||
chunk for chunk in self._chunks.values() if (not sources or chunk.source in sources) and chunk.embedding
|
||||
]
|
||||
|
||||
if not candidates:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue