mirror of
https://github.com/tcsenpai/pensieve.git
synced 2025-06-07 03:35:24 +00:00
feat(index): use different bs for embedding
This commit is contained in:
parent
f5aae87f40
commit
241911d1d2
@ -548,6 +548,9 @@ def index(
|
|||||||
library_id: int,
|
library_id: int,
|
||||||
folders: List[int] = typer.Option(None, "--folder", "-f"),
|
folders: List[int] = typer.Option(None, "--folder", "-f"),
|
||||||
force: bool = typer.Option(False, "--force", help="Force update all indexes"),
|
force: bool = typer.Option(False, "--force", help="Force update all indexes"),
|
||||||
|
batchsize: int = typer.Option(
|
||||||
|
4, "--batchsize", "-bs", help="Number of entities to index in a batch"
|
||||||
|
),
|
||||||
):
|
):
|
||||||
print(f"Indexing library {library_id}")
|
print(f"Indexing library {library_id}")
|
||||||
|
|
||||||
@ -607,9 +610,8 @@ def index(
|
|||||||
pbar.refresh()
|
pbar.refresh()
|
||||||
|
|
||||||
# Index each entity
|
# Index each entity
|
||||||
batch_size = settings.batchsize
|
for i in range(0, len(entities), batchsize):
|
||||||
for i in range(0, len(entities), batch_size):
|
batch = entities[i : i + batchsize]
|
||||||
batch = entities[i : i + batch_size]
|
|
||||||
to_index = []
|
to_index = []
|
||||||
|
|
||||||
for entity in batch:
|
for entity in batch:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user