Easy-Transformer
Easy-Transformer copied to clipboard
Add automatic notebook generation
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
Seems sensible (and easier to track changes)!
@bryce13950
Could do this help with https://github.com/neelnanda-io/TransformerLens/issues/213?
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.
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:
- there is a make command for it.
- it doesn't take more than 30 minutes to run.
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!
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.