mellea.backends.cache
class mellea.backends.cache.Cache()
mellea.backends.cache.Cache.put(key: str, value: Any)
mellea.backends.cache.Cache.get(key: str)
None
if the id
has no cached value. May impact which cache values are evicted.
mellea.backends.cache.Cache.current_size()
class mellea.backends.cache.SimpleLRUCache(capacity: int)
SimpleLRUCache
either contains a value or it doesn’t. There is no cache hierarchy. Take care when choosing capacity
. In practice usually a small value will be fine, but ideally you should try to choose a capacity based upon your available device memory and the context size of your model.
mellea.backends.cache.SimpleLRUCache.current_size()
mellea.backends.cache.SimpleLRUCache.get(key: str)
mellea.backends.cache.SimpleLRUCache.put(key: str, value: Any)