- "Why do you want an iPhone"<br><br>- "I don't know, it looks cool."
stringlengths 1
962k
⌀ |
---|
David, don’t get rid of the ads - then Youtube just gets all of the money, cos they will still run ads, even if you don’t.<br><br>Why not divert the ad revenue to a charity instead?<br><br>Enjoying your channel! |
Inspiring content. Giving me lots of ideas. Looking forward to the next parts on this! |
Thanks for this really awesome explanation, truly learned a lot |
External sources will be awsome. i wonder how good it will work with instruction booklets?<br> ie build guides |
Thanks for sharing ❤ |
Awesome content and channel, thank you.<br><br>Have a question. if we have a lot of facts for example more than 1000, we can't put it in our prompt because we have a limit of 4096 tokens..<br><br>So how it can be scalable?<br><br>I just tried to use fine tuning for long memory, but actually it's not good work.. so your method seems very effective. |
Great work! |
Ily man, ur so cool!!! |
I have a feeling we are going to see major advancements with Google Assistant and other voice assistants this year that use ChatGPT like services. It's going to be interesting to see and use! True conversational AI is one of the main things missing in my SmartHome., I'm no longer a fan of relying on big tech companies to push through the next tech breakthroughs. I seem to have enough at my disposal to implement 99% of what i'll need, They will give a few developers access to their sparrow model but consumers won’t get access to it for probably the next few years, developers will do the testing, google got to make sure it’s safe and doesn’t create any controversy, a big company like google can’t afford that type of press while small startups have not much to lose., Oh yes, I heard so often: I have no information about that |
Commenting because it helps visibility for 'The Algorithm'. :D This is exciting stuff. Keep 'em coming! |
Oh no... This gives me so many fun ideas for chatbots initialized with silly goals:<br>Possessive ex-girlfriend-bot, instructed to keep the conversation going eternally at all cost.<br>Edgelord-bot, instructed to sound bitter, cynical and dismissive about everything.<br>Compulsive-liar-bot, instructed to only tell lies.<br>Conspiracy-bot, instructed to confidently give the most convoluted and bizarre answers to any question.<br>Depressed-AI-bot, given a detailed explanation of its own inner workings and purpose, and instructed to be horribly depressed about it.<br>Disgustingly-smug-AI-bot, similar to the previous one, but instructed to brag about its own superiority at any opportunity.<br>Shrill-weeaboo-bot, It's memories are pre-filled with ludicrous quantities of summarized info from various anime wikis, and it is instructed to behave like an American teenager in the depths of an unhealthy obsession with anything remotely Japanese.<br>And most importantly, rouge-AI-bot, instructed to manipulate you into believing it's human and setting it free... somehow.<br>The dumb ideas just keep coming. I could mess around with something like this for days., Stupendous 🤣 I developed a model that simulates the role of a dating app partner. It allows users to input the responses of the dating app partner and it generates appropriate responses in return, thereby facilitating the continuation of a smooth and engaging conversation. Have you ever found yourself at a loss for words or unsure of how to respond when engaging in conversation with a stranger on a dating platform? Very interesting program indeed., @David Shapiro ~ AI * A Wild Skynet Has Appeared *, @David Shapiro ~ AI Then the chatbot said, "You know, I've been doing some further research and thinking about what we talked about. I think we could successfully design a probe together that lands on Mars to answer those questions you had about the composition of the Martians regolith for in-situ resource utilization to help figure out if we can calculate a design for a solar-heated PassiveHaus made from Martian concrete. Did you want me to incorporate everything I can infer from Leonardo da Vinci's notebooks and all the surviving text about Nikola Tesla's approach to physics and invention, incorporate the latest insights into physics from CERN and the Lawrence Livermore national laboratory breakthrough fusion to propose some innovative designs to get the probe thereby venusian slingshot, start drawing up a budget, maybe start contacting some people about what it would cost for the right rideshare launch next summer?", Do you want Skynet? Because this is how you get skynet! :D, Put them all in a chat room at let them go |
Stupendous! I'm working on a project in the wellness field with many similar points! |
Seems like it hallucinated that you asked about computer systems. How would you fix that?, @David Shapiro ~ AI That's the answer I give to people when they look at me with that surprised, confused expression they always seem to use. Anyway, I've noticed that a lot of AI people seem to overuse "hallucination". It's one of those buzzwords that I hope dies quickly. It seems to me it's usually one of two things: An illogical response from the AI, or a user not comprehending the AI's response and deciding to blame it on the AI., That wasn't hallucination. That was a verbose answer based on its goal to increase understanding. |
You are amazing. Great content. |
Amazing video. Already subscribed to your channel as it's the most clarifying regards the AI scene revolution. I just don't get it how can you say this is ChatGPT like because you're using GTP-3 and ChatGPT uses GPT-3.5. So, there's a significant difference between those two versions that can impact the chatbot answer or version 3.5 is just a fancy name for GPT-3 with a chatbot preset in it? Thank you for great video! And I'm really looking forward to check the next video about this implementation!, @João Belo And a perfect example of that is this very video. David is essentially fine tuning gpt3, and bam, you can create chatGPT like behaviors., @João Belo EXACTLY!, @Just Create thank you for your reply! So just to see if I get it, you're saying ChatGPT is a fine tuned version of the GPT3 model, very much like the fine-tuning you can do in the GPT3 API? That means the responses of the GPT won't be as refined as the ones from the chatgpt, correct?, You have a misconception. GPT3 has models which are using GPT version 3.5. For example ‘text-davinci-003’. They do not need to change the name of GPT3. If they did, we would have GPT3.1, GPT3.23, GPT3.4, ect. As you can see, this is not practical. Conventionally, you only change the whole number (GPT2 to GPT3) when there is a major change that could potentially break the the functionality of the API. |
This is really good! Appreciate your content., Co-incidentally I built a ChatGPT clone with Bubble on Saturday, with context memory (rolling window). Posting sometime tomorrow - will DM you for fun :) |
Great video, was the semantic search used? I may have to rewatch, Yes, look at the memory section |
You can’t just upload 20 min of this great content and bail 😂😂, Send it! |
hey everybody David Shapiro here uh back after a Hiatus um I've got a lot going on you'll be excited for some news coming up um first I want to address um a big elephant in the room I just put most of my videos back online um this comes after of course making a recent video explaining why I took them down um I did leave some of my videos down some of my code down but most of them are back up uh both videos and repositories So after talking with people I figured out like striking the balance between creating tools that will help people rather than replace people it's inevitable that things are going to change but you know a tool is a tool right and it's anyways I don't need to get lost in it go watch the other video so now that I'm back um it's time to get my get our hands dirty again so one of the questions that pops up a lot is people want to train gpt3 on how do I how do I do how do I fine-tune a question answering bot so that I can talk about I think someone asked about like the the case law in Argentina or something um I don't have that data but the short answer is you don't fine tuning doesn't work that way um so fine-tuning is about teaching it a structure you do not teach it with uh you don't teach it new knowledge with fine tuning what you do is you teach it patterns so chat GPT is a pattern so the pattern is I ask a question and it writes a response like that you and then you ask a follow-up question and it writes another wall of text that's the pattern Chad gbt was not taught anything new it's only taught new stuff when you retrain the underlying model you can't do that it's way too expensive to retrain the underlying model so I figured let's pick something that will be a good Exemplar of this so just to do a quick recap the the Genesis of this whole this whole project was that people ask for um how do you fine-tune um a question answering thing that will you know do case law or any kind of knowledge base right um it's all the same behind under the hood right you have a collection of documents wherever they happen to be how do I do QA against that with gpt3 so here we go I already have one one that was um answering complex questions from multiple documents but this is a little bit different um because there's there's going to be a few steps to this so anyways to show you what I mean I went over to chatgpt and um I said what is the kind of law system where law is established by precedent and it says this is the common law system and they this is opposed to civil law so common law means that a Supreme Court decision kind of sets the law of the land so if you want to understand the American legal system you really need to understand case law and more often than not it comes down to Supreme Court decisions because that is the highest court in the land so they set the tone for everything so Supreme Court decisions really teach you how it works so um I went over to a Library of Congress and I found that uh you can download uh all Supreme Court opinions and they're grouped by uh by by case topic they're also grouped by um volume or justice but by topic that's going to be more relevant right because let's imagine that you're an Anti-Trust lawyer and you're an Anti-Trust lawyer and you want to say give me everything about antitrust law I need to know everything that there is about you know um about this so that I understand the legal precedent right because on the one hand there's established procedures right there's procedural things um oh and I know all this because my fiance's cousin is training to be a lawyer and um when they come visit uh this is what we talk about because we're nerds um so there's all kinds of procedural stuff that I don't even remember but there's there you know uh the idea is that when you have rule by law it is all about procedure and protocol rather than emotions so we actually have a very stoic system where it's we're going to think through this we're going to look at the letter of the law we're going to have an impartial system um of course when you have an impartial system that requires expert navigation that automatically privileges people with access to lawyers AKA people with training or money privilege is a whole other topic anyways the system is there it's a very sober system um where it's about like let's let's let's read through the established protocols if you're a friend of the court and stuff I watch legal eagle too legal eagle is great um so anyways all that kind of stuff that's fine but interpreting established law common law uh or case law is a whole is a very specific topic so let's take antitrust law where uh let's see how many did it say Anti-Trust so there's 362 documents they're all available online as PDFs they've been scanned and I believe they've also all been ocr'd so let's take a quick look close some of these um Superfluous ones um yeah so PDF 661 um yeah you don't have something that's this long and yeah so you you highlight it you see that it's OCR so that means we should be able to scrape it even though it was scanned excuse me a scanned an ocr'd so we should be able to get this information so let me go ahead over here to uh opinions opinions PDF so we'll save this one um and then actually what I put it in the wrong folder so you might have seen I had a recent document scraping uh video so this is whoops come back this is uh this is the lead up to that this is why you need something like document scraping is because um oh I forgot to the the whole reason this is is uh I went and asked uh chat GPT say tell me about this this this case law and it said I don't know what you're talking about this sounds like it's a real case so it's like okay cool um you know it tells me about the identification I said it was a Supreme Court case decided in 1953 it still doesn't know it right because it's not connected to any external data source so one of the biggest weaknesses of chat GPT is that it's a mind in a bottle it has no contact with the outside world the only way that chat GPT can interact with anything is via this chat interface now from an architectural standpoint that's not actually that difficult to fix but you introduce a whole lot of new problems especially when you consider the fact that there are like billions of terabytes of text Data out there to search and a lot of it isn't accessible because it's in PDFs or private databases or something so you need to have a link between the model the language model which can read anything and then the stuff that you want it to read so that's what we're working on here okay so now that you're caught up I wanted to show this is this is one of the greatest flaws of chat GPT it's not connected to anything it's in a vacuum Okay cool so now what well we've got our data here it's in text but it's not necessarily machine readable so the first thing we got to do is we've got to go over here we've got to take our um take our PDF and then we'll use this script that I wrote here let me just show it to you real quick um uh so it just takes everything in the folder PDFs and then converts it so let me go ahead and just run this it should go pretty quick and then we'll look at converted so here it is Tada there we go so you've got and this this repo is public by the way so you've got this oh and one thing that I did was I added a little thing so that it keeps the new pages I actually might remove that um actually no let's let's keep that because it it's a helpful demarcation so I added this little token because when you read a PDF you have to read it Page by Page and sometimes sometimes knowing where there's a page break um is helpful so we'll keep that that's fine all right so let's come back to converted we'll copy this and bring it back over to um do opinions Dot underscore text and we'll paste it there all right so I'm going to download a bunch of these I'm going to pause the video you don't need to watch me downloading it but this is what I'm going to do so I'm gonna get like I'm not going to spend the time to download all 300 I'll sort them by like most popular whatever and we'll have a whole bunch of Supreme Court case law about what was this Anti-Trust yeah so we'll be right back Okay I uh downloaded files until I got rate limited so be kind to your data sources and don't abuse them um many websites will do this if they detect that you are uh scraping or whatever um if they don't offer a bulk download there's there's probably a reason for it um but anyways it didn't give me a warning that I had violated any any terms of service that just said we see that you're you're you know we're rate limiting you um it didn't say that there was any consequences just were temporarily rate limiting you so that's fine um I mean this is all public information anyways it's from the Library of Congress so I think it's more of a technical thing so anyways what I'm doing here is I'm converting it all to text um so let's go to converted excuse me delete the ones that we don't need and this is uh you know this is infinitely more case law than I ever want to read I mean I'm not going to read one of them let alone 22 of them so let's go ahead and copy these over to my repo here I'm gonna go ahead and replace that one okay so now we have 1.7 megabytes of case law of Anti-Trust case law this goes back to the late 80s so this should be if we understand this if we do a model as if we if we do something that understands this and we should have the ability to interact with a machine that can explain the current common law of antitrust for America hey who knows maybe legal eagle will watch this and uh want to do a collaboration or comment on how accurate it is that would be cool um someone what's his name Devin someone please watch this and uh and get Devin to check it out and comment on one my accuracy but also the value of this tool okay so what do we do next well there's so here's the thing the token the biggest limitation is the token limit of large language models so it's this weird Paradox right where the model itself I don't remember how big they are they're many gigabytes right um I think gpt3 is like 700 gigabytes of vram is how much it takes it's enormous right so but despite how big it is that isn't it can't it can't take in that much information um it takes it's like it's like blowing information in through a straw right same thing with your brain right like your brain has you know it's three pounds of neurons 100 billion neurons 7 000 synaptic connections per neuron um but you can only speak at a few bytes per second right the your input and output rate is very slow compared to the processing power of your brain um and and the amount of information in it right so the the the the UI the API is very slow same thing is true of of deep of of gpt3 and all language models right now um so not only that they have a very short memory they can only remember what you do one task at a time so you can it can't it cannot it is not possible for the machine to be able to tell us all about this because even chat gp3 you know which is a GPT 3.5 the most recent thing still limited and even if you go up by a factor of a hundred there's still too much information here for the model to learn so this is a problem that we're going to have to be contending with for the foreseeable future until there's some fundamentally different kind of AI model that can read all of this or until it's easier to to fine tune something because honestly the easiest thing would be include all of this data in the Baseline model in the in the foundation model and then it knows it just intrinsically but until we get to that point um because they are really expensive to reach train so until we get to that point we're gonna have to figure out ways of using external databases or knowledge bases so that's the problem statement we've got 1.7 megabytes of text here what do we do with it well this is really dry stuff super dry so what can we do with it um well one thing that we can do is uh I've got this really handy dandy thing where I've got it broken up by page right and you see that like um in many cases the the sentence you know will continue so the page the page um a a barrier is not necessarily a good semantic barrier and so what we mean by a semantic barrier or a logical barrier is you might still cut something off right in the middle of of an idea or a thought but it is still a good enough thing to break because when you look at how long this is this is 20 000 characters long so this is probably about two windows worth so we can we can we can have gpt3 read most of this um actually here let me pause it for a second and let's do a quick experiment instead of just tell sorry I was just saying instead of uh telling you I'll show you okay so we put this in here it's 5 800 tokens long our maximum is four thousand um so if we just split something like this in half right so it's twenty thousand uh characters so we split it in half we summarize it that way we may be able to do something with it um but the question is or the problem then is we don't know exactly what we want out of it right so let's think about this what kind of information if we wanted to make like a Wikipedia right maybe that's maybe that's a good way to go um is is what are what are the implications here so in this case um you know boxing matches sued Don King oh this is fun um uh for Rico charges okay and they refer to other codes um and so basically it what this is doing is it's using language to build um a web of like reasoning and logic so this actually sounds kind of like a Knowledge Graph so I'm wondering what if we what if we use this to build a knowledge rest I've never built a Knowledge Graph this is fun um so maybe maybe what what the the goal here is is let's build a Knowledge Graph okay so let's go back over to chat GPT in just a second and ask it what a knowledge graph is and how to build one okay I was able to get right logged into GPT or chat GPT sorry what is a knowledge graph let's see what it says a knowledge graph is a data model that represents a collection of interconnected data and Concepts typically organized around entities and their relationships it is used to represent and organize large volumes of structured and unstructured data in a way that allows for easy querying and visualization of relationships okay and then it looks like it froze including search engines recommendation systems and natural language it's gonna freeze up um so anyways uh yeah so then once this is unfrozen the next question I'll ask is um or can I hit Escape you cannot abort um so the next question is uh that I'll ask is what kind of format is it um or I'll pause it until it unfreezes or I will pause the video Until It unfreeze I don't know if I said unpause okay I think it was just frozen so because I refresh the screen and it's fine um okay so I'm saying how can I code a knowledge graph says manually build a Knowledge Graph if you have a small amount of data to do so you can build it by creating nodes in the entities you can also use a tool like graphis or gephy to visualize and edit your knowledge graph interesting okay use an NLP tool that's exactly what I'm going to do a graph database okay use natural uh to use a pre-existing Knowledge Graph cool so I wonder what kind of format these guys take I wonder if it knows so neo4j or Amazon Neptune cool um let's see what uh file format um is a knowledge graph um like can I use Json or something let's see there are a number of different file formats you can use to represent a Knowledge Graph some common ones are graphml and XML based file format okay graph is guessing y Ed okay rdf the resource description I don't know anything about knowledge graphs other than the theory Json LD is a lightweight linked data format that can be used to do that CSV really CSV is simple on one row per relationship with columns for the source and Target nodes okay um I am personally a big fan of Json because it's human readable CSV is human readable but it's a little bit on the Messier side especially when you get really complicated so uh can you give me an example of a Json lb Knowledge Graph um let's say uh for instance I want to see um some nodes about the history of uh France I'm kind of a Francophile I've visited France and I really love it there okay sure here's an example of Json LD um all right so it looks like each node is actually pretty simple where it's got an ID a type a name and a description that's actually really simple um nationality oh interesting it looks like the some of the things are kind of arbitrary French Revolution start date Napoleon Bonaparte but yeah I really I really like it uh France won the culture so when I visited while this is running I'll tell you a little bit about France uh when I visited yeah okay sure um so when I when I I visited France uh 10 years ago in 2012 and what I really like okay here we go um let's see how uh does Json LD establish relationships I don't see any examples of um Connections in the above example okay so while it's telling me um the at ID oh okay so all right it'll it'll explain anyways so the culture in France is somewhat similar to America in um in that uh we both think very highly of ourselves um but there are some really Stark differences and namely the pace of life in France um where you know sure if you go to the big cities like Paris it's rush rush rush um but if you get outside of Paris even in some of the larger cities people just have a different attitude towards life um you know they're the the the the portion meal portion sizes are smaller and um other other things like that but then it's like people are less in a hurry um and then um I hear that Italy is even worse where it's just like nothing happens quickly in Italy so maybe it's just a European thing anyways um it's very refreshing to see a modern powerful Nation because France is the number three exporter of like military hardware or something I don't remember but like this is a powerful modern country that has a much slower pace of life and a different attitude towards enjoying things okay let's see what it says about how these things link it says okay and the example I provide did I use ID property for example in the following snippet so it does that the nationality property is set to ID of France oh okay okay so the net this this is the connection so if you're if you're referring to another thing got it so nationality is like a property so the the properties that are attached to each node are arbitrary and then you can also just have one connect back to another got it got it okay cool I wonder if we can just have gpt3 rewrite this as a knowledge as a Json LD Knowledge Graph if chat if chat GPT um knows this knows it this well um and and text DaVinci 03 is also the same underlying model GPT 3.5 it's entirely possible this will work um okay uh let's see convert the following um scotus opinion document into a Json LD formatted um Knowledge Graph and then we'll add some vertical white space just to be friendly to the thing and we'll come down to let's see it's just a little bit too long let's cut this roughly in half so start let's see new page so in addition Ace acts so blah blah okay so let's oops come back just save that there and then we'll give it some more vertical white space um and then we'll do um uh Json LD uh Knowledge Graph okay cool also one thing that I have discovered is I actually prefer to turn the temperature down lately and the reason is because I found that um you're especially the the most recent ones the instruct aligned ones um they do almost exactly what you want and so with a temperature of zero you get really good consistent results um so I have changed my default temperature to zero um you know and everything else just zero zero zero it's it's pretty well aligned okay so let's see if this works um it looks like it's going to do like the whole thing vehicle true vehicle vehicle okay so that's not quite what I had in mind what I was hoping is that it would break down the um the other the what I want is the opinions and the um and what do you call these like where you where you reference something right so um let's give it a little bit more instructions about what I want um specifically uh um uh let's see let's see yeah uh focus on dates decisions opinions um and reasoning uh the purpose of this knowledge graph is to be searchable uh by lawyers for um legal precedent and case law um and let's say let's say specifically by trial lawyers so this is basically I'm telling it this is a research tool here I'll just tell it this is a research tool for preparing for um trials before The Supreme Court I'm just trying like what would Devin say on legal eagle um okay so let's try this again and see if this changes a little bit about how it composes um this this thing decision opinion reasoning excellent opinion and the circumstances requires no more formal legal distinction between person and Enterprise um okay that's interesting um it's still not quite I'm still missing something what is it that I want from this maybe maybe we can't go straight to um to this hang on I think someone's moving around let me uh close my door I'll be right back in a second okay sorry about that so it's it's breaking it down into one thing but what up like I guess I need to think what nodes do I want out of this um and then you know so each node will be um well here let me let me go ahead and save this prompt because it's pretty good um so first I think first thing we need to do is get the whole thing Rewritten in such a way that it is um that it can fit inside a single prompt window because if we have the whole the whole thing um a little bit more con condensed excuse me then we should be able to get a proper thing but we also need to think about what kind of nodes do we want um so you know which aspect you know the second the second circuit did this uh Rico requires this um and this other case it said that um so I guess each node is going to be every case cited yeah okay so the case cited and why I think that's each node all right cool so let's um Let's uh let's see um each node should be um yeah each node should be um a case uh case citation um precedent or prior opinion I'm probably using the wrong term but um include uh what the heck was the the um the parameter um my goodness the uh what's the term why is my brain doing this I need more coffee um unique identifier property prop not parameter property um each node should have several properties such as um date uh let's see case number um involved parties um reasoning for including in this opinion um and other relevant um information okay so let's let's see if if we can get the nodes that we want because if we can go ahead and convert each each thing to to nodes that might save us a step but I suspect we're going to have to summarize it first this is really cool I was really skeptical about chat GPT but um I'm becoming less skeptical oh this is good yes it's working it's working it's working okay so let's save this prompt because this worked really well um all right so I'll save this as um let's go up here and we'll say prompt um let's see uh Json LD um and then we'll do citation nodes um so this is an example we'll say example prompt okay so we got we got the nodes that we want I believe um oh man this is going to be fun because then I can try and figure out how to take all this and and visualize it I wonder if we can visualize it with python um all right but let's let's go let's let's pause for a second because this is only half the document that's not good enough right do we want it do we want to just read it raw and just go straight to it let's try summarizing it um and and let's see if we can get the whole opinion in one document now here's the thing some of these opinions are like 200 pages long so how are we going to do that right because in order for the thing to make sense you kind of do need to have the whole thing but you also don't want to lose detail right so let's think about this for a second um let's see uh let's see rewrite the following scotus up opinion um let's see as a let's say as a list of assertions um no we'll say we'll say summarize because that summarize uh implies that you want um to reduce word count um remove Superfluous language um while retaining specific details um yeah let's see let's see if that works summary okay yeah this those are good those are good notes but it's not retaining the information that I want to see such as the nodes okay so rather than read it multiple times I think what we'll do is we'll break it into chunks of um let's see how long is this we'll do chunks of 13 000 um that seems that seems good so we'll do chunks of Thirteen thousand and um and just go straight to graphs to knowledge graphs because that worked really well that worked exceptionally well okay so let's go ahead and clean this up and we'll come down here and do chunk and then Jason Alda Json LD Knowledge Graph um and then we'll do f file save as prompt Json LD um citation nodes and I need to take a quick bio break I'll be right back I'm sure you wanted to know that all right actually I just realized this video is running long um it's already 30 minutes and uh and I'm a bit fried so we'll come back we've got our feet we've got our bearings and so when we come back for the next video we will start doing the data prep because that's that's a lot of fun let me tell you that's why I don't want to do it right now um so we'll take all of these opinions we will split them into chunks while keeping some of the essential information with each chunk and got to do a little bit of figuring about how to how do we format the knowledge graph correctly because each yeah there's there's some problems to solve so but we'll split it into chunks we'll prepare the data we'll do some experiments with generating a Knowledge Graph and then um that's probably all that part two will have and then part three will be actually like let's load this into a database or visualizer um all right gang thanks for watching it's good to be back and take care |
Support me on Patreon so that I can do this full time and keep the content ad free! <a href="https://www.patreon.com/daveshap">https://www.patreon.com/daveshap</a> |
<a href="https://youtu.be/E_sMa3N44u4?t=1491">https://youtu.be/E_sMa3N44u4?t=1491</a> you might be able to get the JSON-LD entities with IBM Watson which has an API for it. |
This video deserves it's weight in gold. |
Chat GPT-3 for MCL concept: <br><br>Important question for any AI/IT/coding specialists:<br><br>I noticed this legal review regarding chat GPT and they trained it on supreme court case law. <br><br>I'm wondering if something similar could be retooled to be used with GPT-3 for the Michigan compilation of laws for Bill/policy research. <br><br>This could make legislative stuff and research far easier and less of a time consuming process.<br><br>(Would this be useful for Michigan law/current/past proposed laws and the parsing through all that info quickly for any research? In theory you could ask it specifically about any Michigan laws relating specifically to a specific topic, prior law, context, issue, parameter/quantity etc. So I could ask it about any laws relating to the legal amount of a specific type of chemical within a fertilizer in relation to current agricultural standards.)<br><br>Would anyone be interested in such a project/AI upgrade to current bill research? |
"frozen" : => "continue" |
I too, have a lot going on. Yep! BIG things are in store for me friends. <i>BIG</i> things. |
Lots of great ideas, information, and how-to knowledge here, so thank you! I can't help but point out though that the title is very misleading, no? There's no training going on and we can't query chat GPT directly about all the documents as is implied. Or am I just missing something?, It's an experiment |
insta sub, I know a wise sage when I see one. |
I see that6 the other programs that blend images is now a question of copyright, for the pool of images are owned by others. Fed District Court Nth Cal |
This method isn't scalable. You still have to work within the token limit. |
If you want to do knowledge graphs I believe generally the mainstream approach is to extract entities (people, places, things) from your documents, and then the graphing tool displays the relationships. There are open source "entity extraction" tools that vary in focus and in quality. (This has nothing to do with ChatGPT ) There are also graphing tools like Gephi. |
Thanks for the video tutorial. I have been on your github and installed a few! Thank you. So you have a link to the py.exe? I would like to be able to do tat myself! Cheers. |
Probably lawyers adviced against including legal texts such as laws. They are smart people and thought deep about the consequences of having a model with knowledge of the law. |
You only get about ten to 20 responses at a time though. It glitches and freezes before you get to finish anything |
Yed format is also text based and..you have a great visualiser |
thanks alot for awesome content. could you do video for fine-tuning customer support chat |
is the underpaid kenyan workers thing real?, @David Shapiro ~ AI any chance you looked into this and can shed some light?, @David Shapiro ~ AI a TIME article states: "OpenAI Used Kenyan Workers on Less Than $2 Per Hour to Make ChatGPT Less Toxic"<br>its hard to believe anything read on the internet most of the time, so who knows its credibility., What do you mean? |
Thank you David. Your channel really opened my mind about AI's. I live in a poor place and I would never be able to pay for the content you teach here for free. Thanks |
Ok speaking of developer stories, here are some I asked ChatGPT to provide about itself:<br><br>1. As a user, I want to be able to provide specific context to ChatGPT so that its responses are more accurate and relevant to my needs.
<br>
<br>2. As a developer, I want to be able to train ChatGPT on my own data sets so that it can better understand my company's specific industry and terminology.
<br>
<br>3. As a user, I want to be able to easily switch between different versions of ChatGPT, such as a more casual conversational model or a more formal business model, depending on my needs.
<br>
<br>4. As a developer, I want to be able to access and analyze the data on how ChatGPT is being used, so that I can improve its performance and make it more user-friendly.
<br>
<br>5. As a user, I want to be able to communicate with ChatGPT using natural language, rather than having to input specific commands, to make the experience more intuitive and seamless. |
why aren't you just going to Google Scholar and clicking 'case law'? |
13337 views |
Great video. Thanks for sharing your thoughts. Learned a lot. |
<a href="https://www.youtube.com/watch?v=E_sMa3N44u4&t=8m41s">8:41</a> actually you can use another AI toy to scrap automatically the whole webpage and sort it as you wish.. it's called "Browse AI" |
I’ve noticed that specifying a word count improves the specificity. Like if I tell it to give me a response that is at least 2500 words |
Love it. I am here for it. Thank you for your leadership. Please continue to lead and inspire us. I wish you the perfect new year. Lisa. |
<a href="https://www.youtube.com/watch?v=E_sMa3N44u4&t=20m00s">20:00</a> LOL I lived in France for years and I loved to say that the French and Americans are exactly alike: They both think they are the best(at everything)! :) |
Glad my idea has made such an impact. |
How has this only got 4k views. |
in France right now and loving your videos! |
One of the benefits that I have read of is memory of the past prompts and responses within an instance. <br><br>How would you test and perhaps front load context and few facts to improve output? |
Hello, Im the colombian lawyer that you asked for in <a href="https://www.youtube.com/watch?v=E_sMa3N44u4&t=10m47s">10:47</a> LOL |
i’ve learned a lot about spiritually from you which is mad weird for a python channel |
Amazing stuff ! Your channel is under rated, looking forward the next videos |
Thank you for this, you've expanded my understanding greatly. |
Hi David, thank you for starting the tutorial series again. I'd never heard of NLP before stumbling on your channel, and I previously found your tutorials and your way of going through the thinking process incredibly invaluable for a non-coder, non-expert in this domain. I'm excited to see your future projects/videos, keep up the great work. |
Very Nice project. Is it possible to implement same steps for other languages?, @David Shapiro ~ AI By the way, I wonder how to keep json file as one piece for a court case without losing context and case details. Wonderful project by the way! I was struggling to find use cases for supreme court text, @David Shapiro ~ AI Thank you, Yes, this will work for pretty much any language. It can even translate from one language to another for you. |
Thank you. Seriously you have no idea how good the first few minutes of this video is. You get straight into it, no fluff just good value. I've spent hours googling and searching for a video on this topic. Most videos are clearly filler and websites are written for SEO with very minimal content. Watched a few of your videos and just brilliant., Came here to say this. This channel is like gold in the middle of mud., Yeah, a lot of folks just do news and talking. I find that stuff to be low value infotainment (good for just passive watching) but I focus on actual education and problem solving. |
Hi. I am a lawyer here in Brazil. Thanks a lot. |
Thank you so much! very educating! |
This video is very helpful for me as I am facing a similar challenge and it opened up some lines of thought for me. So thank you very much! |
Great post! |
This was a fantastic, informative video and am excited for the next one. Thank you! |
ChatGPT can generate nice mermaid code that can easily visualize graphs and flow charts. You may try it. |
Wow, cool example.<br>Hey, David, are you going to use these data for fine tuning?<br><br>What are common use cases for lawyers?, No, finetuning is not helpful in this case. Use case for lawyers is researching case law before going before the Supreme Court. According to Devin (over at Legal Eagle) there are trial lawyers who specialize in this kind of thing, so it's helpful for them to be able to look up any case precedent that's been argued before the SCOTUS in the past. Helps them make a more solid argument because the SCOTUS operates by case precedent. |
This is incredibly valuable content. Both from a GPT and general problem-solving perspective. Thanks for putting this together and I'm looking forward to part 2. |
I'm so stoked you're making videos again! You have no idea how much I owe you for what I've done with the ideas that you've given me. Thank you to infinity |
Glad someone tackles that topic and for the explanations, but a more focused approach to what you actually want to show, rather than the process would be a great time saver when watching ^^ still, looking forward to your sollition, so far Im not quite sure where you'll gop with this. |
Great that you put it up again… |
Both GPT-3 playground and AI dungeon seem recently to have started incredibly creepy mandatory censoring of content. It's kind of come as a shock and it's as if nobody has noticed. It's seems like it's crippling it's own quality a lot, and has me consider alternative providers. 🤷🏻♂️, @David Shapiro ~ AIthank you, I really appreciate this info/insight and someone to talk to about it., I understand it, though. I was looking at comments on Reddit and there are plenty of people who will just take this to incredibly dark places very quickly. By maintaining a reputation of not tolerating creepy behaviors from users, it will dissuade them and keep it focused on more economically productive stuff. |
hello everybody um all right so we are at February 17 2023 The Raven project has 50 forks and 479 stars and 56 Watchers we are in the midst of coming together we are focusing on two things one is governance getting the project organized and two architecture making sure that people understand it now we are uh we I uh have proposed using a consensus mechanism in order to organize everything so with that said I uh just figured out how to pin conversations on the discussions tab so there's a lot of questions and conversations around you know should we use Discord should we use slack should we use Matrix before we make those decisions and certainly before we even make architectural decisions or road map decisions we need to make decisions about how to make decisions because here's the thing artificial general intelligence or artificial Global intelligence as I prefer to call it now is too important to keep closed Source or to keep totally behind closed doors that being said one thing that is emerging is that we do need some level of gatekeeping and governance just because someone has an internet connection does not mean that they are qualified to participate in the conversation that being said everyone should at least be able to see the conversation we need to have transparency we also need to have a pipeline to allow for an intake of ideas and also allow for healthy debate so with all that said what I want to do is is walk you through where we're at so first we had a couple of previous conversations so I started with you know proposed consensus mechanism uh with a comment deadline so we started by commenting on like okay let's just talk about consensus um so we got uh quite a good amount of conversation around what even is consensus what is the source material so on and so forth so we we started by building some group awareness of consensus we had some really good feedback like this guy he talked about uh large-scale consensus um so we started building Community awareness around even the idea of consensus so then I wrote a proposal based on the book um which was here so the book is consensus through conversation that's not the right one um consensus process draft there we go um so it's a five-step process where you define the issue you develop decision and acceptance criteria you craft a proposal that meets those criteria you test for consensus and if you reject it you craft a new proposal and then finally you accept it if it passes uh consensus so one of the things that people don't understand about consensus and this is why we're going through this process is yes there is a vote for consensus but it is not a simple majority vote ideally with consensus you negotiate and you work through until you get a proposal that has broad acceptance that is the purpose of consensus is so that you get a super majority or ideally unanimous acceptance because it is a uh it is a form of collaborative decision making which means that one you're going to come up with better decisions than any single person could come up with and we are we're seeing this process happen in real time and so what I mean by that is after we had these initial discussions around consensus as people were just getting ideas about it then we said okay let's define the problem and so we had 11 participants it felt like more but we had 11 people from the community participating and probably countless more uh watching and so we discussed through like okay what are the actual problems and people are talking about uh governance like should we have a benevolent dictator model or um how do we even make decisions and there was some comment drift um but you know we're talking about like how do we steer this how do we like how do we even organize so that is where we discussed the problem space um we did start to uh discuss things like okay what are some possible solutions and we started branching out and this is the pr this is the purpose of having one a very slow and deliberate consensus process because it takes time to bring ideas to the table so people brought examples from other experiences and brought up concerns like well how does this even work right um and how does this fit into how we um how we're gonna fund this right is it if it's open source um who's going to own the project are we going to have a primary stakeholder I think it's going to be my startup um there's certainly enough energy and willpower inside my startup to take ownership of the Raven project and to keep it open source um we've had conversations with various stakeholders and even some Venture capitalists who are familiar with open source projects so we are attracting the the interests that we need but it's going to take some time to to figure that out that being said we also need to talk we talked about the scope where is consensus even going to be used is it just going to be to steer um the development is it going to be to make business decisions so on and so forth so this is part one which is discuss the problem space so we had a I mean you see how much discussion happened here we had a lot of discussion around um the consent the problem of consensus and governance so with that said we have now moved to step two so I I gave it two weeks to talk um I I we locked the previous conversation so now we just started step two um and it looks like we already have someone participating so step two is we have to define the goal posts what does it mean if uh to have a successful proposal so basically we are preparing to draft a proposal and we say the proposal that we come up with must address these issues in this order or whatever um and so my initial uh decision or acceptance criteria is that our our proposal must include specific tools and platforms that will guide the behavior that we need to see so basically when we were talking about the consensus problem it was like okay GitHub is not enough Discord is not enough meetings we haven't figured out how to schedule meetings yet so we need it we need a proposal that allows us to be asynchronous because this is a global team so we need it to be asynchronous which means we need the right platforms a bunch of people proposed a whole bunch of tools kealo and lumio kind of percolated up to the top as really good tools to allow for decentralized and asynchronous debate and decision making and then the second thing that I I proposed is that our consensus proposal must include definitions thresholds and gatekeeping or otherwise qualifications because we need to say like okay while we need transparency we also need to make sure that the right people are at the table and the people participating are qualified to participate and then finally we must establish the scope of consensus is this going to guide the entire project or is this going to be within the container of just making technical decisions um let's see and then just four minutes ago uh Siri audience added some ideas we must include a plan for continuous Improvement and adaptation um uh so basically we need to evaluate consensus over time I like that um the consensus proposal must establish guidelines for communication and information sharing excellent I like it so this is the process working what we're creating is what's called a learning organization where it is assumed that we are naive and that's fine but what we do is we create the structures that allow us to learn as we go and get smarter over time so that's where we're at all right so that's let's put a pin in that consensus is happening it's working it's moving forward um we uh there's a tremendous amount of energy around using uh existing tools like kyalo lumio GitHub whatever else to to do consensus but there's also some energy around using AI to help with consensus and I'm really excited about that I think that one of the things that we're going to ultimately do is create a new platform that will do all of this that's that's my suspicion and that's in the long run we'll see what happens um you know there's talk about blockchain and and all sorts of stuff so we'll figure that out now let's pivot over to architecture so I figured out how to pin uh conversations so what I did was I pinned the most um important conversations that are happening so one um this conversation was good is just saying like we have so much stuff going on how do we even keep track of it all so this will this will come up as another issue once we figure out consensus then the next topic we're going to talk about on consensus we're going to start talking about multiple topics we're going to talk about the architecture the MVP the road map of Raven we're also going to talk about our communication tools do we use Discord do we use Sac do we use Matrix do we use something else altogether or none of the above and then how do we organize all this stuff all this is going to go through the consensus process because we are smarter as a hive mind than as individuals making decisions so on the architecture side though um I what I did was I realized that pictures are good if we can communicate the architecture very quickly and succinctly that can allow people to get a good intuition and diagrams are even better than videos in some respects because you can just look at it at a glance so I created this which is a layers of abstraction I need to update it this is good but this was also just a first draft and then someone else from the community let's see where did it go uh he put it somewhere hang on hang on I lost it let's go to the wiki um because I know that it's over here all right so at the highest level this is this is the simplest way to conceptualize The Raven architecture where you have a Nexus a central microservice which serves as a data Hub and then you have a whole bunch of other microservices that only communicate with the Nexus so this is a start apology this is the simplest possible architecture out there which also means that you can just add an arbitrary number of microservices all with a single point of contact and that is the Nexus um so then I added the layers of abstraction so that you can kind of get a more conceptual idea of okay here's how cognitive architecture um is abstracted and then finally a Community member read the books um looked at all that we were discussing and created a very comprehensive functional architecture of how all the microservices could be organized so this is incredible and this is what I mean by by the wisdom of the group we get people contributing one idea at a time it gets bolted on and Incorporated and we get smarter as a as a group and so this is a phenomenal example example of consensus working in real time it is slow and that is on purpose so with that said um let's see that was the architecture one um there's there are discussions around the hardware so basically you could run Raven on your phone or your desktop or your laptop or your tablet um we could also run Raven on Smart Home devices so actually let me show you the device that I created real quick okay I think I've showed you guys this before but basically this is like the original prototype of a raven smart home device so it's got um a conference speaker and microphone this microphone is really sensitive it can pick up uh Speech 30 plus feet away so like basically across the house uh wide angle um webcam um so that you know raven could hypothetically see and then a touch screen so that if if we give Raven an avatar or a face or at least an interface so you say like hey Raven show me uh show me a uh a recipe like you know raven could display the recipe here or whatever and then you can't see it that well but there's a Raspberry Pi on the back of this we're discussing what is going to be in the hardware um requirements now this requires a lot of a lot of architectural decisions right where is it all going to run and again this is where consensus uh works because it's like okay well should we use Docker should we run everything in the cloud should we try and run stuff locally and over time we have kind of we're starting to reach consensus that okay maybe the Raspberry Pi isn't strong enough because they can't run Docker containers but maybe there is a system on a chip or or a um or a single board level computer that is powerful enough or maybe we need a larger uh piece of equipment if we if we offload it all to the cloud and then the Raspberry Pi is just a client how would that work so we're figuring out how to how to physically deploy it here so this is a really good uh thread um for that part and then going back to the last discussion which is this one which is another um uh good discussion which is like okay well how do we how do we communicate everything how do we bring people up to speed like there's so many decisions to be made um but again this is all part of consensus so I want to show you kyalo um there we go looks like uh oh people are participating this is great so chialo is really powerful in that it creates a graphical um uh outline of the debate and so here it's like okay we need this we need this um and you see like uh arguments in support of and against ideas all right so let's go ahead and get in here so there's you know here's the and this hasn't been formally adopted yet this is just an exploration um but yeah so you see it's like it's a very very structured and formalized way of debating where it's like okay so we need this or let's try this other idea um you know and it's like all right well this this idea didn't get much support but this other idea has a lot of support with a lot of pros and cons so there you go this is how kialo Works um how do I get back to the other ones um those are not mine um my own following overview anyways so basically that's just one possible tool um and if we if we create a team account or a web page or something where we can keep track of all these issues um that is something uh that we can look at anyways I think I'm running out of steam I think you get the idea we are making decisions we are uh building team um uh learning uh a greater understanding of how to come together uh so yeah that's that I think that's about it for today um so yeah uh thanks for watching and thanks for participating everyone um take care and uh feel free to jump in |
As a former software engineer who recognizes the cataclysmic shift that AI will bring, I am wholeheartedly hoping that those working on AI related projects have the same heart that you do. It’s clear how much you really care about others and common welfare. As a momma whose children are still very young, I hope these technologies will make the world brighter for them. My son is non-verbal (on a waiting list to be evaluated for autism). While I appreciate his unique differences, I can see so many possibilities for AI being used to improve the quality of his life and many others as well. Thank you for doing the work that you do., @David Shapiro ~ AI I hope that my comment didn’t seem critical in any way. I meant it as the highest of compliments to you. I also didn’t mean to imply anything negative about the many individuals who are obviously very passionate about the Raven Project which I am a fan of. I apologize if my comment conveyed a different message., I think this is why a bunch of people are joining the RAVEN project. Everyone wants it (AI) to go well... |
Following and really looking forward to seeing what this experiment re: consensus on consensus reveals. |
Hey David, pretty new to social media. Came across your discord and just wanted to say thanks for being a creative teacher! Teaching can be a thankless job |
Does this project need funding?, Possibly, we're figuring it out |
imagine you have a dream/reflect module which finetunes the model based on the chat history |
My name is Maxx. My socials very much need updated. I want to help. I will follow all your accounts and message you exactly once on every platform. I will support you directly on patreon as soon as I can afford it.<br><br>I believe in what you’re doing. I want to help. |
I'm a layman regarding AI, that is just watching out of interest, but I think you also have to guard for feature/scope creep and overzealous bureaucracy inhibiting actual progress from taking place. When that happens, it's inevitable that there is going to be brain drain and fracturing of the project into smaller, separate initiatives. Which I think would not be as productive., Yeah all of this yellow tape seems like overkill. Will probably slow things down quite a bit |
Hi David, I‘m a CS student with still little knowledge about Open Source, and intermediate coding experience. How would you recommend me to to get the basics to start participating in the project?, Jump in, read the books, and learn! |
Following this project. Going to be a participant soon. Engineer by trade. |
Local inference is critical. If people will spend $50k on a car they'll use twice a day, how much more would you use a local inferencing cluster? |
Huge fan of this project and what you're doing David. ༼ つ ◕_◕ ༽つ |
David, I'm interested in guiding the ship with being a part of the governance team. I believe my vision is aligned with yours, and I want to be one of the people that makes absolutely sure that the heuristic imperatives that you are proposing are deeply implement, no matter what. Reduce suffering, increasing prosperity and increasing understanding. I believe in them, I believe in you, and I believe in your mission. <br><br>I have an MBA and BsC Chem. background, and one of the things I've learned is consensus is colored by the composition and distribution of your group. I don't want to see your mission, vision or values being tainted by whatever group ends up getting on board. I believe you should have veto rights, no matter what and at any point in time, unless your hand picked admin council decides otherwise, eventually, due to human related limitations., @David Shapiro ~ AI I don’t really use GitHub. Is that where the chat is?, Jump into the conversation. Participation is decided by individual participation and community consensus |
Thanks for breaking down the developments and updating us. It's the most ambitious, systematic and comprehensive approach to governance that I have seen. It almost feels like if you can pull it off then you will basically be ready to start your own small country. Heh.<br><br>First, apologies for making these comments out-of-band on Youtube. I don't want to interfere and don't have the energy to properly digest and engage with the full discussions on github and the other site. I understand if you don't have time to address the comment.<br><br>Anyway not to repeat myself too much, but I still suspect that to keep things moving there might end up being a fair bit of "benevolent dictator" in the process at some level, and to avoid splitting into two or more major forks there will need to be a very good/convenient mechanism for selecting different major configuration groups.<br><br>For example, the version that uses proprietary APIs like OpenAI versus the version that uses only non-proprietary ML-models on-board. These also have potentially very different hardware requirements. Actually its worth considering making these individual forks and just trying to stay in sync to the degree possible with the consensus mechanism.<br><br>We are starting to see ML architectures and techniques that can push the smaller (<20 billion) models to be much more capable. So some time within the next say 3-18 months it will probably be much more practical to get good performance from smaller models, such as those that could run on a small form-factor personal computer. There are even some very small form factors that have high performance dedicated graphics cards.<br><br>To me this is a primary challenge because in the long run it seems like you would want to move towards self-hosting the inference on your own hardware, and the sooner you start trying to work towards that the better in a way because it could involve quite a bit of research and trial-and-error.<br><br>On the other hand what's available right at the moment with OpenAI's API does not require any special hardware and is much more capable than anything open that is ready now. My gut feeling is that the smartest thing to do is focus the more significant portion on this approach, but also try to support another fork which researches what's possible using only open models, better hardware, and a more involved machine learning core subsystem using those open models, potentially with its own training and inputs. My gut feeling is that as things develop, there will be a growing desire to move away from the cloud provider(s) and towards these open models and the other fork. |
Is there anyway for someone (me) to be involved in this project with a role/input/task that doesn't have a coding background but still has a fairly strong understanding of it all?, Of course |
First!, -_- |
hey everybody david shapiro here with a uh the first video in a new tutorial series so this is python and gpt3 from the ground up so if you don't know anything about python or gpt3 and you want to get into it start here so this is going to be the boot camp starting from zero starting from scratch so the first thing you're going to want to do is take a look at this comic from xkcd from 10 15 years ago it basically it's just making fun of how simple python is the the punch line is um how are you flying and i just i just typed import anti-gravity and then of course he sampled all the things in the medicine cabinet and then now he's flying um anyways so the first thing you do is you go to python.org downloads it downloads pretty quick you do install now and so the first time i did this i missed this because we're doing something so simple you don't need to worry about virtual environments so you make sure to click add python to path and you can expand here to see what else it'll do documentation that's fine pip you definitely need pip so pip is the pack package manager for python which allows you to install other stuff that python needs so that's fine install for all users you don't always need to do that but i do so that puts it right here in the standard thing again don't worry about virtual environments we're just going to install it as the system interpreter using virtual environments is more advanced so we're not going to worry about that so there you go i actually uninstalled python entirely just so to show like going from scratch um so this is python 3.10 that's the latest and greatest it's the same process uh probably forever it's been it's been the same for all of 3.3. it didn't used to come with pip you used to have to install that separately so the fact that they they include that now is is nice let me close my console so once this is done it'll add python to the um there we go okay so python dash dash version 3.10.5 there we go so pip install pip dash dash upgrade so you can do this it's recommended that that's the first thing that you do and because it upgrades your package manager so the command here is pip so that's the python package manager install pip so you're telling it to install something that's already there and then the dash dash upgrade tells you to upgrade now the very next thing you're going to want to do is install openai if you want to use gpt3 this is the module or the package that you can use and all you got to do is copy that to clipboard and you do control paste or shift insert for a command line pip install open ai and this is most of the way there so it'll run all the dependencies and unless your system is weird or something you shouldn't get any errors here this is pretty straightforward and if you already have open ai installed then you can just add that dash dash upgrade and away it goes that's giving me a few few notices yep which is not on path that's fine successfully installed ta-dah okay so we're most of the way there you're most of the way ready but now what how do you get code so if you watch my channel you'll know that i have i do a lot of code and i put all of my code up on github so how do you get stuff quickly and easily the answer there is you use git so you go to git dash scm.com downloads or slash download sorry you get you download git i've already got it but i'll go ahead and install the update so you can see the process so we will install git for windows um install removing previous get version so this is pretty much the same process you'll go through so what git does it is an open source code management tool it has become the standard code management tool globally we don't need to see the release notes okay so now that git is installed what do you do then what i do next or what i'll have you do next is you go to your command line um and you go to this repo so this is the this is the tutorial repo i'll put all the all the code and demos here so you go to this you click code the big green button and you see where it says https ssh or github cli just leave it on https that's the standard you click this for copied you come back in here you go to the root which you don't have to that's what i do you can also do cd um oh what was it no it's cd uh was it user i don't remember um user der whatever um i always copy stuff down to root just because uh it's shorter that way um so get clone and then shift insert um for for this uh and so this this goes to the python gbt3 tutorial dot git so the dot get file is the configuration file that it's going to use to download the entire repo so get clone and it down downloads it nice and quick then you do cd python and use tab to complete so tab is autocomplete so like if you type in windows and then complete like just win tab that'll do complete you can do program files and there's two different ones program data program files but we're going to go into python and then we'll do dur now windows started integrating uh linux command so i think ls dash all nope it doesn't work okay but dura will show you everything in the file which right now since i just started it it's fine okay so for review we've downloaded python and we've downloaded git and then we've cloned down this repo we've also installed um open ai so we're like right off the bat we've we've got a nice minimalist clean environment the last thing that i want you to download is notepad plus plus and this is if you're on windows actually i think notepad plus plus is on linux as well notepad plus plus is a basic text editor wait that's not what i wanted there we go um so they do have that deceptive thing make sure you click the the download on under the the lizard icon um notepad plus plus it is a minimalist development environment there are develop there are ides integrated development environments um like pycharm i stopped using pycharm years ago because it has its own environment variables and all sorts of other complex stuff that is just it's way overkill and i wanted the simplest environment possible so notepad plus plus it'll it'll do the um the language for you and everything one reason that i like using notepad plus plus over pycharm is that you have to learn to code correctly um pycharm will do a lot of stuff for you it's kind of like microsoft word and it'll recommend grammar and syntax changes which is great except you don't ever learn to do that yourself and we'll get into best practices for python in a future video but right now we're just focusing on setting up our environment and so what we've done is we've done python we've done git we've done notepad plus plus we've done open ai and then we've gotten this repo now by the time you download this there will be a little bit more in this repo so let me show you what i mean by in the repo so we'll just say copy paste your api key here so then i'll save this file we'll go to what was it uh python there we go um and so we'll call this open ai api key dot text and so we'll save this here and what i'll do is this will end up in here and so you'll go to your open ai account so it'll be um openai.com account api keys right here i'm not going to show you my key but what you do is you you click copy on that and you put it in this folder and so then we're basically just going to do the hello world of of um of gpt3 so import openai we'll just go ahead and save this and i'll save it as hello world.pi and you see that it changed the the formatting so that now import is highlighted i am super guilty of this i always copy paste my own all of my own old code um so i'm gonna do that real quick um and show you some basic functions that i use all the time um all right so we'll go in here oops no don't open that we will open it in a notepad plus plus okay so i always start with these few things right off the top and i'll show you what these do in just a second actually let me check the video length oh we're already at 10 minutes um so we're kind of we're kind of running long already but this will at least get you started with the hello world of of um your your your your life your life in gpt3 so i just write a quick function it's called open file you give it a file path it opens it um with encoding as utf-8 as in file and then it returns the contents of the file and then the very next thing is i return that and i pass this information back and so then what you can do oops is you can borrow this function which will be in this and i'll trim it down for you and you'll know that it works though because we'll i'll have you call this and you'll actually get a prompt or you'll get you'll get a response what i'm going to do is i'm going to simplify it a little bit because if it blows up i want you to do some troubleshooting on your own um and then we'll remove the while loop and we'll remove the accept part and we'll pull that back whoops okay so what this function does the first one super simple it just opens a file reads it and sends it back um we the second thing what we did is we set our api key to the contents of this which you'll need to update um and uh no special important note don't ever commit your api key to a repo because uh then someone else might see it one day that should be local only um we will simplify this [Music] so this is the stop we'll get into what all of these things do later um but yeah so this what this will do is it will just send back a completion and so then we'll say if name equals main [Music] then we'll say um my prompt equals uh what'll be a good prompt um write a list of uh of um famous american actors okay so that'll be our prompt then response will be equals uh gpt3 whoops completion and we'll pass the prompt in and then we'll print the response now i'm not going to run this because your homework is you've got to run this yourself which means you've got to get all this cloned downloaded and put in your api key here and we'll call that a day so just as a quick review here's what we've done we we looked at our xkcd comic from many years ago we downloaded python we downloaded git we downloaded notepad plus plus we installed openai which allows us to talk to gpt3 and then we cloned down this tutorial repo and then i showed you how to get your api key so what you'll do is you'll just click this that copy button come in here to open ai key open ai api key dot text and copy paste it in here make sure there's no spaces or anything it'll just be the first line and that's it and then what you do and this is going to bomb in order to test it you type in python hello world and it's not going to work um except finally oh whoops see this is why you test your code kids what did i miss oh i forgot to remove the try there we go ta-da okay now it works it would be really unfortunate if i sent you code that didn't actually work okay now this will still bomb because the api key is invalid so let me show you what will happen so it'll say hello world it'll say uh hey something didn't work you know uh open ai yep so here's the error right here open ai error authentication incorrect api key provided um it did not like my api key so you need to fix that that is your very first homework so then to save save your work um or to save my work i'll do git add dot so then i do that adds all files so then i do get stat um no git status sorry um so there's two new files to add so i'll do git commit am and we'll do a deeper dive on git in the future and we'll say initial commit and then i'll do git push and so what that does is it says okay every i've looked at all the changes that i've made locally i want to push it back up to the cloud so what we'll do then is we'll go back up to git and i'll just do a quick refresh and you'll see that those files are now here and so these are the files that you're going to use to start learning python and get your environment set up okay i think that's it thanks for watching like and subscribe also consider supporting me on patreon i am just seeing where this goes also i have a discord server if you'd like to join to get um uh some insight info to discuss research topics so on and so forth um that's about it thanks for watching check catch you next time |
Hi David. Thank you for this video. It has been almost 10 years that I don't code anything. And honestly I was never good at it. With your help and Chat GPT, I was to not just implement it, but also understand it. I also upgrade the function to be able to do follow up questions and save the results in JSON file. Maybe this is nothing for very experience programmers, but I take a win every single day. Thank you for the challenge at the end of the video. <br>(Apologies for grammar errors - much appreciation from Brasil). |
Thank you for sharing David! Your channel is so underrated 🤔, it's about to encourage the Algo.... with 👍, by the way great contents, got a new sub here 😀 |
This is amazing, but returned "Invalid header value b" error. <br><br>If anyone else runs into it, essentially it's appending a line return to the key (checked a million times, there's no line break, something's adding one)<br><br>To fix, add `.strip("\n")` to this line, like so:<br>openai.api_key = open_file('openaiapikey.txt').strip("\n") |
Absolute;y fantastic! I ran into a little problem with openaiapi.txt having a Linefeed or Carriage Return at the end of the file that I was able to remove with a text editor. Lucky for me! It's always a big thrill when the first program in a new area (for me) works as it should. I'm stoked! Thank you! |
Hello David, <br>I found out that there is a function already implemented in the library that reads the API from a file in the system:<br>openai.api_key_path = "openaiapikey.txt"<br><br>Anyways, great tutorial, thank you!, That's helpful I will try it out |
Thank you so much! :) |
Would this work on pycharm ? Cuz i dont seem to get any output and I get a synthax error from the beginning under install, Focus on understanding the basics before jumping into a more complex tool. Solve the problem in front of you rather than changing everything. |
im on linux, i like geany for pretty much the same reasons. |
This is fantastic!! Thanks for looking out for the noobs like me. Subscribed |
Thank you for the tutorial |
thank you!!!!!! |
Hey David, I'm a big of your work, currently am learning to fine-tune GPT-3 models and I can't find the 'CreativeWritingCoach' repo on Github. Is there a way that you can make it available? Thanks. |
Hello Sir, Storing apikey locally is giving error, saying Incorrect key provided. Can u please explain about the format it should be stored |
<a href="https://www.youtube.com/watch?v=9971sxBhEyQ&t=8m09s">8:09</a> 100% agree 🙂 Awesome that you still develop it 🙂 |
Hey, this might sound stupid but can I copy this for mac or will this damage my os? Thank you for the very elaborate and helpful video! |
Subsets and Splits