gladia-research-group/multi-source-diffusion-models

name 'widgets' is not defined

Closed this issue · 1 comments

Hello, I really appreciate this work and I want to try it!
However, when I'm trying to use this "MSDM-generation.ipynb", when executing to the "Generation" part, it comes with bug:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[6], [line 16](vscode-notebook-cell:?execution_count=6&line=16)
     [12](vscode-notebook-cell:?execution_count=6&line=12)         if index >= num_generations:
     [13](vscode-notebook-cell:?execution_count=6&line=13)             continue 
     [15](vscode-notebook-cell:?execution_count=6&line=15)         row.append(
---> [16](vscode-notebook-cell:?execution_count=6&line=16)             wrap_in_out(
     [17](vscode-notebook-cell:?execution_count=6&line=17)                 Markdown(f"**Sample at index** [{i*w+j}]:"),
     [18](vscode-notebook-cell:?execution_count=6&line=18)                 to_audio_widget(generated_tracks[index,:,:]),
     [19](vscode-notebook-cell:?execution_count=6&line=19)             )
     [20](vscode-notebook-cell:?execution_count=6&line=20)         )
     [22](vscode-notebook-cell:?execution_count=6&line=22)     grid.append(row)
     [25](vscode-notebook-cell:?execution_count=6&line=25) # Show results

Cell In[2], [line 23](vscode-notebook-cell:?execution_count=2&line=23)
     [22](vscode-notebook-cell:?execution_count=2&line=22) def wrap_in_out(*obj):
---> [23](vscode-notebook-cell:?execution_count=2&line=23)     out = widgets.Output()
     [24](vscode-notebook-cell:?execution_count=2&line=24)     with out:
     [25](vscode-notebook-cell:?execution_count=2&line=25)         display(*obj)

NameError: name 'widgets' is not defined

I tried to find the 'widgets', but I can't find its definition.
(I downloaded all the weights, but I didn't downloaded the Slakh2100, is this the cause?

Oh, I think I find out how to fix this bug
I tried to add

import ipywidgets as widgets

and this bug fixed
the references are as below:
https://forums.fast.ai/t/name-widgets-is-not-defined-taking-lot-of-time-to-run-the-fastbook-ch-1-on-colab/75792/6
https://ipywidgets.readthedocs.io/en/7.x/