Skip to content

Commit f07b6f2

Browse files
koaningrmitsch
andauthored
Update README.md (#190)
* Update README.md * Update README.md * Update README.md --------- Co-authored-by: Raphael Mitsch <r.mitsch@outlook.com>
1 parent 55fea5f commit f07b6f2

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,8 @@ by setting the environmental variable `HF_HOME`.
994994

995995
Interacting with LLMs, either through an external API or a local instance, is costly.
996996
Since developing an NLP pipeline generally means a lot of exploration and prototyping,
997-
`spacy-llm` implements a built-in cache to avoid reprocessing the same documents at each run.
997+
`spacy-llm` implements a built-in cache to avoid reprocessing the same documents at each run
998+
that keeps batches of documents stored on disk.
998999

9991000
Example config block:
10001001

@@ -1006,11 +1007,14 @@ batch_size = 64
10061007
max_batches_in_mem = 4
10071008
```
10081009

1009-
| Argument | Type | Default | Description |
1010-
| -------------------- | ---------------------------- | ------- | ---------------------------------------------------- |
1011-
| `path` | `Optional[Union[str, Path]]` | `None` | Cache directory. If `None`, no caching is performed. |
1012-
| `batch_size` | `int` | 64 | Number of docs in one batch (file). |
1013-
| `max_batches_in_mem` | `int` | 4 | Max. number of batches to hold in memory. |
1010+
| Argument | Type | Default | Description |
1011+
| -------------------- | ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- |
1012+
| `path` | `Optional[Union[str, Path]]` | `None` | Cache directory. If `None`, no caching is performed, and this component will act as a NoOp. |
1013+
| `batch_size` | `int` | 64 | Number of docs in one batch (file). Once a batch is full, it will be peristed to disk. |
1014+
| `max_batches_in_mem` | `int` | 4 | Max. number of batches to hold in memory. Allows you to limit the effect on your memory if you're handling a lot of docs. |
1015+
1016+
When retrieving a document, the `BatchCache` will first figure out what batch the document belongs to. If the batch
1017+
isn't in memory it will try to load the batch from disk and then move it into memory.
10141018

10151019
Note that since the cache is generated by a registered function, you can also provide your own registered function
10161020
returning your own cache implementation. If you wish to do so, ensure that your cache object adheres to the

0 commit comments

Comments
 (0)