Skip to content

cog predict does not download a file when I return its Path specifying its extension #207

Description

@ericguizzo

cog predict does not download a file if I explicitly write the extension in the name of the output Path (I am under Mac OS).

Example:

    Inside predict function:
    output_path = Path(tempfile.mkdtemp()) / "output.txt"
    with open(str(output_path), "w") as f:
        f.write("hello")
    return output_path 

This only prints the file's content on the terminal and does not download it.
But if I remove the ".txt" from the filename the download works, but the file is a .bin and it does not contain the text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions