Right, I havenāt spot this issue indeed. Iāll ask around internally what can be done in this case. Note that repositories on the Hub are meant to version data and keep the history. And super_squash_commit meant to be a power-user method to reduce the number of commits but not thought it term of ādeleting previously uploaded dataā. If you do not need versioning (i.e. if you do not need past checkpoints to be stored) I can advice to store checkpoints in a temporary repository and then delete it once the āfinal checkpointsā are ready. Instead of the
api.delete_files(repo_id=repo_id, revision=branch, delete_patterns='*')
api.super_squash_history(repo_id=repo_id, branch=branch)
api.delete_branch(repo_id=repo_id, branch=branch)
you could even do something like
api.delete_repo(repo_id=repo_id)
api.create_repo(repo_id=repo_id)
api.upload_file(...)
Of course this would come with some drawbacks (total history is lost, community tab is lost, link to collections is lost etc.) but depending on your use case and workflow it can be a good workaround.