Hi, Does metaflow have any logic if it is in a re...
# ask-metaflow
f
Hi, Does metaflow have any logic if it is in a retry? Ideally I want something like
Copy code
class TrainFlow(FlowSpec):
    use_latest_check_point = Parameter("use_latest_check_point", default=False)
    @step
    def start(self):
        …
    @retry(times=1)
    @step
    def train(self):
        if self.retry == 1:
            # This step has failed and is now in a retry
            self.use_latest_check_point = True

        train(use_latest_check_point=self.use_latest_check_point)
1
d
Hello. Yes and no. It does not (yet) have auto support for checkpoints but what you want to do in your piece of code is supported. You can use the current object which has origin_run_id for example which tells you if this is a resume or retry_count to get specifically the retry count you are looking for. You can then use your own logic for the check pointing thing. Note though that parameters are read only so you need to use a regular artifact.
Yep.
f
Thanks!