Solved it, it was due to vs code issue. There was an issue with the progress bar in jupyter notebook but the code was running successfully in the background.
This thread Using Visual Studio Code with fastai (VSCode bug) - Part 1 (2020) - fast.ai Course Forums helped to solve the problem
tl;dr Add this to your code
from IPython.display import clear_output, DisplayHandle
def update_patch(self, obj):
clear_output(wait=True)
self.display(obj)
DisplayHandle.update = update_patch