ohmeow / blurr

A library that integrates huggingface transformers with the world of fastai, giving fastai devs everything they need to train, evaluate, and deploy transformer specific models.
https://ohmeow.github.io/blurr
Apache License 2.0
289 stars 34 forks source link

`PreCalculatedMSELoss()` raises `TypeError` #69

Closed eschibli closed 2 years ago

eschibli commented 2 years ago

Calling blurr.utils.PreCalculatedMSELoss() raises the following error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_81/2999652958.py in <module>
----> 1 PreCalculatedMSELoss()

/opt/conda/lib/python3.7/site-packages/blurr/utils.py in __init__(self, axis, floatify, *args, **kwargs)
     91 class PreCalculatedMSELoss(PreCalculatedLoss):
     92     def __init__(self, *args, axis=-1, floatify=True, **kwargs):
---> 93         super.__init__(nn.MSELoss, *args, axis=axis, floatify=floatify, is_2d=False, **kwargs)
     94 
     95 

TypeError: descriptor '__init__' requires a 'super' object but received a 'type'

This seems to be caused by a typo - super.__init__(...) should be super().__init__(...)

ohmeow commented 2 years ago

I'll take a look in next couple of days.