Skip to content
Advertisement

Use huggingface transformers without IPyWidgets

I am trying to use the huggingface transformers library in a hosted Jupyter notebook platform called Deepnote. I want to download a model through the pipeline class but unfortunately deepnote does not support IPyWidgets. Is there a way to disable IPywidgets when using transformers? Specifically the below command.

JavaScript

And the error I receive.

JavaScript

Note: Installing IPyWidgets is not an option

Advertisement

Answer

You have to disable transformers logging. Even though it is possible to use transformers.logging.set_verbosity to change the log level, it’s not possible to set it to logging.NOTSET which is required to skip using IProgress and tqdm. So we need to hack it like this:

JavaScript

After that you should be able to use:

JavaScript

Check out my Deepnote project for details ;)

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement