error on Huggingface login when running on RunPod/JupyterLab (with workaround)
When running the dreambooth_runpod_joepen notebook on with jupyterlab on a Runpod instance, there's a JavaScript error that happens on the huggingface login cell.
Here's a video demo of the issue, from Aitrepreneur: https://youtu.be/7m__xadX0z0?t=800
Error message:
[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'VBoxModel' from module '@jupyter-widgets/controls'
Error: Module @jupyter-widgets/controls, version ^1.5.0 is not registered, however, 2.0.0 is
at f.loadClass (https://litnrd1dobewvc-64410a23-8888.proxy.runpod.io/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:74977)
at f.loadModelClass (https://litnrd1dobewvc-64410a23-8888.proxy.runpod.io/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:10729)
at f._make_model (https://litnrd1dobewvc-64410a23-8888.proxy.runpod.io/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:7517)
at f.new_model (https://litnrd1dobewvc-64410a23-8888.proxy.runpod.io/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:5137)
at f.handle_comm_open (https://litnrd1dobewvc-64410a23-8888.proxy.runpod.io/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:3894)
at _handleCommOpen (https://litnrd1dobewvc-64410a23-8888.proxy.runpod.io/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:73393)
at b._handleCommOpen (https://litnrd1dobewvc-64410a23-8888.proxy.runpod.io/static/lab/jlab_core.d6bc082464b66ab0e79a.js?v=d6bc082464b66ab0e79a:2:994481)
at async b._handleMessage (https://litnrd1dobewvc-64410a23-8888.proxy.runpod.io/static/lab/jlab_core.d6bc082464b66ab0e79a.js?v=d6bc082464b66ab0e79a:2:996471)
It seems the jupyter-widgets lab extension is not working properly. I'm not sure if that's something you can patch in your notebook or not. Some guidance on how to work around this issue to quickly download the ckpt file would be excellent!
Workaround
Call hf_hub_download() with use_auth_token="MY_TOKEN". This also shows the javascript error but it runs and downloads the model anyway.
Another workaround is to simply refresh your browser after the pip install cell, then the javascript stuff should work
See also:
- https://github.com/huggingface/huggingface_hub/issues/1160
Another workaround, if you're connected to the pod via SSH or similar, is to run huggingface-cli login and then paste your token in there, then skip the login cell in the Jupyter notebook, and go straight to the download step.
Hey :wave: Another workaround is to use the latest version of huggingface_hub on main branch which allows to login by passing the token as a function argument. The widget is not displayed to the user which kinda bypass the issue:
# !pip install git+https://github.com/huggingface/huggingface_hub.git@main
from huggingface_hub import login
login(token="hf_***")
This will otherwise be officially released in next release.
(copied from https://github.com/huggingface/huggingface_hub/issues/1160#issuecomment-1305350536)