File tree Expand file tree Collapse file tree
src/vectorcode/subcommands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
2+ import logging
23import os
34import sys
45from asyncio import Lock
1112from vectorcode .common import get_client , get_collection , verify_ef
1213from vectorcode .subcommands .vectorise import chunked_add , show_stats
1314
15+ logger = logging .getLogger (name = __name__ )
16+
1417
1518async def update (configs : Config ) -> int :
1619 client = await get_client (configs )
@@ -49,6 +52,7 @@ async def update(configs: Config) -> int:
4952 with tqdm .tqdm (
5053 total = len (files ), desc = "Vectorising files..." , disable = configs .pipe
5154 ) as bar :
55+ logger .info (f"Updating embeddings for { len (files )} file(s)." )
5256 try :
5357 tasks = [
5458 asyncio .create_task (
@@ -73,6 +77,7 @@ async def update(configs: Config) -> int:
7377 return 1
7478
7579 if len (orphanes ):
80+ logger .info (f"Removing { len (orphanes )} orphaned files from database." )
7681 await collection .delete (where = {"path" : {"$in" : list (orphanes )}})
7782
7883 show_stats (configs , stats )
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ async def chunked_add(
6464 async with collection_lock :
6565 await collection .delete (where = {"path" : full_path_str })
6666
67+ logger .debug (f"Vectorising { file_path } " )
6768 try :
6869 async with semaphore :
6970 chunks : list [Chunk | str ] = list (
You can’t perform that action at this time.
0 commit comments