You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use prompt template to ensure data consistency in cache directory (#192)
* Fix cache and nlp.pipe(..., as_tuples=True) (#188)
* ensure doc from cache has the same context as the passed in doc. Needed for nlp.pipe(egs, as_tuples=True)
* add test for as_tuples and nlp.pipe
* Update README.md (#189)
* Update README.md (#190)
* Update README.md
* Update README.md
* Update README.md
---------
Co-authored-by: Raphael Mitsch <r.mitsch@outlook.com>
* Fix issue of last cached element in batch not having IO data (#191)
* Fix issue of last cached element in batch not having IO data.
* Minor formatting change.
* Bump version.
* Use prompt template to ensure data consistency in cache directory.
* Fix invalid config test.
* Fix remaining test tasks without prompt_template().
* Apply suggestions from code review
Co-authored-by: Madeesh Kannan <shadeMe@users.noreply.github.com>
* Fix formatting issues.
* Replace normalization with hash.
* Add Cache.initialize().
* Update README.md
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
* Move prompt template availability to different protocol. Extend tests.
* Add section on prompt_template() in readme.
* Update spacy_llm/cache.py
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
---------
Co-authored-by: Kabir Khan <kabir@explosion.ai>
Co-authored-by: vincent d warmerdam <vincentwarmerdam@gmail.com>
Co-authored-by: Madeesh Kannan <shadeMe@users.noreply.github.com>
Co-authored-by: svlandeg <svlandeg@github.com>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
|`path`|`Optional[Union[str, Path]]`|`None`| Cache directory. If `None`, no caching is performed, and this component will act as a NoOp. |
1503
+
|`batch_size`|`int`| 64 | Number of docs in one batch (file). Once a batch is full, it will be persisted to disk. |
1504
+
|`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. |
1505
+
1506
+
When retrieving a document, the `BatchCache` will first figure out what batch the document belongs to. If the batch
1507
+
isn't in memory it will try to load the batch from disk and then move it into memory.
1494
1508
1495
1509
Note that since the cache is generated by a registered function, you can also provide your own registered function
1496
1510
returning your own cache implementation. If you wish to do so, ensure that your cache object adheres to the
0 commit comments