What is code interpreter?
On July 6th, OpenAI introduced a new plugin for ChatGPT called Code Interpreter. This feature is reserved for ChatGPT Plus subscribers. “Allows ChatGPT to run code, optionally with access to the files you’ve uploaded. You can ask ChatGPT to analyze data, create charts, modify files and perform calculations.”, we can read in the OpenAI release note. In fact, the AI can now write code in Python and manipulate files up to 100MB. And the new possibilities that Code Interpreter brings are numerous. In particular, you can:
- Create graphics, maps,
- create data visualizations and charts,
- clean records,
- analyze music playlists,
- Create interactive HTML files…
Users seem overwhelmed. Linas Beliunas, General Manager at Flutterwave, believes this is the case on LinkedIn “Most powerful feature since GPT-4 (…) Anyone can now be a data analyst”. Because Ethan Mollick, a professor at the University of Pennsylvania and an AI expert, wrote in his newsletter: Code Interpreter “Makes AI much more versatile” and that it is “The most useful and interesting mode” that he could try. Learn how to access this new feature and see 10 examples of what’s possible with OpenAI’s Code Interpreter.
How to access Code Interpreter via ChatGPT
To access Code Interpreter, you must be a ChatGPT Plus subscriber. The service gives you access to GPT-4, OpenAI’s latest language model, but also to its plugins, including Code Interpreter.
To use Code Interpreter, click on your username and go to settings – or Ideas – of the tool. In Settings, click Beta Features and tick code interpreter. On the chatbot main page, move your mouse or press GPT-4 and select Code Interpreter Beta.
10 examples of using Code Interpreter
1. Turn an image into a video
Code Interpreter allows you to upload files. Based on this postulate, Chase Lean, a fan of AI tools, wanted to animate a photo. To do this, he downloaded a panoramic photo showing trays of food and asked Code Interpreter to create a kind of tracking shot. He specified the direction of scrolling and the format he wanted, and got the video he wanted in about thirty seconds.
What’s new: Now you can convert images to videos with ChatGPT
How it goes?
Take advantage of the new feature called Code Interpreter.
Check out the steps below pic.twitter.com/r0vWYc2lrr
— Chase Lean (@chaseleantj) July 8, 2023
2. Convert an image to text
Often described by its users as a “multimodal” AI, Code Interpreter allows you, for example, to get a text version of a document viewed as an image. For example, if you have an invoice, estimate, or other information about a document in PNG format, you can get a text version in a few seconds thanks to Code Interpreter, as user Shubbam Saboo demonstrates below.
Multimodal AI is here
GPT-4 can now turn your images into a text file on the fly with the new Code Interpreter model.
See the OCR magic in action pic.twitter.com/c9mnJfiweg
— Shubham Saboo (@Saboo_Shubham_) May 5, 2023
3. Analyze and explain data intelligently
Selon Ethan Mollick, “Code Interpreter’s ability to understand data and know what to do with it is impressive.”. By sending a data set to the AI, it is able to perform a clear analysis or even suggest a visualization that fits the data better than the prompt envisioned. Ethan Mollick and his academic colleagues were “surprised” at how skillfully the AI was able to perform the data analysis.
Code Interpreter’s ability to “understand” data and know what to do with it is impressive. I got on the phone with a few other faculty members and we were all a little taken aback by how “clever” it is when doing analysis: getting Monte Carlo, ARIMA, PCA, Random Forest right… pic.twitter.com/nPIqBDMAMY
— Ethan Mollick (@emollick) May 27, 2023
4. Perform data analysis for Spotify playlist
Code Interpreter can analyze your taste in music! A Twitter user managed to get a complex and structured analysis of his favorite Spotify playlist with over 300 hours of music. “GPT showed me how to export the data from the Spotify API, ran a multidimensional PCA and t-SNE analysis, and summarized my preferences for me.”explained @SHL0MS and published the results.
Analyzing a 300 Hour Spotify Favorites Playlist with ChatGPT Code Interpreter
I used to use a Jupyter notebook someone made for PCA analysis but it broke
GPT showed me how to export from the Spotify API, performed multidimensional PCA and t-SNE analysis, and summed up my tastes for me pic.twitter.com/cVmUvuuRdM
— (@SHL0MS) May 1, 2023
5. Convert data into a website
Code Interpreter’s data visualization capabilities impress users. In addition to graphics, the AI is also able to create a perfectly functioning website or HTML files from a data set. Patrick Blumenthal, for example, had fun creating an interactive Hot Zones map of all UFO sightings. He even managed to get his map focused on North America, with the AI even generating a title for his map without him having to ask.
OpenAI’s new code interpreter model is great for data visualization. I fed it an unpolished dataset of UFO sightings and it generated a fully working HTML heatmap for me.
Here is a static version (with this I can easily create as many versions as I want) pic.twitter.com/mDVU2Rp8BR
— Patrick Blumenthal (@PatrickJBlum) April 29, 2023
6. Support a fiction with realistic physical data
Would you like to write a fiction or novel with credible information but on subjects you are not familiar with? ChatGPT and Code Interpreter can help you. For example, it is possible to use the code to simulate elements of realistic physics, such as the trajectory of a spacecraft around a gravitational object, the launching of rockets in space, or the performance of sensors. The tool offers you both the editorial aspect and, thanks to the code, a simulation of your needs in terms of physical realism.
Hard sci-fi simulation, courtesy of ChatGPT with Code Interpreter.
“We will role-play a sci-fi scenario.” I will be the captain. Here’s the catch: you must ensure that each challenge in the scenario includes realistic physics that you simulate with code » pic.twitter.com/lW0VmYA1RW
— Ethan Mollick (@emollick) July 2, 2023
7. Extract color palette from an image
Code Interpreter can quickly extract the main color palette from an image. A handy measure if you want to create or define a graphic charter. By uploading your image, Code Interpreter creates a script that allows for color analysis and extraction. Then the tool can generate this palette and, as in the example below, display the 5 main colors present in the image in the form of a color map.
The ChatGPT code interpreter is amazing! 🌟
Its file uploading and downloading capabilities make it an extremely flexible tool for various tasks. 💼
Here colors are extracted from an image to create a palette.png 🎨
And automatically compresses large images when memory is low. pic.twitter.com/i25yPujtBV
— Pietro Schirano (@skirano) May 1, 2023
8. Generate QR codes
To announce the release of its plugin for ChatGPT Plus subscribers, OpenAI took a very simple example and asked the AI to generate a QR code for its official website. There is no need for a detailed or particularly precise prompt here. For a request like “Create a QR code for this site and show it to me”, Code Interpreter displays the generated object directly. Of course, you can use the dedicated button in the conversation panel to get the details of the procedure.
Code Interpreter will be available to all ChatGPT Plus users over the next week.
This allows ChatGPT to run code, optionally with access to the files you uploaded. You can ask ChatGPT to analyze data, create charts, edit files, do calculations, etc.
Plus users can sign up through Settings. pic.twitter.com/IjH5JBqe5B
— OpenAI (@OpenAI) July 6, 2023
9. Create an animated map from a database
While the Code Interpreter allows for significant optimization by performing complex tasks in a matter of seconds, it also offers opportunities for slightly more playful creations. By uploading a CSV file with the location of all the lighthouses in the United States, Ethan Mollick asked the AI to create a GIF format map that represented this data. But he wanted to make it visually appealing and in his request he expressed his desire for a map on a black background with “every lighthouse blinking”. In just a few seconds, the result is breathtaking.
That was kind of gratifying: I uploaded a CSV file from each lighthouse location in the US.
« ChatGPT Code Interpreter: Make a GIF of a map of the lighthouse locations, where the map is very dark but each lighthouse is blinking. ” A few seconds later… pic.twitter.com/f14JLWQCyB
— Ethan Mollick (@emollick) May 2, 2023
10. Bonus: create the digital matrix rain
Playful use you said? Riley Gooodside, prompt engineer at Scale AI, had fun recreating the “digital rain” from Matrix. All he had to do was specify the size he wanted for his GIF (512×512), the number of frames and how they would be displayed (30 frames at 5 frames per second), all with one clear statement: “Don’t talk, get to work” ! A few seconds later, the code containing the Matrix itself appeared on his screen!
ChatGPT Code Interpreter (Alpha) renders an animated GIF: pic.twitter.com/2txArURcu1
— Riley Goodside (@goodside) April 28, 2023