Content
summary Summary

The Code Interpreter is probably the most interesting ChatGPT plugin of OpenAI and opens up completely new capabilities for the Chatbot.

Ad

At the end of March, OpenAI introduced a groundbreaking new feature for ChatGPT: Plugins. One of them is a so-called Code Interpreter. With it, the language model can not only generate code, but also execute it independently.

As with Auto-GPT, the busy developer community has found exciting use cases for this technology in a very short time. Especially for data journalism and similar data-based analysis, the tool seems to open up completely new possibilities. This is also due to the possibility of uploading and downloading files up to 100 MB in size.

We have compiled some of the most exciting demonstrations of ChatGPT's Code Interpreter.

Ad
Ad

Visualize data

As mentioned earlier, one strength of the Code Interpreter lies in the visualization of data. The software is not limited to any particular type of display or graphic. The possibilities range from simple bar graphs to more complex and lesser-known graphs.

Clean data and generate synthetic data

ChatGPT can not only process the data, but also clean it or generate synthetic data in case of doubt. The AI is not completely flawless: "If you give it something with a lot of text, it seems to tokenize that and the data you are cleaning can come back somewhat mangled," notes data scientist Kathryn Cramer on Twitter.

Analyze bitcoin rates

The code interpreter can also analyse bitcoin prices, as demonstrated by Twitter user @TechMemeKing. Once a dataset has been uploaded, the ChatGPT plugin accepts various requests to display the data as a line or bar chart, for example. "I did this with an iPhone while lying in bed .... This is a game changer for exploratory data analysis," he comments.

Prompts

Graph the log price of bitcoin

Seasonally decompose the price since 2011

Give me the bitcoin price variance vs average by day as well as the average price by month

Graph the log distribution of prices

Graph common moving averages

Analyzing your own musical tastes

Twitter user @SHL0MS went a step further and analyzed a Spotify playlist of about 300 hours of all his favorite songs. ChatGPT not only provided the visualization, but the AI also helped with data retrieval and explained how to use the Spotify API accordingly.

Create HTML page

While ChatGPT visualised the data as images in the previous examples, Patrick Blumenthal found a way to output the result as an HTML page. After uploading a raw dataset, the code interpreter generated a fully functional HTML page. It was originally a world map, but ChatGPT was able to crop the map to North America on request.

Recommendation

Create animated GIFs

In addition to data processing, the Code Interpreter has limited multimedia capabilities. For example, a short prompt can be used to create a GIF animation.

Prompt

Make a 512x512 GIF with falling green Matrix letters. Assume no fonts. 30 frames 5 fps. No talk, just go.

The ability to create GIFs from scratch can of course be combined with the data analysis capabilities described above. Like here to show all lighthouse sites in the USA.

Prompt 

Create a gif of a map of the lighthouse locations, where the map is very dark but each lighthouse twinkles

Simple video editing

However, the Code Interpreter handles not only GIFs, but other file formats as well. For example, Prompt Engineer Riley Goodside uploaded a GIF and asked ChatGPT to convert it to an MP4 with a dramatic zoom. ChatGPT doesn't store data for long, but asks for a re-upload if in doubt.

Prompt 

I'll upload a gif and you give me a 5s mp4 with a dramatic slow zoom-in. No talk; just go.

Create colour palette from image

ChatGPT can create a colour palette from an image with the code interpreter enabled. Thanks to the upload and download functions, it extracts colours from an image and then creates a "palette.png". If space is at a premium, it can also automatically compress large images, making the language model behind ChatGPT a more practical tool for designers.

Ad
Ad
Join our community
Join the DECODER community on Discord, Reddit or Twitter - we can't wait to meet you.

Prompt

Create a script that extract the top 5 colors from a picture then make into a palette.png to download, wait for the image upload

Convert image to text with OCR

The code interpreter generally improves the multimodal capabilities of ChatGPT. This also means that it is possible to quickly convert images into text files. An essential keyword for this capability is OCR (Optical Character Recognition), which scanners are capable of. ChatGPT will ask you to upload the file and then process it to produce the text.

Prompt

OCR an image for me and generate a text file

Generate sound

"When I realized that ChatGPT understands a lot of mathematical data and CI can generate downloadable files, I asked ChatGPT to generate a Shepard tone (a sound illusion that seems like it’s constantly getting higher in pitch," Andrew Mayne reports on his blog. Initially, ChatGPT displayed this sound as a graph, but could also output it as a WAV file via a code interpreter.

Prompt 

Create a Shepard tone and save it as a wav

Bild: Andrew Mayne

Create QR codes

Although there are many free services available on the internet: For the sake of completeness, it should be mentioned that ChatGPT can generate QR codes with the code interpreter, which can then be downloaded as graphics for further use.

Prompt 

Create a QR code for OpenAI.com

Bild: Andrew Mayne

Recognize faces in pictures

Since the code interpreter has access to many Python libraries, it can also be used to recognise faces, as Andrew Mayne demonstrates. In this case, he uses the Haar Cascade Classifier.

Bild: Andrew Mayne

Convert images to ASCII

The code interpreter can open images and create graphics from them. In this way, for example, a drawn work of art becomes an ASCII graphic.

Code interpreter available for all Plus customers

Initially the code interpreter was only in closed beta, but since the beginning of July the plugin has been available to all paying Plus customers of ChatGPT. In order to use it, you will need to enable the interpreter in the "Beta Features" section of your settings, so that you can select it in GPT-4.

Support our independent, free-access reporting. Any contribution helps and secures our future. Support now:
Bank transfer
Summary
  • With the help of plugins, OpenAI extends ChatGPT with many features that go beyond pure text generation.
  • One of them is the Code Interpreter. It can generate and execute code as well as upload and download files.
  • In this article, we present the most interesting use cases.
Jonathan works as a freelance tech journalist for THE DECODER, focusing on AI tools and how GenAI can be used in everyday work.
Join our community
Join the DECODER community on Discord, Reddit or Twitter - we can't wait to meet you.