Dialog does not appear when trying to upload a file

Thanks in advance.

Module: AI Python for Beginners: Working with Your Own Data and Documents in Python.

Lesson 2: Loading and using your own data lesson.

The example code works meaning, it runs without errors and gives the expected results. This code allowed me to see the contents of the current working directory:

from helper_functions import upload_txt_file, list_files_in_directory, print_llm_response
list_files_in_directory()

All subsequent code executions were successful until I tried to run:
upload_txt_file()

When I executed this code, no dialog appeared to allow me to upload my own document, and I received no errors in the learning module output.

In Microsoft Edge Version 128.0.2739.67, I set https://deeplearning.ai to “Allow”, in Pop-ups and redirects, but I still don’t get a dialog.

DevTools shows this but I don’t know what to do based on info below.

utils.js:930 Could not open comm – Error: Class jupyter.widget not found in registry at utils.js:894:1 at new Promise () at Object.load_class (utils.js:879:1) at CommManager.comm_open (comm.js:84:1) at i (jquery.min.js:2:1) at Kernel._handle_iopub_message (kernel.js:1239:1) at Kernel._finish_ws_message (kernel.js:1018:1) at kernel.js:1009:1

(anonymous) @ utils.js:930
Promise.then
CommManager.comm_open @ comm.js:85
i @ jquery.min.js:2
Kernel._handle_iopub_message @ kernel.js:1239
Kernel._finish_ws_message @ kernel.js:1018
(anonymous) @ kernel.js:1009
Promise.then
Kernel._handle_ws_message @ kernel.js:1009
i @ jquery.min.js:2

kernel.js:1010 Couldn’t process kernel message

  1. WrappedError {stack: ‘Error: Could not open comm\n at new WrappedError…1f85fdc965acdbbc5fce38ee4bf47f5d089ee701:25058:33’, message: ‘Could not open comm’, error_stack: Array(2)}

  2. error_stack: (2) [Error: Class jupyter.widget not found in registry at https://s172-29-64-250p8888.lab-aws-produ…, Error: Could not open comm at new WrappedError (https://s172-29-64-250p8888.lab-aws-production.…]

  3. message: “Could not open comm”

  4. stack: “Error: Could not open comm\n at new WrappedError (https://s172-29-64-250p8888.lab-aws-production.deeplearning.ai/static/notebook/js/main.min.js?v=da6fdacc23c7ac46e15a86ffb0ccf9c624fc2ff4b960e57504d1e8c8a2d7d16cf7a121c8a9c6cd44ffc181991f85fdc965acdbbc5fce38ee4bf47f5d089ee701:24979:25)\n at https://s172-29-64-250p8888.lab-aws-production.deeplearning.ai/static/notebook/js/main.min.js?v=da6fdacc23c7ac46e15a86ffb0ccf9c624fc2ff4b960e57504d1e8c8a2d7d16cf7a121c8a9c6cd44ffc181991f85fdc965acdbbc5fce38ee4bf47f5d089ee701:25058:33”

  5. [[Prototype]]: Error

(anonymous) @ kernel.js:1010
Promise.catch
Kernel._handle_ws_message @ kernel.js:1010
i @ jquery.min.js:2

hello @hroth
The file upload is failing because the Jupyter environment can’t find “jupyter.widget”.
You can try restarting the kernel/runtime, clearing your browser’s cache, or using a different browser.

Hi @hroth ,

Are you running the lab on your own computer?

In any case, make sure you are running all of the cells from top to bottom in a sequential order.

I do this regularly. I understand the importance of the order of execution of the lines in the tutorial. Thank you Mubsi for replying.

1 Like

Deminiko, thank you!! Clearing the cache and restarting the notebook fixed the problem. MUCH appreciated!

2 Likes

Turns out I just had to clear cache and restarted notebook. All is good. Thank you TMosh for replying.

2 Likes