Skip to content

Create missing request-cache parent directories - #4047

Merged
baberabb merged 1 commit into
EleutherAI:mainfrom
sdivyanshu90:fix-request-cache-nested-path
Aug 27, 2026
Merged

baberabb merged 1 commit into
EleutherAI:mainfrom
sdivyanshu90:fix-request-cache-nested-path

Conversation

@sdivyanshu90

Copy link
Copy Markdown
Contributor

Summary

  • recursively create the configured request-cache directory before saving
  • accept an already existing cache directory without a check-then-create race
  • add regression coverage for saving and loading through a nested path with missing parents

Testing

PYTHONPATH=/tmp/lm-eval-test-deps:/tmp python3 -m pytest tests/test_cache.py -q
6 passed

PRE_COMMIT_HOME=/tmp/lm-eval-pre-commit pre-commit run --files lm_eval/caching/cache.py tests/test_cache.py
All hooks passed

Fixes #4046

@baberabb baberabb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@baberabb
baberabb merged commit d8c6672 into EleutherAI:main Aug 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request-cache creation fails when parent directories are absent

2 participants