Local inference using weights

In fastai1, we can use below to load class structure without the actual data before performing inference

ImageDataBunch.single_from_classes(‘weights’, classes, ds_tfms=None, size=224)

What’s the equivalent in fastai2 ?
Or is there a simple way to load a pth file and then use for prediction