allenai / papermage

library supporting NLP and CV research on scientific papers
https://papermage.org
Apache License 2.0
692 stars 54 forks source link

Format and update decontext #37

Closed bnewm0609 closed 1 year ago

bnewm0609 commented 1 year ago

For API SpanQA, you can clear the cache with: span_qa_predictor.retrieval_qa_step.model.cache.remove_all_unsafe_no_confirm.

You can also invalidate the cache for a prediction with:

from decontext.cache import CacheState

span_qa_predictor.retrieval_qa_step.cache_state=CacheState.INVALIDATE

before running span_qa_predictor.run.

See the decontext README for more information on how to use CacheState