Hi, a question about using FlyteFile: I have two ...
# ask-the-community
n
Hi, a question about using FlyteFile: I have two tasks (t1 & t2) in a workflow:
Copy code
@task
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

@workflow
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
Copy code
[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?
m
Copy code
def t2(input: FlyteFile) -> float:
    input_path = input.download()
    checkpoint = torch.load(input_path)
    # do something
    return 1.0
Try this.. calling download on the input
151 Views