Skip to content

Skip cache() when there is no dvc repo - #908

Open
raimbekovm wants to merge 3 commits into
treeverse:mainfrom
raimbekovm:fix/cache-without-dvc-repo
Open

raimbekovm wants to merge 3 commits into
treeverse:mainfrom
raimbekovm:fix/cache-without-dvc-repo

Conversation

@raimbekovm

@raimbekovm raimbekovm commented Oct 21, 2026 •

Copy link
Copy Markdown

summary

  • Live.cache() dereferenced self._dvc_repo without checking it, but get_dvc_repo() returns None outside a git repo. Live(cache_images=True) + log_image() + end() in a plain directory (colab, kaggle, any non-git cwd) raised AttributeError: 'NoneType' object has no attribute 'add' from end(), which catch_and_warn(DvcException) does not catch.
  • cache() now warns and returns when there is no dvc repo, the same way log_artifact() already does. integrations that pass cache_images=True no longer fail at the end of training outside git.

measured

Live(cache_images=True) + log_image() + end() before after
cwd outside git AttributeError from end() warning, image kept on disk, no images.dvc
git + dvc init (test_cache_images[True]) images.dvc written unchanged

full suite: 255 passed; the 2 test_huggingface_log_model[DVCLiveCallback1-*-True] failures (Trainer.__init__() got an unexpected keyword argument 'tokenizer') also fail on main.

@github-project-automation github-project-automation Bot moved this to Backlog in DVC Oct 21, 2026
@CLAassistant

CLAassistant commented Oct 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
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.

2 participants