CLI 1: Setting Up The Environment

Tom Chant
InstructorTom Chant
Share this video with your friends

Social Share Links

Send Tweet
Published a year ago
Updated a year ago

We delve into using the terminal or command prompt, providing helpful guidance for beginners. The instructor has prepared a file containing all the necessary commands, making it easy to refer to. Python 3 is required for the OpenAI tool, but no actual Python coding is involved. The transcript explains how to check if Python 3 is already installed and provides installation instructions if needed.

The pip package manager is also covered, with instructions for checking if it's installed and how to upgrade it if necessary. The OpenAI CLI is then installed using pip. Additionally, the importance of adding the API key is emphasized, with the necessary command provided. Finally, the stage is set for working with the data separation tool, signaling the next step in the project.

[00:00] For the next part of the project, we're going to be using the terminal or command prompt. If you're new to using the terminal, it can look pretty intimidating. It's actually not that bad. And to help you along, I've created a file over here called terminalcommands.md.

[00:17] And I've pasted in all of the commands we're using in this scrim, so you can refer to that quickly and easily if you need to. Now, to open the command prompt in Windows, you can use the Windows key plus S and enter CMD in the search field. On MacBook, it should be right there in the launcher.

[00:33] And, of course, in either case, you could use the terminal in VS Code. Now, I've got the terminal open, and the open AI tool that we're going to use requires Python 3. Now, if you've already got Python 3 installed, then you're good to go. If you've never used Python before and you're starting to freak out, don't worry. We're not coding in Python.

[00:52] It's just needed in the background to run open AI's tools. Now, you can check to see if you've got Python 3 installed with this command. So it's just Python 3 dash dash version. And when I hit enter, it tells me that I've got Python 3.11.1.

[01:09] Now, if you haven't got Python installed, you can click on this slide, and that is going to take you to the official Python site. Or if you're on Mac, you can use Homebrew. Or if you're on Linux, you can probably get Python from your distros repository. Check their docs for details.

[01:25] Now, in a moment, we're also going to need the pip package manager. If you have Python installed, you probably already have pip, and you can check by doing pip dash dash version. And that tells me that I have got pip installed. If for some reason you haven't got pip installed, this command right here,

[01:43] python3-m ensure pip dash dash upgrade will install the latest version. Okay, now we should be good to go. So let's install the OpenAI CLI using pip install dash dash upgrade OpenAI. That should install the OpenAI tool,

[02:01] and you can check that by running the OpenAI command, and that should give you a list of commands that are specific to this OpenAI tool. Now, there's one more thing I want to do. The fine-tune model we create is going to be specific to us. Only we can use it. So the OpenAI tool will need our API key.

[02:20] We don't need that to prepare the data, but we will need it before we upload, so we might as well do it right now. You can add the OpenAI key with this command. It's basically export and then everything that we've got in this env.js file in this line of code right here.

[02:36] But be sure to swap out this colon for an equals. Now, when you've done that, press Enter, and you're not going to get any special acknowledgment that your key's been accepted. Just assume it has been. And now with all of that set up complete, we're ready to work with the data separation tool. So let's get stuck into that next.

egghead
egghead
~ 30 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today