Enable Automatic Prefix Caching (APC) for Bespoke-MiniCheck-7B
mainWhen using the Bespoke-MiniCheck-7B model, you can enable Automatic Prefix Caching (APC) to significantly increase throughput and reduce latency. APC works by caching the KV cache of a document; if you check multiple different claims against the same document, the model reuses the cached document prefix instead of recomputing it.
To enable this, set enable_prefix_caching=True during initialization.
# Enable APC for faster inference when reusing the same document
scorer = MiniCheck(model_name='Bespoke-MiniCheck-7B', enable_prefix_caching=True, cache_dir='./ckpts')