{"id":1133,"date":"2023-03-01T13:14:52","date_gmt":"2023-03-01T21:14:52","guid":{"rendered":"https:\/\/www.bellevuecollege.edu\/xrlab\/?p=1133"},"modified":"2023-09-21T10:33:08","modified_gmt":"2023-09-21T17:33:08","slug":"how-to-train-your-own-openai-model-with-no-code","status":"publish","type":"post","link":"https:\/\/www.bellevuecollege.edu\/xrlab\/2023\/03\/01\/how-to-train-your-own-openai-model-with-no-code\/","title":{"rendered":"How to train your own OpenAI model with no code"},"content":{"rendered":"\n<p>ChatGPT is an AI tool that can chat with you like a human. It&#8217;s trained on massive amounts of internet text and can help with everything from answering questions to translating languages. You can also create the same interactions with your own content. This process is called fine-tuning, and can help you create chat bots, analyze sentences according to parameters you define or summarize content, among others. Here are some steps that will guide you through the fine-tuning process:&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Choose a pre-built AI platform<\/li>\n<\/ol>\n\n\n\n<p>There are many pre-built AI platforms that allow you to create your own AI models. Some of these platforms are run by big companies like Google, IBM and Microsoft. However for this example we are going to focus on OpenAI, which is the company that owns ChatGPT.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>&nbsp;Create an account on OpenAI&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>In order to train your own model you need to create an account on the <a href=\"https:\/\/openai.com\/api\/\">OpenAI (API) website<\/a> and you have to add your credit card. This is because everytime that you fine-tune a model, you are billed for the tokens you use to process information. You can think of tokens as pieces of words, where 1,000 tokens are about 750 words.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Get an API key<\/li>\n<\/ol>\n\n\n\n<p>The next step is to get an API key. Think of an API like a set of puzzle pieces that fit together to make a complete picture. Each puzzle piece represents a different function or set of data, and the API defines the rules for how those pieces can be connected and used.<\/p>\n\n\n\n<p>Once you&#8217;re logged into OpenAI, click on your profile on the top right and then navigate to the &#8220;View API keys&#8221; tab. After, click on the &#8220;Create API key&#8221; button. Click on the &#8220;Create&#8221; button, and your API key will be generated and displayed on the screen. Make sure to copy it and keep it in a safe place.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/RUZY2PoEjueIV8RjrR6RS7oD4-ypwwQNyEPxFDPvEx7GgUS6g3YQdfd3LkCtVjJeBE5sjQarHoisMEd6Iri5tgB7oZOFMem0K6xCTgVVIVFWpaqnHU3uOZvn9lNqUW5cVdwUlXjRTxNBeDB2XYu_WJk\" alt=\"Example animated gif showing the OpenAI API access keys for building an application.\"  class=\"img-fluid\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>Define your problem and gather data<\/li>\n<\/ol>\n\n\n\n<p>Before you can train an AI model, you need to define your problem and gather data relevant to that problem. For example, if you want to build a model to predict customer churn, you&#8217;ll need data on customer behavior, such as past purchases and customer feedback.&nbsp;<\/p>\n\n\n\n<p>For this example we will use data from the XR Lab of Bellevue College since we want to build our own conversation agent, a type of AI software that is designed to simulate human conversation. It uses natural language processing and other technologies to handle simple inquiries and respond to user inputs in the form of text.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\">\n<li>Prepare your data<\/li>\n<\/ol>\n\n\n\n<p>For the data we need to create a spreadsheet with two columns, one with the prompt (questions) and other one with the completion (answers). Depending on the depth of the content you will need to create at least 20 rows of prompts but the more the better.&nbsp;<\/p>\n\n\n\n<p>Phrasing the questions in different ways will help you to have better results. Try to find how people will formulate questions, and train the model on those variations too. Once you have your information ready, you can export it as a CSV file.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/gw-fETb81iP44mZSzaYCzJ0jx3UWAz0fDkQbwoh6Jas6W6FcrHnWNKlXwps0NyqXT8VYuWMkNrdM6RcVEOzXvs90yZKVrhqAdCrZ2qKd2uI_qLl1fagvPEhBvSPAzPYj8y59R_iwvRzpiXcLBnqOH_I\" alt=\"Animated gif demonstrating the various prompts used in developing the application.\"  class=\"img-fluid\" \/><\/figure>\n\n\n\n<p>If you want you can download and practice with this data:&nbsp;<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/12HZ6qTno2Vp_hBn4cLaSCmJSwn0jdb2198Q3PGouKn8\/edit?usp=sharing\">https:\/\/docs.google.com\/spreadsheets\/d\/12HZ6qTno2Vp_hBn4cLaSCmJSwn0jdb2198Q3PGouKn8\/edit?usp=sharing<\/a><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li>Upload your data<\/li>\n<\/ol>\n\n\n\n<p>Now that your data is ready, we need to upload it to OpenAI. You can do this by using the console on your computer (requires coding), but for this example we will use <a href=\"https:\/\/easygpt.io\/\">Easy GPT<\/a> that lets you upload your data and fine-tune your model via a clean UI.<\/p>\n\n\n\n<p>For this, you need to create an account and assign your API key. After that you can go to the \u201cFiles\/create\u201d section and upload your CSV.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Uimsilzr5O1eCWyrRWckgyOy1ol7jcDLfdA96gXwFnPZdIuyrvgx8s8k9aqanNpAaJ9tZVrsYGdjxWqfqooruSov1PXLcsrk0K3KFHCYT1UCnnnWhgEtnD2BD8MSeXt0b_ss75aPdqiFCRSRvyTZZqw\" alt=\"Example animated gif showing the easygtp and the prompt being entered to the text input box.\"  class=\"img-fluid\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\">\n<li>Organize your information<\/li>\n<\/ol>\n\n\n\n<p>In order for OpenAI to process your data, you need a special syntax. Easy GPT helps you to quickly organize your data in the correct format by clicking these 3 checkboxes:&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/pVtDX8UVMjyFwFwNZ0DVHZoIOXWPheR9sZSCoxlBua8WLqMwMjupAwuiUQSGXWjsBrmbhEYvuL3vf92BmNw_tDjnJCrrOeUOwBRPD6lYMBGhT60QDtsGuTxnhywR6lU1I-Bpzp-cvi3F5YhI46MsUAA\" alt=\"easygtp2\"  class=\"img-fluid\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"8\">\n<li>Create a fine-tune<\/li>\n<\/ol>\n\n\n\n<p>Once your data is uploaded to Easy GPT, you need to create your fine-tune model. Go to the \u201cFine-tunes\/create\u201d section and complete the information there. The file that you choose there should be the file you uploaded before.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/pQECw9JJIaBDzLJbEl_0YoYHNAzVQc597Opr8p0_FwmHb-qL7iS2EcnbG9bMT6O0D4dnYknL8KbN0boG0EbKxsTqCIphc9lgMnOcX_FpMrwUIoqnZoXqPoV-cGNFSyWkLUXxowxkZrFJAlb095Bj2uY\" alt=\"easygpt3\"  class=\"img-fluid\" \/><\/figure>\n\n\n\n<p>The fine-tuning process can take up to 30 minutes, you can see the progress on the \u201cFine-tunes\/Table\u201d section. Once the process is done you will see a \u201csucceeded\u201d message next to your model.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/3mnJJwTLrCIKVM2XbAF5oMwtZ9ie0Qa052aISK9PX75UrpOlUpjcs5JUA3X6-17Bq3SMcR2QLFXaebfY7-lNGqDtZ6s-uUBSsZ6cDmzcwj8lbUXufhatdblFpLbx8q9TMfW3Bc1Z-YVs-E7P14XmT0I\" alt=\"easygtp4\"  class=\"img-fluid\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"9\">\n<li>Test your model<\/li>\n<\/ol>\n\n\n\n<p>After uploading your data, you&#8217;ll want to test it to see how well it performs. We will use the <a href=\"https:\/\/platform.openai.com\/playground\">OpenAI Playground<\/a> for this, here you can select the model we created before and start asking questions. Remember to end the question with the suffix that you defined earlier (###), and add the stop sequence word (END) on the settings.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/yqE2eKurO65ife8QYLFynenKl3y4xncwtDBJL-w3LOOUPc9_KJJabMagulgad4PKoEO_anrsauA0D449aAW3bEAHaFrzIR3mO2vbQPfSRfTOPahIK57Ny82XaamhBiU-2yYy9f6xA-dJfZauj0tGLSI\" alt=\"easygtp5\"  class=\"img-fluid\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"10\">\n<li>Refine your model<\/li>\n<\/ol>\n\n\n\n<p>If your model doesn&#8217;t perform as well as you&#8217;d like, you can refine it by tweaking the parameters or gathering more data. This is an iterative process, and you may need to refine your model several times before you get the results you want.<\/p>\n\n\n\n<p>Conclusions&nbsp;<\/p>\n\n\n\n<p>Our goal was to generate an easy way to learn about our lab using natural language. Although deep AI model customization might still require coding,&nbsp; we were able to create this proof of concept using free no-code tools. If you are interested in continuing to learn about this subject, we invite you to check the <a href=\"https:\/\/platform.openai.com\/docs\/guides\/fine-tuning\">OpenAI documentation<\/a> about fine-tuning.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-mayflower-blocks-row row\">\n<div class=\"wp-block-mayflower-blocks-column col-md\"><\/div>\n\n\n\n<div class=\"wp-block-mayflower-blocks-column col-md\"><\/div>\n\n\n\n<div class=\"wp-block-mayflower-blocks-column col-md\"><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ChatGPT is an AI tool that can chat with you like a human. It's trained on massive amounts of internet text and can help with everything from answering questions to translating languages. You can also create the same interactions with your own content. This process is called fine-tuning, and can help you create chat bots, <a class=\"read-more\" href=\"https:\/\/www.bellevuecollege.edu\/xrlab\/2023\/03\/01\/how-to-train-your-own-openai-model-with-no-code\/\">...more about How to train your own OpenAI model with no code<\/a><\/p>\n","protected":false},"author":3392,"featured_media":1137,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[1],"tags":[],"class_list":["post-1133","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/posts\/1133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/users\/3392"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/comments?post=1133"}],"version-history":[{"count":6,"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/posts\/1133\/revisions"}],"predecessor-version":[{"id":1250,"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/posts\/1133\/revisions\/1250"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/media\/1137"}],"wp:attachment":[{"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/media?parent=1133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/categories?post=1133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bellevuecollege.edu\/xrlab\/wp-json\/wp\/v2\/tags?post=1133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}