Building my first GPT 3 App with Open AI Playground

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we did it we finally got access to gpt-3 it's been eight months since i made my first video on gpt3 and it's exciting to finally have access to the playground i'm gonna show you what the gpt3 interface looks like what it's like to interact with the documentation and what it's like to actually build our very first gpt3 application i'm super excited to show you what i found so let's dive into the playground and take a look around so the main application is really oriented around the playground that's really where you spend the majority of your time and this is where you type basic text that you want gpt3 to interpret and figure out how to complete so if i say something simple like this is a test and i hit the submit button it will then try to complete that test next so it says this is a test of the emergency broadcasting system this is only a test so again very simple example over here on the right you can see what you can change in terms of parameters there is the gpt engine and there's a number of different engines the engines will behave slightly differently and they also have different costs associated with them so the davinci engine is currently the most sophisticated with some of this beta engine being worked on as well in addition to the engine there's the response length the temperature which is how random a particular response is if you want multiple responses it can go through those responses with best of there's frequency penalties and presence penalties and this helps gpt 3 reduce repeatability so sometimes it'll get stuck in a loop where it keeps repeating the same phrase over and over and so some of that will help prevent that if you're doing a chat bot or something similar to that you can have an inject start question and inject restart text and you can also have stop sequences so whenever a gpt3 will predict a character turn or stop sequence it will stop the submission so it won't continue to type additional text each time you run gpt3 it will actually try to create a new result and you can actually see what the probability of the different results are if you want it to be less random and more predictable you can turn some of the temperature down when you have the full spectrum of probabilities you can actually hover over words and see how likely gpt3 thought that word was going to occur and this helps it determine the probability of each particular sentence or phrase and it also shows you the tokens or how much it would cost gpt3 in terms of its tokens to actually generate that phrase gpt3 is based on token usage and the more complex a question you're asking it the more tokens it'll take up obviously we could keep going but that's the basics of the playground there is a bunch of documentation in terms of gpt3 there's a number of different engines you can use you can read through the docs in terms of what it does and how it operates the examples is an area where you can really find examples to try out and each of these has basic prompt information but all it really does is populate the playground and so if i did english to french if i open up that translation example it shows some of the prompts that it starts off with and the key about gpt3 is you prompt it you give it a couple of these examples and once it has some examples it has a better sense of what you're expecting from it for the next time so if i say how do you get to the store you can see it'll inject french and it'll inject a restart sequence in a stop sequence after that character turn so french again i don't speak french but i'm assuming that's correct in the examples there's a bunch of different examples that you can kind of see through from classification factual answering product name generation some of the spreadsheet examples that you saw previously and things of that nature right now everything in open ai is in beta so it's not really available for public consumption but i want to dive in and build an application that would actually be useful i've been trying to use the command line more as my day-to-day interface so i'm dragging and dropping files less and able to keep my hands on the keyboard the problem with using command line is some of the commands are very obscure so i wanted to build a little bot to help me find the right command line tool for the job and so i started with a project i called command line tutor and basically i gave it some prompts to give it examples i said i'm a command line translation tool ask me what i'll do and i'll give you the unix command and so i used the sample that was very similar to the french to english and so i had the english phrase and i was translating it into the command line phrase and so this was a simple example and you can ask it questions like um how do i play an mp3 file and it'll tell me the command line way to actually play that mp3 file so let's say i wanted to install a particular utility or tool set a question mark and hit submit so it gives me a pretty complicated command line i probably wouldn't have been able to remember i'd have to look that up so again the idea is this will keep me in the command line from here what i did is i took the code and so gpt3 gives a code export so you can export it either as a python block of code or it also gives you a curl command which you can use in command line as well and so literally you can copy this text and let's open up terminal and we'll paste that in and you can see once you paste in the command it'll actually execute that exact command so you can see it's calling curl it's passing the temperature the tokens the information so what i did is i started with a tool called google collab i'd never really programmed in python before and google collab is a notebook based environment which makes it really easy to paste in python code debug it run it and see how it works and so really i pasted my code in here and started playing around with it you can create questions you can put a little if else conditional statements and then you literally run it right in the browser so you don't have to do any complex python installation or versioning makes it really simple to get started and so i did have to enter in my api key as i mentioned every developer tool requires an api key so unfortunately this is still in beta it's only available to people who have that access and now i can really play around with it so i can ask questions you know how do i put my computer to sleep i've run that command and over here if everything's working it'll tell me what i need to do so oh it thinks the platform is linux and this is one of the things i figured out early on is that if gpt-3 was prompted with the platform that are running on either linux or windows or mac it would produce much better results much more consistently returning the right thing so now that it knows i'm on a mac that's actually the right command i'm not going to put my computer to sleep right now but it gives better results and so as you prompt gpt3 with better information it's better able to complete those phrases complete those questions with the appropriate text as well so this gave me a baseline of my application and as soon as i had that working i was able to put it into an actual program and so this is a little more sophisticated it doesn't do too much again like i said i'd never really programmed python before but i added some options some command line switches uh that were useful for me i have made the code available up on github so if you're interested in checking out giving me some feedback telling me what i did wrong in python i'd really appreciate that like i said before you do need an open ai api key it won't work without that i'm hopeful that in the future openai will provide end user keys to make it easier for open source software developers to publish some of the things that they're creating with open ai so the core of gpg3 is a very sophisticated autocomplete so when you're designing a prompt or playing with a playground you want to give it as much context so it can complete the text as possible whether it's helping it understand that it's a translation bot or helping it understand the context that mac is different from linux is different from windows those contextual clues improve the percentages of the different words that it's choosing between and it helps it get the right phrase and helps it have the right context i found that ai is excellent and will get some very sophisticated actions and applications that you may be looking for you can often guess what you're trying to type before you finish the entire command and this is a great way to speed up typing instead of having to type all the characters you just type a couple characters off in a letter or two and have it auto complete now perhaps what's most surprising is that actually gpt3 generated that last paragraph i didn't write that so uh it is kind of impressive that it can do those things it doesn't always get it right in fact i've had a lot of examples where i prompt it with particular phrase or text or string and it either gets repetitive gets stuck in a cycle or it just doesn't quite make sense so sometimes it does require the author to tweak some of the parameters tweak some of the training so here are my five big takeaways from building my first gpt3 application number one is getting started is incredibly easy and it's incredibly fun i played around with how ai can be applied to ordering systems explaining medicine in plain english grammar correction and a number of other different experiments including seinfeld fan fiction scripts i'm excited because there's a lot of interesting applications and the technology is incredibly accessible it doesn't take a lot of technical sophistication to play with the playground and get really useful results useful answers out of it to really inspire and trigger some imagination for next steps and creative projects as well number two is it's not magic and it's certainly not perfect it would often go off on a tangent occasionally get stuck in a loop and they're controlled to just how it'll perform but tweaking these controls often seems to be an art not exactly a science number three developers should really think of open ai as infrastructure similar to aws and azure it provides the pieces of functionality for your product or application but it's also a dependency and a point of failure if you're starting a business you should really think about how you can really create defensibility and emote on top of this infrastructure and how to create defensibility in your product long term because the technology is so accessible more and more applications will be using this type of tool within their products over the years to come so thinking through the differentiation of your product and how you really leverage this technology is going to be really important for developers number four after playing with gpt3 i'm even less concerned about the technology becoming self-aware and trying to take over the world like terminator i'm really impressed but it still has a long way to go the pt in gpt stands for pre-training in the current version you're not really able to upload your own large sets of data to fine-tune the model this is something that openai is working on but for the time being the playground gives you an experimentation playground but it doesn't allow you to upload very large sets of data there are other apis that openai has made available for search and classification that do allow you to upload larger volumes of data but for the time being completion type playgrounds don't allow some of the fine tuning so it's still super impressive but it does have some ways to go lastly we're at the start of something really big if someone with no prior python experience can whip together an app that harnesses the collective knowledge of the web just imagine where professional engineers development teams and startups can go with this technology i'm greg reyes if you want to see more content like this let me know by subscribing or leaving a comment i love talking about technology entrepreneurship and design i'll see you in the next one you
Info
Channel: Greg Raiz
Views: 12,538
Rating: 4.9328861 out of 5
Keywords: entrepreneur, startups, design, ux, raiz, greg raiz, gpt3, gpt3 demo, open ai, gpt3 playground, Open AI, gpt3 ai demo, gpt 3 ai app, General Pre-Training, Machine Learning, Getting Started with GPT3, GPT3 Python, GPT3 App, Cbot, Command Line Bot, Command Line AI, gpt 3 playground
Id: NV_za8JlvXY
Channel Id: undefined
Length: 11min 30sec (690 seconds)
Published: Sun Apr 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.