Nan Qin

03/20/2023, 3:23 PM
Hi, a question about using FlyteFile: I have two tasks (t1 & t2) in a workflow:
def t1() -> FlyteFile:
    # do something and save checkpoint to path/to/file
    return FlyteFile("path/to/file")

def t2(input: FlyteFile) -> float:
    checkpoint = torch.load(input)
    # do something
    return 1.0

def wf() -> float:
    t1_output = t1()
    return t2(t1_output)
when executed, t1 output is stored in S3. In t2 I get the following error
[Errno 2] No such file or directory: '/tmp/flytemlfm4mk1/local_flytekit/0569821759669848f705b8863309a4bb/checkpoint-epoch0001.pth'
it seems flyte dowloaded the file from S3 to a local temp folder, not sure why the file does not exist. any ideas?

Michael Tinsley

03/20/2023, 3:28 PM
def t2(input: FlyteFile) -> float:
    input_path =
    checkpoint = torch.load(input_path)
    # do something
    return 1.0
Try this.. calling download on the input