Ruby in Jupyter Notebook
nbviewer.org
nbviewer.org
If you want to see the available kernels for each language you can check it here: https://github.com/jupyter/jupyter/wiki/Jupyter-kernels
TIL!
Originally the whole project was ‘IPython’ and then ‘IPython Notebook’. It came out of Fernando Perez’s attempt to make interactive Python a better experience.
They renamed it Jupyter to reflect that it was no longer a pure Python project as kernels were written in even before it rebranded as Jupyter. Those three were the most popular at the time but by no means the only ones.
I used to work with one of the core team about the time they changed this!
"What about using @livebookdev to spawn 64 machines with GPU on @flydotio, each machine fine-tuning BERT with different hyperparameters and graphing in realtime in 2-3 minutes?"
The same org does also have a sciruby project that hasn't been touched in 8 or 9 years like you say.
I'm currently diving into Machine Learning using Python + Scikit-learn, and I'd love to one day replace Python with Ruby. But looking at the current ML ecosystem I don't see that happening. Does anyone have experience building (Supervised / Unsupervised) models using something other than Python (including deployment)?
> Does anyone have experience building (Supervised / Unsupervised) models using something other than Python (including deployment)?
XGBoost/LightGBM have a C API and can be used from pretty much anything, deployment is not a problem. Practically building models is more about dealing with data, the ecosystem tends to revolve around Python and R for that reason.
- https://github.com/elixir-nx/axon Nx-powered Neural Networks
- https://github.com/elixir-nx/nx Multi-dimensional arrays (tensors) and numerical definitions for Elixir
- https://github.com/elixir-nx/scholar Traditional machine learning on top of Nx
- https://github.com/elixir-nx/bumblebee Pre-trained Neural Network models in Axon (+ Models integration)
- https://github.com/elixir-explorer/explorer Series (one-dimensional) and dataframes (two-dimensional) for fast and elegant data exploration in Elixir
- https://fly.io/blog/rethinking-serverless-with-flame/ (for offloading large work to remote containers)
- https://www.youtube.com/watch?v=RABXu7zqnT0 InstructorEx
And of course Livebook (https://livebook.dev)
Old but interesting video https://www.youtube.com/watch?v=g3oyh3g1AtQ (Bumblebee: GPT2, Stable Diffusion, and more in Elixir)
A talk on the upcoming Elixir conference (https://2024.elixirconf.com/schedule/#schedules) is actually titled "Livebook in the cloud: GPUs and clustered workflows in seconds".
Each library has been building on top of the previous libraries & abstractions (including transpiling Elixir instructions into GPU code, see "defn" etc).
Since you mention Erlang, there is even a Machine Learning Working Group at https://erlef.org/wg/machine-learning.
The most iconic & advertised case I'm aware of is the work done at Amplified https://www.amplified.ai ; this has been the topic of a Keynote at ElixirConf EU this year, which you can find at https://www.youtube.com/watch?v=5FlZHkc4Mq4.
I am also starting to use ML + Elixir in production and I'm aware of other individuals doing so.
I do not have a registry of companies doing so, but we're seeing more and more experienced ML practitioners mentioning they are coming from Python and willing to try something different (e.g. https://elixirforum.com/t/data-science-and-machine-learning-... and other posts on Elixir Forum).
Hope this helps!
How developed is Elixir/Erlang in this area? What are the key advantages?
Even so, trying to avoid Python in the world of Jupyter will put you in a very tough spot. In general, doesn't matter how much you dislike it, there's no real way around it. You'll have to face it in some capacity whether you like it or not.
https://github.com/SciRuby/sciruby-notebooks/blob/master/get...
> nbviewer is an open source project under the larger Project Jupyter initiative > along with other projects like Jupyter Notebook, JupyterLab, and JupyterHub.
See GH: https://github.com/pretzelai/pretzelai/
You can install it with pip install pretzelai (in a new environment preferably) - then run it with pretzel lab. You can bring your own keys or use the default free (for now) AI server.
We also have a hosted version to make it easy to try it out: https://pretzelai.app
Would love to get your feedback!
The sidebar can certainly produce code mixed with markdown but right now, we process the markdown and show visually.
The cell level Cmd + K shortcut only works on a given cell to create or edit code and fix errors. Just tested it and it generates markdown well (just start your prompt with "this is a markdown cell")
In the sidebar/chat window, it should be trivial to not parse the markdown and just show it raw. I'll work on it. In the main notebook, it's a bit harder but we are planning to allow multi-cell insertions but it will probably take 2-3 weeks.
I find Cursor to be extremely good right up to that point - I can work with Jupyter via the VS code extension and quickly get mixed markdown like how you're describing now - but it cannot do the multi-cell output or intelligent segmenting described above. I currently split it apart myself from the big 'ol block of markdown output.
I've made a GitHub issue for this feature: https://github.com/pretzelai/pretzelai/issues/142
If you'd like to be updated when we have this feature in, please leave a comment on the issue. Alternatively, my email is in my bio - feel free to email me so that when we have this feature, we can send you an update!
Do you think that approach would work? Not sure if I'm misunderstanding the issue you're describing and I recognize it is likely much messier than I imagine.
Via the use of <thinking></thinking> blocks, it's pretty straightforward to get the the model to evaluate it's own work and plan the next steps (basically chain of thought) but then you can filter out the <thinking> block in the final output.
The last trick to making this actually work is to give the AI model evaluation power - make it be able to run certain inspection code to evaluate its decisions so far and feel that evaluation to the next set of steps.
Combining all of this, it's very possible to convert an AI chat into a multi-step markdown + code notebook that actually works.
We're trying to build a TypeScript notebook and I'm very interested in what people's current tooling for this looks like today.
There's also probably a way to do it, but I haven't figured out how to use ESModule imports in Jupyter, so that's been a bit annoying also. It also hasn't crossed my mind until literally now, that one could write typescript in jupyter notebooks given that typescript needs to be compiled.
Do you have a link to your current work? I think I'd be interested
Yes, my current project is https://github.com/srcbookdev/srcbook
are you the original developer or a new maintainer of iruby?