input handling: accommodate stdin at prediction time