When run in interactive mode, inference would stall because sys.stdin.isatty() returns True however no input is actually ever piped to the subprocess. The solution is to add another commandline argument, --interactive that serves as a flag that the process is being run interactively and shouldn't (indefinitely) try reading from stdin:
if (
not self.interactive
and not sys.stdin.isatty()
and (text := sys.stdin.read()) != ''
):
When Raster.inference runs the subprocess, the new arguments are:
When run in interactive mode, inference would stall because
sys.stdin.isatty()
returns True however no input is actually ever piped to the subprocess. The solution is to add another commandline argument,--interactive
that serves as a flag that the process is being run interactively and shouldn't (indefinitely) try reading from stdin:When
Raster.inference
runs the subprocess, the new arguments are: