ChatGPT’s Code Interpreter plugin automates many tasks like data analysis, computer programming or video creation! Learn everything you need to know to use this powerful tool!
Since the inception of the ChatGPT plugins, the AI chatbot has done this enriched with many features which makes it infinitely more useful.
However, one of these plugins stands out and is of particular interest to coders and programmers Data science professionals… or for those who want to become oner: the interpreter code.
Contrary to what the name might suggest, this is not the case not just a code interpreterbut for many professionals a very versatile tool.
Cherry on the cake: all ChatGPT Plus users Can try it now in open beta. Follow the leader !
What is the code interpreter?
When ChatGPT is effective for Answer questions or generate textsit has many limitations.
The Chatbot is particularly bad at mathdoes not allow uploading files, cannot create graphics and I can’t even run code directly through the interface.
However, the Code interpreter plugin developed directly by OpenAI changes the game and allows the chatbot to do all these tasks!
What’s the point?
The code interpreter increases the capabilities of ChatGPT and offers a multitude of new possibilities. Before you figure out how to enable it, here’s how Overview of the tasks which you can automate with this powerful tool!
Analyze data and create DataViz
First, it offers the Ability to upload files. From there, ChatGPT can take care of the analysis and creating visualizations! A simple prompt is enough to ask the chatbot to analyze a large data set to identify trends.
during one Demonstration, Professor Ethan Mollick from the University of Pennsylvania, ChatGPT provided a dataset of all firework injuries between 2019 and 2020.
Immediately, the code interpreter formatted the data into an organized database and noticed a “big increase”. injuries during this time.
I’m always amazed at how much statistical common sense ChatGPT with Code Interpreter has.
I can just throw in raw data from a PDF and run it through analysis, and it figures out the table layout, rearranges formats, runs models, and “reasons” the results. pic.twitter.com/hFcYJMAp2o
— Ethan Mollick (@emollick) July 5, 2023
You can for example Entrust your company’s data to AI in the form of an Excel table, an SQL database or a CSV, XSLT or JSON file.
Simply put, ChatGPT now allows anyone to be a data analyst with this simple plugin !
The only weak point: it’s not like that at the moment It is not yet possible to have the graphics analyzed by the AIPhotographs and other images made available to him.
Create data visualizations
4. “Graph of traded share volumes”: pic.twitter.com/twS3Q5n0jx
— Alex Ker 🔭 (@thealexker) July 8, 2023
The code interpreter can do that too generate graphics based on user-provided records.
For example, Alex Ker, founder of the AI Projects incubator, provided the plugin a dataset on Tesla shares and asked the AI to create a price chart.
In only five minutesthe chatbot created a multi-line chart showing the five-year price history.
He also generated a line chart and a histogram Tracking history of daily fluctuations in stock price.
As another example, here is how the AI creates a map of public data at UNESCO World Heritage Sites.
Likewise, the chatbot Create a data visualization instantly based on your input and the data you have provided.
clean data
Data cleaning is an essential task in data science, however quickly turns out to be time-consuming and tedious.
Instead of doing it manually, you can now ask Interpreter code to do this in seconds.
For example, YouTuber Drake Surach from the AI Foundations channel uploaded a video an FBI Excel spreadsheet with the data Crime rate chart with empty rows and columns.
He just asked the chatbot to “clean up this data”and ChatGPT immediately created a new array with Corrected column names and unnecessary rows deleted.
According to the videographer, this process would have taken several hours without the help of ChatGPT. Again the code interpreter saves valuable time.
Write and debug code
Ironically, as Ethan Mollick points out, the code interpreter “could be” more useful for people who don’t program at all “.
Since its inception ChatGPT could write computer code. However, this was unreliable because the AI could invent features that didn’t exist and required human correction.
THE Code may not even work and cause runtime errors due to simple syntax problems.
Now the code interpreter Allows AI to run and test the code in an isolated, firewall-protected sandbox environment.
This is how the chatbot can Make sure his code works correct before making it available to you. The evaluation takes place within a persistent session that remains open for the duration of the conversation. Consecutive calls can therefore overlap.
The main mistake is thisit is a Python interpreter. If you work with other languages, use is therefore not possible for the time being. Still, in general, the plugin greatly improves ChatGPT’s ability to interpret code.
Despite ChatGPT’s impressive performance, this is the case It is better to check the code made by the AI and test it yourself before putting it into production.
For example, AI Business used Code Interpreter to Make a game based on the famous song Never Gonna Give You Up by Rick Astley.
generate video games
Since it is possible to write any kind of code, some already use the code interpreter Create video games with ChatGPT.
The founder of the AI tool incubator shared the instructions for this on Twitter Recreate the popular mobile game Flappy Bird in just seven minutes.
👀 I used OpenAI’s code interpreter to create Flappy Bird 🐦 in 7 minutes:
Code interpreter/GPT-4 for code generation.
Existing or AI generated assets for graphics.
—
How to create the game in just 6 steps:
(1): Enter the following prompt:
“Write p5.js code for…” pic.twitter.com/o4Dic9jtoI
— Alex Ker 🔭 (@thealexker) July 11, 2023
He first asked the AI “ Write p5.js code for Flappy Bird » with the description of the rules. He then found open-source code that helped the chatbot complete its version of the game.
Similarly, Krist Kashtanova has shown how Create a relatively simple asteroid game without effort.
The code interpreter in ChatGPT is amazing! I need 5 minutes to create this game.
You can create your own game resources with any AI generator and then ask GPT-4 with Code Interpreter to write code. If you have problems, you can ask to fix the errors.
1. Write this prompt: “write…” pic.twitter.com/cqWpcfVq9J
— Kris Kashtanova (@icreatelife) July 9, 2023
Ultimately, this technology could completely revolutionize the way video games are created. That’s what Clink Hocking, creative director of Assassin’s Creed, recently predicted In 10 years, players will only have to describe to the AI the game they want to play…
Create GIFs and videos from images
It is also possible to use the interpreter code produce animated clips. Taking to Twitter, mid-journey specialist Salma Aboukar produced a video for a flavor of tequila in less than five minutes.
She simply asked the MidJourney image generator to create an image of a “perfume bottle resting near a cactus” with the Keywords describing the specific style Wish.
1/🖼 Generate product image on Midjourney v5.2
Let’s launch a tequila perfume for men – a fragrance with a decadent and distinct aroma, in a cactus setting to capture the mood🌵✨
Prompt in ALT👇 pic.twitter.com/VnbVTzMn26
— Salma Aboukar – Midjourney Queen (@Salmaaboukarr) July 12, 2023
Then she has it loaded this MidJourney image onto the code interpreter and asked him to create a video based on it. In a matter of moments, a four-second clip was created.
Likewise the Professor Mollick made a GIF Shows the location of all lighthouses in the United States using a data table.
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
he is straight It is possible to convert GIF to video, as revealed by another Twitter user. Anyone can become a videographer!
converting files
The Code Interpreter can not only convert images to GIFs or GIFs to videos Convert a variety of files in the format of your choice.
For example, the Howfinity YouTube channel explained how Convert PNG image to JPEGor an MP4 file in GIF.
Analyze playlists
Every year at the end of the year Spotify offers its users a summary Songs they’ve been listening to the most over the past few months and other stats about their use of the music streaming service.
With the Code Interpreter, you no longer have to wait until Christmas. A Twitter user has Have the AI analyze a 300-hour playlist with his favorite songs to draw conclusions!
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
Create QR codes
It is one of the first use cases presented by OpenAI during the introduction of the Code Interpreter: create QR codes.
In a single prompt AI can generate and display a QR code leads directly to your company’s website. In addition, it contains the instructions for use.
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.
Additional users can register via the settings. pic.twitter.com/IjH5JBqe5B
—OpenAI (@OpenAI) July 6, 2023
Solve math equations
Thanks to the code interpreter, ChatGPT improves its level significantly in mathematics. Because, AI now uses Python code Solve problems.
Beyond solving the equations, The chatbot explains the logic which enabled him to deduce the result.
Suffice it to say that this new plugin will do just that make life difficult for teacherswho thought they found a way to spot cheating students with ChatGPT!
How do I activate the Code Interpreter plugin?
Accessing this new feature couldn’t be easier. First off, a ChatGPT Plus account is a must. Let’s remember Plugins are not available for free users.
To subscribe to the paid version, Click the Upgrade to Plus button. is located at the bottom left of the ChatGPT interface. Then follow the payment instructions.
After registering, return to ChatGPT and Click on your account name bottom left. Click Settings, then Beta Features to access Beta Features.
In the list, Click the Code Interpreter button. to activate it. There is no need to go to a third-party plugin store as it is developed directly by OpenAI.
Return to the main interface and Hover over the GPT 4 button above the dialog box. A drop-down menu allows you to choose between the standard version or the code interpreter.
Select the “Code Interpreter” option and voila! THE The plugin is activated and ready to use. You can start your conversation with ChatGPT.
How do I upload files to ChatGPT using Code Interpreter?
Once the Code Interpreter plugin is activated, you can You can find a “+” symbol on the left side of the dialog box.
You can Click on it to download it Files such as Excel and Word documents. Small precision: even if loading images is possible, ChatGPT is not yet able to analyze them.
The opposite, to download files from ChatGPTyou just need to activate the interpreter code and make your request via prompt.
THE The chatbot will immediately provide you with a link into conversation. Then you can click on it to start the download. This feature is particularly useful for generating reports.
Note a small downside: ChatGPT seems to be using matplotlib for graphics and has difficulty saving files. Some parts may therefore be cropped.
To fix this problem, Keep asking for an uncropped image and the AI will usually end up with an image with more white space and no cropping.