Made some changes to inference.py