zeno-ml / zeno-build

Build, evaluate, understand, and fix LLM-based apps
MIT License
480 stars 33 forks source link

Backend: Caching decorator #15

Closed neubig closed 1 year ago

neubig commented 1 year ago

We have caching utils: https://github.com/zeno-ml/llm-compare/blob/main/llm_compare/cache_utils.py

But using them can be a bit verbose and opaque.

It would be nice if we could add a decorator like this:

@cache_utils.cache_function("text_classification", load_model)

where the first argument is the task name, and the second argument is the function used to load from the cached files.

neubig commented 1 year ago

This might not be worth the effort now.