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

ModuleNotFoundError while importing blurr.data #60

Closed msi1427 closed 2 years ago

msi1427 commented 2 years ago
!pip install -q ohmeow-blurr
from blurr.data.all import *

Facing this weird issue when I import blurr.data in Google Colab. I think it's an naming issue in importing the libraries from transformers.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py in _get_module(self, module_name)
   2703         try:
-> 2704             return importlib.import_module("." + module_name, self.__name__)
   2705         except Exception as e:

11 frames
ModuleNotFoundError: No module named 'transformers.models.bort'

The above exception was the direct cause of the following exception:

RuntimeError                              Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py in _get_module(self, module_name)
   2706             raise RuntimeError(
   2707                 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its traceback):\n{e}"
-> 2708             ) from e
   2709 
   2710     def __reduce__(self):

RuntimeError: Failed to import transformers.models.bort because of the following error (look up to see its traceback):
No module named 'transformers.models.bort'
msi1427 commented 2 years ago

It was a transformers library issue. While installing transformers installing v4.15.0 solved the issue for me for now. However, a fix is on the way. [Referring to https://github.com/huggingface/transformers/issues/15377 ] Closing the issue for now.