From daf3e67e22e434c6117f46356196f2d935b43337 Mon Sep 17 00:00:00 2001 From: "wassname (Michael J Clark)" <1103714+wassname@users.noreply.github.com> Date: Fri, 15 May 2026 13:57:27 +0800 Subject: [PATCH 1/2] Update README.md --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index 2b8884f..44cbbd1 100644 --- a/README.md +++ b/README.md @@ -21,18 +21,11 @@ uv add git+https://github.com/wassname/minicache.git from minicache import cached, cache_call # 1. Decorator: hashes (state, included args). Excludes drop out of key. -@cached("eval", cachedir="out/cache", - state_fn=lambda *, model_id, **_: f"{model_id}|nf4|r00+r02", - exclude=["model", "tok"]) +@cached(exclude=["model", "tok"]) def run_eval(model, tok, *, model_id, name, batch_size): return tinymfv_evaluate(model, tok, name=name, batch_size=batch_size) report = run_eval(model, tok, model_id="qwen-27b", name="classic", batch_size=16) - -# 2. Explicit key: no introspection, you compose the key -key = "qwen-27b|nf4|r00+r02|eval|classic|bs=16" -report = cache_call("eval", key, lambda: tinymfv_evaluate(model, tok, ...), - cachedir="out/cache") ``` See also From 4e93666041b55e14003be71d294a0b17e240f6d6 Mon Sep 17 00:00:00 2001 From: "wassname (Michael J Clark)" <1103714+wassname@users.noreply.github.com> Date: Fri, 15 May 2026 13:59:10 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 44cbbd1..b4a17e7 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,15 @@ uv add git+https://github.com/wassname/minicache.git ```py from minicache import cached, cache_call -# 1. Decorator: hashes (state, included args). Excludes drop out of key. -@cached(exclude=["model", "tok"]) +@cached(exclude=["model", "tok"]) # can't hash model or tokenizer, but model_id will substitute def run_eval(model, tok, *, model_id, name, batch_size): return tinymfv_evaluate(model, tok, name=name, batch_size=batch_size) report = run_eval(model, tok, model_id="qwen-27b", name="classic", batch_size=16) +# 30 minutes + +report = run_eval(model, tok, model_id="qwen-27b", name="classic", batch_size=16) +# 0 minutes, gives saved results ``` See also