Easy-Transformer icon indicating copy to clipboard operation
Easy-Transformer copied to clipboard

Add automatic notebook generation

Open ArthurConmy opened this issue 2 years ago • 5 comments

We should be able to use the python script here: https://github.com/nojvek/vscode-ipynb-py-converter to

i) write notebooks as .py files with #%% ii) have these automatically converted to .ipynb files on push

This means that a) we can easily test notebooks (since they are .py files, see discussion here) and b) have automatically updated URLs like https://colab.research.google.com/github/neelnanda-io/Easy-Transformer/blob/main/EasyTransformer_Demo.ipynb to display demos.

@alan-cooney this may be of interest since this would work well as another "on push" action like those in https://github.com/neelnanda-io/Easy-Transformer/pull/68

ArthurConmy avatar Dec 01 '22 00:12 ArthurConmy

Seems sensible (and easier to track changes)!

alan-cooney avatar Dec 02 '22 09:12 alan-cooney

@bryce13950

Could do this help with https://github.com/neelnanda-io/TransformerLens/issues/213?

jbloomAus avatar Apr 15 '23 08:04 jbloomAus

The files themselves are actually not hard to test. There are some issues with running them at the moment in GitHub actions, but those issues would also persist if they were run as py files. Not sure if if this issue is really something with pursuing. When I wrap up #213 I will put in a bunch of info on what I have found, and create a template for future use. At that point, I would look at either deciding to close this out, or deciding if you want to do it. As is, I don't see it as necessary, and a few things coming down the pipeline from GitHub make it even less necessary.

bryce13950 avatar Apr 15 '23 22:04 bryce13950

Thanks for the feedback. I think that sounds good :) We can leave this issue open and mention that if people feel strongly about it, they can make a case. Looking forward to the write up!

Also, I would feel comfortable running the tests locally if:

  1. there is a make command for it.
  2. it doesn't take more than 30 minutes to run.

jbloomAus avatar Apr 16 '23 02:04 jbloomAus

For what it's worth, I find jupyter-ascending really useful for this kind of thing -- I develop in .py, while using jupyter-ascending + vim plugins to automatically update an equivalent .ipynb file and execute specific cells. This has really improved my workflow when I need to generate figures and such using ipynb, would highly recommend!

ajyl avatar Sep 06 '23 01:09 ajyl

I am going to close this one out unless anyone has any objections. Notebooks have been tested as is for quite some time, and I am in the middle of adding full coverage for the rest. At the moment, it seems like all of them are going to be able to be tested with little inconvenience, and this solution is a lot of moving parts for something that, with a few tools, seems to be a lot easier than what it looked like a year ago.

bryce13950 avatar May 23 '24 01:05 bryce13950