update predict.py to write to file