Skip to content

Instantly share code, notes, and snippets.

@bityob
Created December 25, 2023 23:47
Show Gist options
  • Save bityob/cab6fa78ef6382d1f55082a60dd6fc62 to your computer and use it in GitHub Desktop.
Save bityob/cab6fa78ef6382d1f55082a60dd6fc62 to your computer and use it in GitHub Desktop.
Run torch with multiprocessing on Jupyter Notebook (aka IPython, Jupyter Lab etc.)
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bityob
Copy link
Author

bityob commented Jun 17, 2024

@IliasAarab

Not sure I understand your question.

The last cell doesn't need kernel restart anyway, since it's run on seperate python process with the %run magic.

So you can update the second cell (with the %%save2file tmp.py in top) and then run the third (last) cell and it will run the script on fresh python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment