Skip to content

added --ignore_existing_predictions flag to run_model.py to overwrite existing predictions#48

Merged
agentmorris merged 2 commits intomainfrom
ignore-existing-predictions
Nov 13, 2025
Merged

added --ignore_existing_predictions flag to run_model.py to overwrite existing predictions#48
agentmorris merged 2 commits intomainfrom
ignore-existing-predictions

Conversation

@agentmorris
Copy link
Collaborator

added --ignore_existing_predictions flag to run_model.py to overwrite existing predictions

# are reprocessed from scratch.
if local_file_exists(_PREDICTIONS_JSON.value):
print(f"Deleting existing predictions in `{_PREDICTIONS_JSON.value}`.")
Path(_PREDICTIONS_JSON.value).unlink()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we make a backup instead of deleting the file? I can see myself making this dangerous mistake and lose previous work.

@agentmorris
Copy link
Collaborator Author

Re: backup... I think you got this, but for anyone reading this in the future, clarifying that the default is still not to overwrite, you have to add this option explicitly to delete existing predictions. For my use cases, I really want the predictions to go away forever, this is primarily about minimizing confusion. So making a backup makes the problem marginally worse for me.

Another option is to change this from a boolean parameter to something like "--overwrite_behavior", which could be:

  • "resume" (default, and current behavior)
  • "overwrite" (aka delete, aka what this new option does)
  • "error" (throw an error)
  • "backup" (your suggestion, although if we have an "error" option I don't think this is necessary)

This approach is fine with me, I'm 50/50 on this vs. what I did in this PR (default resume, explicit flag to overwrite). LMK whether you prefer the --overwrite_behavior approach I'm suggesting here? If so, I'll change that (and ask for an updated review) before merging this PR.

@stefanistrate

@stefanistrate
Copy link
Collaborator

I'm fine to leave it as is. I might never use that flag, and I know it won't affect the default behaviour.

@agentmorris agentmorris merged commit 910b526 into main Nov 13, 2025
18 checks passed
@agentmorris agentmorris deleted the ignore-existing-predictions branch November 13, 2025 19:21
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