Skip to content

Commit 0a49320

Browse files
aron8W9aG
andauthored
Refactor cog predict to support --json flag (#2404)
* Implement `cog predict --json` This allows `cog predict` to use JSON as the input/output format which makes it more suitable for automation such as testing. * Support writing output file to disk * Refactor to use same path for output processing * Cleanup `--output` flag * Rename write methods * Always transform outputs * Clean up display of outputs in cog predict * Preserve file extensions on `list[Path]` outputs * Only transform outputs if the prediction was successful * Exit from `cog predict` with non-zero exit code if prediction fails * DEBUG * DEBUG * Fix adding double file extension * Fix checking if the extension is an integer * Add test_predict_json_input integration test * Add more integration tests * Support - for stdin input * Use %q for output name format * Send error if prediction status fails * Fix flaky file challenge test * Fix integration tests * Remove newline * Just test output file in output mode --------- Co-authored-by: Will Sackfield <[email protected]>
1 parent c95dc88 commit 0a49320

File tree

6 files changed

+528
-89
lines changed

6 files changed

+528
-89
lines changed

0 commit comments

Comments
 (0)