Skip to content

Fix sample cache path for local model directories - #1434

Open
Tialo wants to merge 1 commit into
huggingface:mainfrom
Tialo:fix/sample-cache-local-model-path
Open

Tialo wants to merge 1 commit into
huggingface:mainfrom
Tialo:fix/sample-cache-local-model-path

Conversation

@Tialo

@Tialo Tialo commented Oct 18, 2026

Copy link
Copy Markdown

When a model is stored in a read-only directory, LightEval raises a PermissionError because it tries to write the cache inside the model directory.

This happens because of the current cache path construction:

Path(os.path.expanduser(self.model_config.cache_dir)) / self.model_config.model_name / self.model_hash

If model_name is an absolute path like /path/to/model, pathlib discards the preceding cache directory, resulting in writes to the model directory.

This PR fixes the issue by using the existing _simplify_name() function when constructing the cache path.

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.

1 participant