{ "
During inference the model outputs token by token. We use this simple cache to store key's and value's attention layers, so that we don't have to recompute them for previous tokens.
\n": "\u5728\u63a8\u7406\u8fc7\u7a0b\u4e2d\uff0c\u6a21\u578b\u9010\u4e2a\u8f93\u51fa\u4ee4\u724c\u3002\u6211\u4eec\u4f7f\u7528\u8fd9\u4e2a\u7b80\u5355\u7684\u7f13\u5b58\u6765\u5b58\u50a8\u952e\u548c\u503c\u7684\u6ce8\u610f\u5c42\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u4e0d\u5fc5\u4e3a\u4ee5\u524d\u7684\u4ee4\u724c\u91cd\u65b0\u8ba1\u7b97\u5b83\u4eec\u4e86\u3002
\n", "This maintains a key-value cache and queues push values and pop them in the same order. The queues are useful since we have multiple attention layers.
\n": "\u8fd9\u5c06\u7ef4\u62a4\u4e00\u4e2a\u952e\u503c\u7f13\u5b58\uff0c\u5e76\u5c06\u63a8\u9001\u503c\u6392\u961f\u5e76\u6309\u76f8\u540c\u7684\u987a\u5e8f\u5f39\u51fa\u5b83\u4eec\u3002\u961f\u5217\u975e\u5e38\u6709\u7528\uff0c\u56e0\u4e3a\u6211\u4eec\u6709\u591a\u4e2a\u5173\u6ce8\u5c42\u3002
\n", "Returns the cache instance
\u8fd4\u56de\u7f13\u5b58\u5b9e\u4f8b
Returns the value
\u8fd4\u56de\u503c
Returns the cached value
\u8fd4\u56de\u7f13\u5b58\u7684\u503c
Returns size of the queue if exists else None
\u8fd4\u56de\u961f\u5217\u7684\u5927\u5c0f\uff08\u5982\u679c\u5b58\u5728\uff09\u5426\u5219 None
Create an empty queue if it's not present
\n": "\u5982\u679c\u961f\u5217\u4e0d\u5b58\u5728\uff0c\u8bf7\u521b\u5efa\u4e00\u4e2a\u7a7a\u961f\u5217
\n", "Push to the queue
\n": "\u63a8\u9001\u5230\u961f\u5217
\n", "Singleton for cache
\n": "\u7f13\u5b58\u7684\u5355\u4f8b
\n", "Cache for Intermediate Activations": "\u7528\u4e8e\u4e2d\u95f4\u6fc0\u6d3b\u7684\u7f13\u5b58", "Cache for intermediate activations for faster inference.": "\u7f13\u5b58\u7528\u4e8e\u4e2d\u95f4\u6fc0\u6d3b\uff0c\u4ee5\u4fbf\u66f4\u5feb\u5730\u63a8\u65ad\u3002" }