Skip to content

Commit

Permalink
no cache debug logging when not used
Browse files Browse the repository at this point in the history
  • Loading branch information
baberabb committed Jan 4, 2025
1 parent 45006a2 commit 0d42931
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lm_eval/api/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def build_all_requests(
)
cache_key += f"-tokenizer{tokenizer_name}"

cached_instances = load_from_cache(file_name=cache_key)
cached_instances = load_from_cache(file_name=cache_key, cache=cache_requests)

if cache_requests and cached_instances and not rewrite_requests_cache:
cached_instances = cached_instances[:limit]
Expand Down
4 changes: 3 additions & 1 deletion lm_eval/caching/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
FILE_SUFFIX = f".{HASH_PREFIX}.pickle"


def load_from_cache(file_name):
def load_from_cache(file_name: str, cache: bool = False):
if not cache:
return
try:
path = f"{PATH}/{file_name}{FILE_SUFFIX}"

Expand Down

0 comments on commit 0d42931

Please sign in to comment.