Typefully

CodeInterpreter: A Groundbreaking Tool for Fast and Smart Coding

Avatar

Share

 • 

2 years ago

 • 

View on X

#CodeInterpreter - "It's a very fast, coding intern, that's both really smart and really stupid, but the biggest advantage is, it never gets frustrated and never gives up" - @simonw Here's my evergreen #CodeInterpreterCan thread, w examples, tips, use-cases, and ideas👇
Open AI released Code Interpreter to every paying customer on #ThursdAI Jul 6. It's a watershed moment. However not until @swyx pinged me and @simonw to discuss it on spaces, did I dive in. And we're all in agreement, this is groundbreaking! Checkout the space recording: twitter.com/swyx/status/1677754490055950337
Code Interpreter access gives us these incredible SuperPowers. 🔥 Uploading files up to 100MB in chatGPT interface 🔥 Access to a fine-tuned GPT-4 that's able to write and more important _EXECUTE_ code, re-run it when it fails, and keep trying 🔥 Generate download links
So let's start with uploading files. While pasting a long code file was common for folks to do with chatGPT, uploading a file is way different. Some examples for stuff you can now upload: - CSV files - audio/video - images - zipped directories - sqlite dbs - ...
Uploading files (unlike pasting tons of text) doesn't fill your context window, so you can upload files / entire directories, and chatGPT will only read from there when it needs to. You can also (h/t @simonw as well) upload a sqlite DB file, and GPT will query it for you
I've uploaded a video file and asked chatGPT to extract the audio, then cut the audio into 3 equal length pieces. It worked like a charm. It's because #CodeIntereterCan use ffmpeg and moviepy
Code Interpreter is running a Kubernetes container, and every thread runs in an isolated code environment, with no web access. However there's a bunch of packages pre-installed, too many to count, the full requirements.txt can be found here: gist.github.com/altryne/ee461c27391d4c3990f6bfe1d6a33aa2
Packages that handle all kinds of files (csv, video, audio, zip, pdf, images) And packages that allow you to Work with audio video files Generate wordclouds Create charts and graphs Work with a database Edit video and audio files open zip
In fact, I started to categorize the packages manually for this thread, and was like, wait a second, I can ask it to do it on it's own. Here's a link to my chat where I ask for this word-cloud: chat.openai.com/share/a4336af0-6faa-4ffb-b5b0-a3bd7ef8f3aa
So now that we have the ability to upload files, and ask code interpreter to run the above packages, we can do a WHOLE lot! It seems that OpenAI has a finetuned GPT-4 model, that can run code, debug itself, and give you the output. And the possibilities are incredible
Here's just a few things that folks have done, I'll try to keep these 1 idea per tweet for easier sharing, I will add the #codeinterpreterCan hashtag, and if you have found a cool use-case add it to your tweets as well, let's build a living breathing manual for this thing
#CodeInterpreterCan handle files bigger than 100MB Upload limit is 100MB, @simonw figured that huge CSV files can be zipped, and GPT-4 will be able to unzip them, and then run calculations, summary, plotting on a graph whatever with them I zipped my whole git repo!
#CodeInterpreterCan iterate, try again, fail and then succeed! On significant improvement on writing code with #codeinterpreter is, now you can ask it to write code (python only for now) and then ask it to run, debug itself, and create tests.
#codeinterpreterCan - Can do OCR with tesseract , however my results for the above word-cloud images were really bad. chat.openai.com/share/2b85e783-64fa-4af3-9011-146ac3f877f1
#codeinterpreterCan has access to 8K context token window, but also, we can ask it to store results in text files, so effectively have a much bigger memory than your regular GPT. Untill the kubernetes container disconnects, then everything goes bye bye
#CodeInterpreterCan sometimes refuse to do things, and all you have to do, is to be very encouraging, and it'll try anyway! twitter.com/simonw/status/1677778974636929024
#CodeInterpreterCan visualize data using matplotlib and then give you a gif file download twitter.com/emollick/status/1652704173178142720?s=20
#CodeInterpreterCan be very helpful in the task definition itself, like a very smart data analyst. You can ask it to analyze some data, and then ask "and other interesting things" and it'll come up with those additional interesting things, and suggest them to you
#CodeInterpreterCan replace your "chat with documents" startups (and maybe? run a vector DB?) Here we were just spitballing, but uploading a pickle file full of embeddings and ask it to run cosine similarity on those embeddings should be very doable!
#CodeInterpreterCan convert your ipython notebook messy code into an actual functional python code that you can use within your other codebase 💡 Upload a ipynb and ask it to extract, format and create a python file with the contents of the notebook.
#CodeInterpreterCan teach you how to python! Including interactive examples of the code running, and debugging. One of the most annoying things about learning to code is to set up a dev environment, and #codeInterpreter removes this need, just talk to it
#CodeInterpreterCan give you access to "the older, better" GPT-4, many folks claim that GPT-4 has been lobotimized, and it seems that the codeInterpreter is a different model, that was likely fine-tuned from a different pre-lobotimization checkpoint in the past.
Avatar

Alex Volkov (Thursd/AI)

@altryne

✌️ Vibe Coder 🎙️ Host of @thursdai_pod ✨ AI Evangelist with @weights_biases 🪄🐝 working on @weave_wb Founder and CEO @ targum.video