GPT Journey - A text and image game with ChatGPT

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what is going on everybody and welcome to an image and text-based game LED entirely by an AI so an AI is generating the imagery the text the situations the options that you can choose from and then what happens from there it's all AI based and the imagery here is generated from openai's Dolly and the text is chat GPT via the API now you could actually have in the back end different types of models if you wanted so if you wanted to use some other diffuser model for the imagery that's totally fine and if you wanted to use some other text generative model for the text generation that's also fine the idea here is really just it was an idea I had obviously this the concept of a sort of interactive Journey you know text-based Journey or game or whatever through GPT models that's not new I haven't seen anybody tie in you know the image generation but one that's not really that advanced and two I'm sure somebody has thought of this before instead it's just trying I'm trying to like get my mind to wrap around this new possibility and capability of web applications and that just software in general I think there's so much more that we can do with software now that we have models that are these sort of kind of natural language understanding and generative models and even you know because they're so General we can take these very general models and restrict them to a much more narrow application and these models are still extremely powerful and actually more powerful than if you just try to train some narrow model on that task and in fact there are I I know at least there's a hundred thousand dollar Bounty for uh showing any task that if you have this larger more generalized model any task where if you actually had a more narrow model you if it if that if you can find some instance where it performs better in that way like some sort of type of task um people are looking for this because we're finding as we make bigger and bigger models uh in much more General and general models that are either even multimodal models as you restrict go back down to restrict those models to do some sort of task they're actually way better so anyways uh without further Ado this is the journey this is just one specific example of the journey every single Journey that you would take here is entirely unique in its own way and the options that you get everything is unique and no two Journeys would ever be alike same thing with the images in a specific Journey we first encounter a mischievous fairy which we attempt but fail to capture then we get paths to choose from consequences from those paths in this case wolves which we choose to scare off with our sheer bravery then we meet and speak a bit to a ghost we accept and we are given a riddle which we promptly solve due to how our my extreme intelligence as we leave we encounter a dragon which we probably won't beat this time in a physical match and I'm done testing my luck with pure bravery so I opt to use magic to put it to sleep I find some villagers and they offer me a horse to get home and comically well chat gbt does give me the option at this point to go ahead and just like steal that horse even though they offered it to me for free um I did opt to just take them up on their offer and I ride that horse home to complete my journey and again every time it will be something completely different in in my experience so far with just this exact pre-prompt and all that I do find the there's a Common Thread and theme that I keep coming back to which is either finding your way back home or finding your way to a new home um that said you are completely in control of what prompting you want to use in the themes and maybe even you can even you know encourage it to generate a certain type of story so maybe you want it to be more of a strategy based or more of a riddle based or space themed or what whatever you want um you you can pre-prompt your way into it and again I just I present this purely as a way to hopefully get people to start thinking more into the future about how will we not only make that software right um I even in this project it's very AI based in terms of how I developed it but then also the software the end result software can also be heavily heavily AI based in the back end so anyways uh without further Ado let's jump in so to begin I'm going to start with some code that you've seen before if you've already done the basic chat GPT API uh tutorial video that I put out last but even if this is your first sighting of openai first of all you will need an account and it's billing to be set up and all that or you can just kind of watch again you can replace the back end with anything the reason I went with chat GPT is one I just wanted to Ticker with it see how much it would follow my instructions how well it would adhere to them and then two it is just simply well now that I'm filming this gpd4 just came out but but it's really expensive like prohibitively expensive in my opinion uh at least for a task like this it has other very very interesting implications especially given the 32 000 context or 33 000 token sized context but yeah I don't think that's actually out yet but anyways digress so open import open Ai and then we will go ahead and set the key which I just am now realizing I haven't saved one moment okay and in my case I'm going to go open AI dot API key is going to be equal to open and I saved mine in the key dot text probably the superior way to do this would be to set an environment variable um but I'm not just I'm just not going to do that so so we set the key and now I will Define chat and again this is going to be I think identical or at least very very close to what you've seen before if you followed mine uh and in fact it looks like chat gbt has memorized it already I will be putting uh all the code uh in this tutorial in the description also the previous one that's available on GitHub as well uh there are things I just refuse to type out uh like the pre-prompt I'll explain what the pre-prompt is but it's just a very long prompt I'll read it out but no reason to type it out um so let me make sure this is exactly what I want so we do want to take a message history as input we will default to the role user again that is kind of what we did before um the API is just going to take essentially a list of these like dicks and you will pass for the context the history context basically the chat context you're going to pass a bunch of these um content that's just going to be the text and then the role whether that was the user the assistant which is chat gbt or system which at the moment I don't find much use of a system but maybe in the future or maybe people will learn what is the use what's a really good use case for system but anyways continuing on completion open AI dot chat completion so if this doesn't work for you you need to upgrade your open AI installation we're going to use the GPT 3.5 turbo model that is the chat GPT model essentially and at least at the time of my recording that's 0301 and as at some point it will be upgrading to o302 that may change some of the behavior so keep that in mind maybe they'll allow a way to use the older version I don't know I know there's a way to use the new the upcoming version but it's still I think changing so I didn't really want to mess with it and then messages like I said this is going to be a list of these dictionaries of you know in other order um of the messages so reply content this is just the actual text so once you get a completion it's going to come back it's going to have a whole bunch of stuff first you're going to have a bunch of choices to choose from we're just going to go with the very first choice we're going to grab the message message stuff and then we're going to grab the content from that which is going to be just that text and then we return just that text as well as the new history that we will later be able to append to and so on so so far that's all code that I've already shown before so it's kind of convenient that it went ahead and already just like pre-populated that for me I don't see much benefit in typing all that out all over again so then I'm going to now copy and paste the uh the pre-prompt that I'm going to use now let me also turn on uh word wrap okay so this pre-prompt is just the first pre-prompt I thought to try I've had at least a decent experience setting pre-prompt so I kind of know what to look out for um but again this was the very first I tried there are ways that I'm sure we could make this prompt even better and produce even cooler uh scenarios and results um but this is the one so I start off by with the role of user saying you are an interactive Story game bot that proposes some hypothetical Fantastical situation where the user needs to pick from two to four so already you could you could add more options you could also describe the situation in a different way if you wanted to pick from two to four options that you provide and not only could you make that a more narrow thing you could actually say you can make it more generalized if you wanted so if you wanted a lot more variability in the situations that come up anyway I picked from two to four options that you provide once the user picks one of those options you will then State what happens next and present new options and this then repeats if you understand say okay and then begin when I say begin when you present story and the options present just the story and start immediately with the story no further commentary and then options like option one option two Etc so as you can see we're gonna we're trying to leave the story somewhat you know open for openai uh chat GPT to think about and come up with but then we do want structured answers after it presents the story so some of you probably already see why why I'm doing it that way and then what we're going to wind up doing to turn this into a web app but next rather than leaving it open for chat gbt to come up with something else I just I force chat GPT essentially to say okay I understand begin when you are ready so now it's just expecting a begin from me so to issue that begin all we would need to do is we could just say reply uh reply content message history chat begin okay you're a wizard so we will just say begin uh and then we will now the story let's say begins so now I'm going to say four um in range I don't really want to do five I'm just going to stop at three I think you'll get the idea at three I assume so um I think basically so like when the pay so this this will happen on page load so when someone first visits that page what do we want to show essentially it would be this so imagine that's your your get request you'll see what I mean in a second but so we'll have already acquired that information so let's go ahead and print uh reply content eventually we'll turn it into a web app but I just want to show a basic form just so you have an idea what's going on and then so we've got reply content now we're going to say next input is going to be equal to input enter your response that's fine um and then this will repeat so the idea here is to First make sure this works as we're expecting so let me go ahead and open a terminal GPD Journey Great Python I think it's three on here GPT Journey so we're waiting for a response from the API uh so we have here two options in this case so it just says great I wish it didn't say great uh it shouldn't have done that that would be a mistake that would be something I would want to try to massage the pre-prompt so that it does not do that I we tried I tried to say don't tell me anything else but we might need to phrase that in different way welcome to the world of magic and mystery you've discovered a mysterious doorway in the woods the door isn't is old and Rusty with some strange uh or with strange markings etched into its surface as you approach the door creaks open and a voice Whispers from the other side so we have the option now to either enter the doorway and explore or we can leave the strange door and continue on your journey presumably go somewhere else but the idea here is I could say option one and the hope is that the AI is going to continue the story based on us having chosen option one sure enough we do uh and uh this this is interesting I I have personally that's that's curious of this the first time I've ever seen it propose option 1A 1B 1C head towards the college explore the forest for Q you choose to leave the strange drawer and continue on your journey I'm actually not I have not calculated for this too so this is a good example of you know again we really need more structure and at least in my experience I've done probably a hundred of these Journeys I've never seen this and and of the journeys that I've done I've you know gone through many options I've actually never seen it propose a 1a1b1c uh crazy anyway um I think I think my logic would still handle for this but that's that's very interesting anyway so we can continue I'm going to choose option two option two I actually now this this will be in the context forever so it'll probably continue doing stuff like that that's so funny uh live demos okay who who loves them so um anyway regardless of that strangeness um option two 1c1 what is happening that's so crazy um I'm gonna pretend that's not going on and we're going to precede the the root but that's so funny um I for everything I can think of this will still continue to work the way that I've you know planned it but that's that is funny okay so you continue to potentiate the feeling that you might have missed out on something special oh gosh okay so it's at least you you get the idea you're getting you you're presented with a story then you're presented with options you pick those options and the story evolves based on those options that you've chosen so okay so we'll come back here and I think what I'm actually gonna do um I'll save this because we're gonna copy pasta probably but otherwise I'm gonna get rid of this and now we're just going to do the web app aspects now again comically enough uh for the web app uh the way I started this web app was actually I presented what I was trying to do to chat EBT and I had Chad gbt uh create the sort of scaffolding or skeleton application for me and again I just I I really um I don't want to gloss over the fact of of how uh code development is changing before our eyes again you know yes we're making this AIA AI based game in the showing off chat gbt but also it's like I just can't help but recognize how much AI has already just infiltrated my development process to the point where I I really do I prefer using chat GPT and yes not everything's right but you can go back and forth and get it to get at least to a point where you're pretty happy and then you make the tweaks um I don't know it's very it's very interesting to to see what's happening with AI in specifically coding and obviously everywhere but coding for sure obviously for me that's that's kind of where I see it impacting so much so fast um anyways continuing on while I still have a job first what I'm going to do is we'll come to the very tippity tap and let's go ahead and uh from flask we're going to import a flask render template uh request and session um okay so once we have those I'm also going to import a re import re for regular Expressions we're going to use that to pull out basically these options so we're going to once we get this just because obviously Jan gbt doesn't know you probably could though like part of what I've been thinking about with chat gbt is like you could tell chat GPT that not only is an assistant it's a web-based assistant and please always return to me a full HTML page of what you know whatever your response to me is and that's kind of one of the other projects I plan to try to do is it it really could talk as you know talk to me in HTML or talk HTML to me or something like that will be the name all right and um I really think that like you could get crazy Fancy with this stuff so you probably wouldn't even if you wanted to you could probably come up with some sort of prompt that you wouldn't even need to do what I'm about to do but anyways continuing on so regular Expressions uh let's also go ahead and app equals flat yes sir thank you app dot uh secret key secret key equals yes big secret thank you um and then while we're at it um the other thing I want to grab from openai is the image generation or uh you know the dealing with the image API uh we can well we can type it out let's do Define get image um I will pass prompt so that will be the prompt and then we're going to use the openai uh API for Dolly so we are going to encase this in a try and accept a very general except exception exception as e we're not even going to handle for accept exceptions e we're not even going to um it took me way too long to realize for what I had typed um we actually don't want to print e my bad and instead we're going to say image URL equals and I'm going to copy pasta this so we're going to attempt to query the dolly API but if the dolly API detects uh an image that it thinks it's on say for whatever reason it's going to fail so we want to be able to handle for that I didn't find chat gbt to fail on me too often but the image generation I did have that fail I mean at least a few times especially on this like Fantastical Journey if you get into a fight with some monster or whatever like it the I I think it's a little overbearing I wish I could see the images it's trying to blow out on me but such is life so what we're going to do is we're going to say resp in this case response is equal to openai dot image dot create and in this case we will pass prompt we will say we just want one image and then size we're going to say in this case will be 512 by 512 there's 256 by 256 512 by 25 and 10 24 by 1024. I did not find response time to vary enough to make a difference I just 512 by 5 12 is a good size so that's what I went with all of them take about five seconds or so to generate an image um and we'll I'll try to remember to talk a little bit more about response time and how we you could get around it if you if you wanted to like if you really wanted to make this put this into production and have people play it or use it or as you're thinking forward into like how might software like this really truly function if it wasn't like a game and it was instead you know some end user product there are ways that you could you could fix this but anyways continuing on response uh and then image URL is going to be equal to response DOT first you'll get data we'll go with zero with one and then we will say dot URL the API does not actually return to you an image it returns to you a link to that image I don't know how long that link is good for but it's good enough for our application now you might need to in production you might it might be a case where you'd want to save that locally but yeah we just want to display it so if it fails I'm going to just display an image that says the image failed or something like that I can't remember exactly what I made for that image but I remember needing it so uh so that's how we will get the image from the dolly API that's all we have to do here is for the chat API or chat jbt and now we are ready to actually build our application so I'm going to come down here and um yeah I'm going to leave that just for copy pasta uh reasons later and we are going to begin so we're going to say at app Root this will be our home page and I want to pass methods will be actually get and post I didn't see if it actually suggested that to me methods equals thank you sir okay so that's our app Root and then we will Define our index and in here uh what we're going to do is first we're going to start with I'm going to start with the page title so this will be both the page title and then the title [Music] um in HTML basically so the tab title I suppose I would call it so we'll call it GPD Journey it was close to picking the right title and then we're going to start with initializing the button uh button States and the button messages so you'll see what I'm using those for shortly but so button messages will be an empty dictionary and button States will be also an empty dictionary then we will begin with request. method I always like to go in order so I'm going to start actually with get so if it is a get request the only time we should see that is when the user first loads that page essentially so when they're first visiting what is step one that must happen well we are going to start by setting the session and in this case we're going to start by setting that message history and that is going to equal this message history however I'm actually going to Define it in here now so I'm going to go bloop like that and you do have to make that noise when you do it so make sure you do that if you're following along uh I think we're good there so that sets our message history to start with and I think every uh I can't decide if I want to leave word wrap on or not I don't know it kind of bothers me but maybe I'll leave it on once we have that what we're going to do is now we're going to message history equals session and then message history so now that that's saved to session we're going to pull that from the session we're going to modify this variable as we're working and then at the end we'll reset it to that cool so message history done reply content message history Eagles chat and in this case we are going to issue the begin and cool roll will not be assistant it will actually be user that is the default so I'm actually going to go ahead and just do that um cool so reply content is going to contain both the uh kind of story text and then and the option so what we really want to do is we just for now or because we're going to make buttons out of the options especially I don't want the options in the text we want those to take on the form of a button so instead we're going to say is we're going to say text equals reply content that's correct but we're actually going to dot split and let's see if it I don't think it could possibly know what we want to split by so we're going to split by it's close option um option one and again if it does as one a one that stuff we're in trouble but that's okay so we'll split my optional actually it would always start with at least this so let's put it like that and grab the zero with so that will be just the text next we're going uh yep this is why I love copilot because this is exactly what I freaking wanted to do next yes thank you so essentially to find the options that we wish to use we are going to use a regular expression to find all instances of option some number followed by some text this will give us a list of the options that we have to choose from because it is going to be dynamic it's two to four again you're you're free to say 2 to 10 or 2 to 15. I mean you can have a lot of fun with this generating lots of options you could even allow the user access to a text box I didn't do that because I just feel like that opens the door to too much like it'd be too easy to like hack the journey I guess and I I feel like it would be less fun but I really don't know and again this was just this is a really quick project that I whip together um just trying to see like is this functional does this idea work and then just just trying to get used to like working with all these this this new kind of software and this new capability of of applications um I'm still wrapping my head around it so text and options uh great we've got that now we want to do is we are going to uh create a dictionary for the uh buttons and their options all that so what we're going to say is for uh stop at least this is not quite what I wanted but I'm every time every time I think about um I mean let me write this out first and then I'll I'll say what I was thinking um so button messages and then this will be in this case an F string button I so yeah so so crazy every time uh copilot suggests something different than what I have in mind it always like makes me stop and think like hmm am I actually doing what I want or is there a better way like it always like makes me feel like I'm probably doing something wrong um anyway but once I started this it actually did correctly predict what I was going for it's so crazy it is so crazy um it's so fun to like point out all the flaws of these GPT style models but at the end of the day that like the doors that are now open are just it's just crazy it's mind-blowing to me um okay so that is that's what I want that's all I want for that Loop next we're going to save four button name in button messages we're going to say this is close to what I wanted but not quite we're just going to initialize them as false so we're just saying hey no button has been pressed okay that's our get request if we had the template already we could actually test it and run it I don't have it yet and I think this is actually simple enough all we're doing we're pre-prompting we're on the page load we're actually going to go ahead and query the chat GPT model this means the initial page load will take a few seconds again at the end I will do my best to remember to tell you my various ideas on how this could actually be like Lightning Fast um but for now we'll just we'll leave that so what it's going to do is it's going to begin it's going to get that text presumably it will be passed you will see later it grabs that text um and then we also grab the options which we're going to convert to buttons but we you know we have this in a variable so once you have this in a variable and you pass it to an HTML template you just do the double curly braces boom you've got your variable in there this we will iterate through with a for Loop and ginger templating easy enough and format it as a button boom done easy so that will load awesome that's actually all uh all I want to do I believe sausage did we ever um I think while we could do this um I'm actually going to do this just at the end regardless of whether or not it was a get or a post so I don't it's copilot is correct and thinking that we want to do that but I'm actually going to we'll do that at the end so um so if it's a request a get request I think we're set yeah so now what I'm going to say is we're going to Define two starting things we're going to say message equals none and we're going to say button name equals none uh then we're going to begin the post request thank you Copilot it's just so crazy how good copilot is um I actually don't I'm not going to use those just yet so we're going to open by setting grabbing the message history from that session which I do want um and I do that's okay message history equals session I wish you could like tell co-pilot like I just want that first line there might be a shortcut for that it'd be nice um so we've got our message history and then we're going to do button messages equal session button messages yes that is exactly what I wanted now button name stop well how does it know that that's what I want to do I don't know I think this is valid uh someone comment below if that's valid but I I've always done it form dot get that looks that looks to me like it would probably work but I don't know form.get button and actually it's not button I got lured into that button name um okay button name cool uh and then what we're going to do is now we're going to set that's the one that got pressed so we want to go ahead and add uh set that to true and so we'll say button States but name equals true yes correct so then we're going to grab the message that's associated with that button so that's going to be button messages dot get I so again I think that actually would work but I'm going to do a DOT get just in case I'm going to say button name someone not only comment below if that if the other method works if like if one is better than the other for some reason that I am unaware of so so we have our button name we've got our message yes we are now ready to query the chat GPT API uh we do want reply content message history we will pass the message which is from that button and the message history great so um yep that's I think that's everything we want text yes sir that is what we want so again we're just we're just splitting at option one we want everything above option one that will hopefully be the story text that we want to display in like paragraph form then we're going to grab our options again it's that same regular expression again we probably could have like a function or something else so we don't have the exact same code as above but for now this is just a proof of concept and that is all I ever developed so um now what we're ready to do is we've got text we've got our options now again we're going to reset um and in fact I already started typing but yeah so copilot is just so good so copilot wants to do this and this is almost exactly what I wanted to do um and in fact yes that is actually accurate um and then let's see for button name in button messages um button messages uh buttons am I am i r d of this I was using dot keys and actually that probably didn't come from me that probably came from chat GPT um I think that's a little redundant I don't really know that we need that in the grand scheme of things that's probably that's not going to change anything what we're waiting what we're spending the most time on waiting for is the response anyways but I believe that's redundant um again it's been chat GPD has been coding for me so I I don't even know how to code anymore um so so this probably it might work the problem is I think really we need to throw in a button messages in an empty dictionary here because if we are presented initially with four options we'd get four messages and then if here we only had two we wouldn't we would have more messages and I I'm trying to think if that would actually matter in the end I'm not really sure it would um but it seems wrong so I'm going to go ahead and clear that out beyond that um we're done so I'm going to come down here and we are going to now reset our session message history and the button messages could we are done it's so close to understanding everything I want that's probably all accurate index.html that's fine we're going to return title equals title text equals text button messages button States button name I don't know that we need button name let me just tab that and accept what it suggested let me check my code yeah I don't we don't need button name we can pass it I don't think we needed that let me just I'll just delete it because I I'm curious but I don't think I need that but also we don't have our image and I feel like the image makes makes it way more interesting I really have enjoyed the images so image URL is going to be equal to get image and we're in this case going to pass text now I've I considered I thought it would either that would work you know being very lazy and just literally passing the entire situation you know current situation I also thought maybe it would just work best to do like the last sentence so split this into sentences and then just go with the last sentence to generate your image um I I personally have found just passing the entire entire text has worked really well so that's what I'm going to do I'm just going to pass the full text so that gives us our image and all we want to do now is we're going to say image underscore URL equals uh image underscore URL I put a space there I don't really think we want that it's kind of annoying uh [Music] I believe we are good so then all we would want to do at this point is if really you're gonna maybe type this out of all the things thank you um I think on this port I think on this machine I'd be fine on Port 5000 the default one but I'm gonna set it 5001 and uh we're good the only thing we're missing now is the index.html so GPT Journey we're gonna make a new folder we're going to call it templates we're going to come into here and I'm going to touch a index.html I'm going to minimize that out of the way and we are going to open it with vs code and here we are in our index.html I am not going to write this out line by line with you on video I think that's a waste of everyone's time I'm going to copy and paste all we have here again this was uh generated completely by chat GPT for me I did not write this code I don't think I wrote any of this code um I'm trying to think I don't yeah I did not modify this at all I just told chat gbt what I wanted I showed it I showed it my I just passed in basically get journey.pi I said generate me an index.html that makes the choices a button like that was it and then I asked it to add style for me because it started off without any style at all it made me pick or told me some options to choose from I just told it to choose and that's it I mean that's that's it um I didn't write this so uh so yeah this is what it presented for us uh the title uh is that title um and then it also shows the title and text so this will be like your tab title and then this is the actual title and text uh we will show the image itself again that image from the dolly API is just a URL so we're just displaying it super simple if it fails for whatever reason we're just going to display the URL from python program.net that has that it just says like image failed alt text we could later add text to that I don't see any benefit to that this page will never get indexed anyways but at a later date if you are using this for other means you may actually want to save that alt text and you might want to make the page a static page or save it in some way um yep paragraph text we just paste the text and then we will iterate over these buttons um so button name and message and buttons and we just simply make those buttons that's it um and then later if that if this is the the button that actually got clicked we show the message and that's that's it so um yeah pretty basic loading in the JavaScript for bootstrap there's nothing more to see here so we're gonna go ahead and save that now what I want to do is um and in fact actually now that I'm thinking about it this this is redundant uh because this is going to post immediately upon clicking the button this will never show up at the time it did show up um when I first started without actually the post request because I developed this HTML page uh prior to um having a post request created so um I'm just going to comment that out I don't think that actually has a use anymore but just in case I've I'm derping at the moment which is totally possible again I don't I don't write code anymore okay save cool uh yeah let's go ahead and run it let's see what happens let's see what happens GPT journey.pi boom okay no immediate error that's nice we're gonna open that pull that down so initially the load is a little long uh it's uh chat ebt's maybe a two to three second response time and then um Dolly is about a five to six second response time so adding it all up you know you can you can get to the 10 second Mark it's a little it's a little harsh but let's go ahead and test this real quick and then I'll talk about my ideas for how you could actually speed this up so you find yourself in a dense Force completely lost as you're walking around you try to find your way back you hear strange noise coming from behind you you turn around to see a giant talking mushroom staring back at you so run away from the mushroom as fast as you can I might get up and search Jason you never know ignore the mushroom and continue walking around we'll run away approach the mushroom let's try to communicate make sure our post is working and in fact let me this real quick make sure that we don't see an error okay you cautiously approach the mushroom and try to strike up a conversation the mushroom responds in perfect English and tells you that it's a magical mushroom that can grant wishes however before it can grant you wish you first must pass its test uh oh a live test for me on oh yikes I just think we should refuse that test what the test entails before making a decision hell yeah hmm laughs the mushroom tells you that the test involves a series of riddles that you must solve if you answer all of them correctly it will grant your wish agree to take the test let's get to these riddles I find when it presents you the options to answer your riddle um it feels as though it's much easier than if you just had to input text the mushroom nods and starts asking the first riddle what has a heart but doesn't beat an artichoke like um you get the idea I don't think I'm going to progress through this entire Journey like I said this one does tend to as you do your journey it does tend to um what begins I'm sorry I have to I have to read it what begins with t ends with t and has t in it what tangent t [Laughter] ense what begins with t ends with t and has t in it I don't know tangent say you don't know I wonder what would happen if you said you don't know because I mean t has t in it but it doesn't end in t what runs around the whole yard without moving offense a dog on a leash I almost want to like answer the wrong thing and say it doesn't know I'm gonna say a dog on a leash and get it wrong and just see what happens I'm just curious I never failed these riddles I've this is like the second time I've seen these these riddles the mushroom nuts I don't think a dog was the right answer right it should have been like a fence right I'd have to maybe I'll go back and see my wrong answer but what is always in front of you but can't be seen the future air your nose I'm gonna say your nose let's see if it nods with approval I think no matter what we were going to win that riddle that's interesting uh grants your wish as for the ability to fly oh my gosh I have a lifetime supplied for a magical object I want to fly I mean that's that's my dream okay so how could we further improve this so what I was thinking about was you know this is a it's a pretty good amount of time in between um in between these responses because of the the time it takes to generate the image because of the time it takes to generate the text a couple things to think about here first of all the so the capability of these models I think is you know like is really what we're trying to test at you know at the outset of these models it's seeing like okay these things that historically have this has never been a possibility for us to just write up a quick app like this in a day and have this sort of functionality this is crazy um it the response time first of all these models the hardware will improve the infrastructure for companies that provide apis like open AI that will improve the response times will go up so or go down I guess anyways improve um so you know into the future three to five years let's say this functionality what we're doing here can be instant so that's number one so first just like all the things that you're thinking of especially if you're trying to like start businesses on this kind of stuff or think about it in terms of your own company or your Enterprise whatever where you you want to start thinking like okay well like let's figure out what's possible today and maybe it's not as fast as we want it to be but in three to five years it will be and then who knows what else is going to be possible but we gotta start thinking about things in in this way this sort of like Dynamic software way that really we've just we've just never seen or had the ability to have tools like this at our disposal and again at least what I'm tinkering with now in all you know to to develop this app and work on this app and I spent many too many hours like playing in this app um I think I spent like three dollars in API query so it's super cheap so it's already cheap it's just not maybe not as fast as you would want but if you did want to make it faster there are things that you could do so first of all you could pre-load the next prompt so for the next viewer or user you could have already pre-loaded that begin right and had one ready to go and you could just be constantly preloading those prompts so everyone gets a unique one that's never been seen before but just preload them so you could pre-load them and just start by injecting that into getting the responses but when you pre-load that as soon as you have that you know what the options are so in this case we could have pre-loaded a prompt we could pre you could pre-load however many steps into the future you want to go and by the time like the response time this is a pretty short one but a lot of them are kind of long and especially once you read all of this text and then all the option text you've probably exhausted five to ten seconds so you could have you could just be one step ahead of everybody it would cost you in this case about four times more money for the query so rather than spending three dollars in a day of development or three dollars you know on you know for a user to use it for you know say all day or for a few times or whatever um it might be a little more expensive so 12 or something like that and again the that is very twelve dollars would be very expensive for like a day's use of some software uh so then that like that decreases your capability of like what who might find this useful but uh as time goes on again this this level of performance will get cheaper over time there's no question this gets cheaper as time goes on and then if you did if you could change the back end of all these models and actually do all the pre-processing on like CPU and Ram or your own local hardware or whatever to reduce costs so again there's what I what I really want to show and think about is more like what what's possible yes to kind of proof a concept today but imagine what will be possible in three to five years it's going to be insane so um so anyway you could pre-process so you could pre-process that prompt you could pre-process the response and imagery for each of these options as well so that you could go two steps and you could just keep doing that as far out the tree as you want to go obviously each step you go out it is going to like times four sometimes it you know you only have two options so it's a little cheaper um but you could you could do that as far out as you want to go so anyway um yeah that's at least one way that this could be done and you could do that in like um you know in separate processes or something and not have one result waiting on the other results but anyway uh pretty cool it's a it was a fun app I enjoyed playing with it if you have an open AI key I encourage you to download it and kind of play with the journeys they're they're pretty fun to be honest they're kind of Addicting to go through I do wish the response time was a little quicker but I actually didn't really mind the response time when I was tinkering with it but um yeah you'll find a lot of the stories at least with this prompt too do like I said earlier kind of Follow that sort of similar trajectory of like you're lost on this journey find your way home find a new home find new like a new set of people to hang out with so in that in that example that I showed when we found the villagers one of the other Journeys I went on was uh I ended up finding some people and then I ended up just like living out with them basically um they pretty much always end in a Wholesome Way which was also curious um but again through pre-prompting you could probably get them um you you could tweak these stories however you wanted so anyways lots of stuff to play with if you've got like suggestions on how to improve that do feel free to leave them below also if you want to learn more about neural networks and how they work you know what I'm going to say neural networks from scratch book at nnfs.io for how to create and train and test use neural networks completely from scratch in Python no third-party libraries we do wind up using numpy just to make things easier but only after we show how it's done in true raw python so if you want to learn more about neural networks and how they work definitely check out the book at nnfs.io otherwise I will see you all in another video and again if you want the code A Links will be in the description for the full code so you can just download it and play with it and I look forward to seeing if anybody comes up with cool cool uh cool examples cool web apps and stuff definitely share them down below if you do um and like I said or like something like the talk HTML to me or something I think I just man there's so many doors that are open now uh that we just kind of have to figure out what makes good prompts what what types of structure do we need to have uh to make things work and all that so it's it's really exciting it's a really exciting time to be playing with models like this so anyways that's all for now thanks for watching and I will see you all in another video
Info
Channel: sentdex
Views: 34,493
Rating: undefined out of 5
Keywords: python, programming
Id: YY7LIEHiAfg
Channel Id: undefined
Length: 46min 56sec (2816 seconds)
Published: Fri Mar 24 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.