- 2 days ago
💻 Launch your websites with Cloudways — managed cloud hosting made easy:
https://go.watsontechworld.com/cloudways
---
Learn how to use OpenAI's new open-source models, GPT-OSS-120B and GPT-OSS-20B, with the Hugging Face API in Python. This tutorial covers setting up your API key, running queries, and comparing outputs between the two models. Full code provided!
Subscribe / follow for more!
---
Code for video 👇
https://github.com/sinocelt/100daysofcode-2025-07/blob/main/gpt-oss-huggingface-api.ipynb
https://github.com/sinocelt/100daysofcode-2025-07/blob/main/code_for_teaching_hugging_face_with_gpt_oss_models.py
---
Our website: https://watsontechworld.com
---
00:00 Intro to GPT-OSS models
01:30 Intro to the code for the video
02:24 Discussing steps to use OSS models with Hugging Face p1
04:42 Getting Hugging Face code to use models
06:07 Discussing steps to use OSS models with Hugging Face p2
06:24 Getting an API key / access token
07:22 Adding Hugging Face token to Jupyter notebook code
08:36 Discussing steps to use OSS models with Hugging Face p3
08:58 Going through Jupyter Notebook code p1
09:54 Discussing getting exact model name on Hugging Face API
10:46 Going through Jupyter Notebook code p2
11:55 Photosynthesis question with gpt-oss-120b
13:22 Photosynthesis question output with gpt-oss-120b
15:16 Photosynthesis question with gpt-oss-20b
16:02 Photosynthesis question output with gpt-oss-20b
17:42 Going through Jupyter Notebook code p3 - reading in prompt from a file
18:25 Golf question with gpt-oss-20b
19:12 Golf question output with gpt-oss-20b
20:45 Golf question with gpt-oss-120b
21:02 Golf question output with gpt-oss-120b
22:55 Using Hugging Face key in an environment variable
24:28 Portuguese learning question with gpt-oss-20b
24:55 Portuguese learning question output with gpt-oss-20b
26:45 Portuguese learning question with gpt-oss-120b
26:57 Portuguese learning question output with gpt-oss-120b
30:13 Using the Python file
31:20 Copying Hugging Face API key into Python file
32:31 Data science question with gpt-oss-20b with Python file
34:02 Data science question output with gpt-oss-20b with Python file
36:39 Data science question with gpt-oss-120b with Python file
36:57 Data science question output with gpt-oss-120b with Python file
38:40 Review of how to use models with Hugging Face API
40:45 Review of Jupyter Notebook code p1
41:47 Review of setting prompt directly in Jupyter Notebook file or via a text file
43:02 Code that sends prompt to API
43:10 Discussing gpt-oss-20b vs gpt-oss-120b
43:37 Review of gpt-oss models on Hugging Face
44:08 Review of Jupyter Notebook code p2 - how to render the output well
45:21 Conclusion
---
#GPTOSS #HuggingFace #OpenAI #Python #HuggingFaceAPI #AI #OpenAIModels #OpenSource #OpenSourceAI #AITutorial #PythonTutorial #MachineLearning #LLM
https://go.watsontechworld.com/cloudways
---
Learn how to use OpenAI's new open-source models, GPT-OSS-120B and GPT-OSS-20B, with the Hugging Face API in Python. This tutorial covers setting up your API key, running queries, and comparing outputs between the two models. Full code provided!
Subscribe / follow for more!
---
Code for video 👇
https://github.com/sinocelt/100daysofcode-2025-07/blob/main/gpt-oss-huggingface-api.ipynb
https://github.com/sinocelt/100daysofcode-2025-07/blob/main/code_for_teaching_hugging_face_with_gpt_oss_models.py
---
Our website: https://watsontechworld.com
---
00:00 Intro to GPT-OSS models
01:30 Intro to the code for the video
02:24 Discussing steps to use OSS models with Hugging Face p1
04:42 Getting Hugging Face code to use models
06:07 Discussing steps to use OSS models with Hugging Face p2
06:24 Getting an API key / access token
07:22 Adding Hugging Face token to Jupyter notebook code
08:36 Discussing steps to use OSS models with Hugging Face p3
08:58 Going through Jupyter Notebook code p1
09:54 Discussing getting exact model name on Hugging Face API
10:46 Going through Jupyter Notebook code p2
11:55 Photosynthesis question with gpt-oss-120b
13:22 Photosynthesis question output with gpt-oss-120b
15:16 Photosynthesis question with gpt-oss-20b
16:02 Photosynthesis question output with gpt-oss-20b
17:42 Going through Jupyter Notebook code p3 - reading in prompt from a file
18:25 Golf question with gpt-oss-20b
19:12 Golf question output with gpt-oss-20b
20:45 Golf question with gpt-oss-120b
21:02 Golf question output with gpt-oss-120b
22:55 Using Hugging Face key in an environment variable
24:28 Portuguese learning question with gpt-oss-20b
24:55 Portuguese learning question output with gpt-oss-20b
26:45 Portuguese learning question with gpt-oss-120b
26:57 Portuguese learning question output with gpt-oss-120b
30:13 Using the Python file
31:20 Copying Hugging Face API key into Python file
32:31 Data science question with gpt-oss-20b with Python file
34:02 Data science question output with gpt-oss-20b with Python file
36:39 Data science question with gpt-oss-120b with Python file
36:57 Data science question output with gpt-oss-120b with Python file
38:40 Review of how to use models with Hugging Face API
40:45 Review of Jupyter Notebook code p1
41:47 Review of setting prompt directly in Jupyter Notebook file or via a text file
43:02 Code that sends prompt to API
43:10 Discussing gpt-oss-20b vs gpt-oss-120b
43:37 Review of gpt-oss models on Hugging Face
44:08 Review of Jupyter Notebook code p2 - how to render the output well
45:21 Conclusion
---
#GPTOSS #HuggingFace #OpenAI #Python #HuggingFaceAPI #AI #OpenAIModels #OpenSource #OpenSourceAI #AITutorial #PythonTutorial #MachineLearning #LLM
Category
🤖
TechTranscript
00:00Hi, everyone. In this video, I'm going to discuss the new open source models from OpenAI, the GPT-OSS models, this one, the 120B, and also the 20B.
00:17And I'm going to show you how you can use these open source models with Hugging Face, with Python code and the API, but I'm going to try to make it easy to understand.
00:27And you can get beautiful output like this. For example, I had asked, I believe, this model, I asked it, tell me how to learn Spanish effectively and how to become fluent within two to three years.
00:41And it gave a very comprehensive answer. And I think these models are super smart and really amazing.
00:49And as I mentioned, these are from OpenAI. And what's really amazing is that the, I believe, one of their LLM models, GPT-2, came out in 2019.
01:07So it's been quite a long time since they've released a powerful LLM as open source.
01:14They release other open source things, but very recently, these came out.
01:20And I think within a few days, GPT-5 came out. So a lot of big changes have been happening.
01:28So anyway, I'm going to show you in this video using some Python code.
01:33And for the most part, you don't really need to understand it other than being able to change basically one line and change the prompt.
01:44You should be able to use the code as is, just editing as I tell you.
01:49And I'm going to try to make this as useful as possible.
01:53And basically, this is the kind of code that we'll go over.
01:58And then you can choose the model. I'll describe that.
02:02And then you'll enter in a custom prompt.
02:05For example, I said how to learn Latin effectively.
02:08You can enter whatever prompt you want.
02:11And with this code, you can interact with these open source models and get the output.
02:16And I'm going to describe this.
02:20So I'll try to make this video as useful as possible.
02:24Okay, so for the first thing is that to use them on, to use these models on Hugging Face,
02:31first you're going to want to make an account on Hugging Face.
02:35And it's pretty easy.
02:37Just go to the website.
02:38And it might be at this link, slash join.
02:42But you'll need to make an account.
02:45And once you do, you'll be able to get API keys.
02:49So if you don't already have an account, please make an account with Hugging Face.
02:53Otherwise, you won't be able to use their API.
02:56And then to use the models on Hugging Face,
03:04first you need to know the model page.
03:08So for example here, on Hugging Face,
03:11this is a, they're trending models.
03:14But you see here, these are two of the most popular ones.
03:18And also Quinn and some other ones.
03:21This is a model I was hoping to try eventually.
03:25But anyway, you'll find the model page.
03:28And I put the model page in here.
03:32And I'll include the code for you in this video.
03:34And these are the links to these two models,
03:39the OSS-120B and OSS-20B.
03:44Okay, and what this says is the 120B has 117 billion parameters with 5.1 billion active parameters.
03:54And the 20B one has 21 billion parameters with 3.6 billion active parameters.
04:03And in my experience, generally, the higher the number of parameters, the better the output.
04:09Although not always, but that's the general situation.
04:13But I do think both these models are quite good.
04:17So this one will be a bit smaller.
04:19And this one would be larger.
04:21But this one is probably more powerful.
04:23But the good news is we're going to use the API.
04:26So we don't need a powerful computer to run this.
04:29We just need to use the API.
04:31Okay, so after you've made an account and you know the model page,
04:39then what you're going to do is for any given page,
04:43what you're going to do here, if you want to use the API,
04:49is you're going to click on Deploy and then click on Inference Providers, like here.
04:55And this code here is going to, this is the basic code to be able to use this.
05:02And this is Python code.
05:05This is JavaScript.
05:06This is curl.
05:07I use Python.
05:08That's what I'm going to use in this video.
05:10But you can use JavaScript if you want instead.
05:13And we're going to use the HuggingFaceHub.
05:19But actually, we're going to use this OpenAI.
05:23So there's different styles of interacting with the code.
05:26I'm going to use this OpenAI one.
05:29But if you prefer to use the HuggingFaceHub package, you can use that.
05:34It doesn't really matter.
05:36But you'll use this one.
05:38And the main thing is that we're going to need to have a token.
05:40And I'll show you how to do that in just a moment.
05:47So you'll copy this code.
05:49And this code is basically what I copied here, except I broke it up a little bit.
05:54It has this client code here.
05:57And you see, this is the client code.
05:59And then I printed it below.
06:01And then this is importing some packages, basically.
06:08Okay.
06:08And once you have the code, the code would look something like this.
06:14And then we're going to get an API key.
06:16And this is important because you can't run without the API key.
06:22So what you're going to do is you're going to click on this and then go to Access Tokens.
06:30And then what you're going to do is click on Create New Token.
06:36And you can look into this permission if you're interested.
06:42I'm just going to use Read Permissions.
06:44And you can give it any name you want.
06:46But I'm just going to call it Example Token.
06:48And I'll just make this for this video.
06:53And I'll delete this token after I'm done with the video.
06:57But this is a token that you might see.
07:00For example, this one here.
07:03And by the way, if you just made an account, so you have a free account,
07:08the token should work a few times, maybe five times or something like that.
07:12And eventually, it's going to ask you to get a paid account.
07:15But at least we can try it out a few times before.
07:20So I just copied the token.
07:23And what I'm going to do is see here.
07:29See, this is the token.
07:31And what I'm going to do is I'm going to put the token into my code.
07:38So I called it Hugging Face.
07:41I'm going to copy this line here.
07:43I called it Hugging Face Key, like this.
07:49And you can just follow along with the code.
07:52I'll include the code in the video.
07:54So the...
07:55And this is the second method to add your token.
07:59I'll discuss this later.
08:01But the first method is directly having it in Python code like this.
08:05And this is, I think, a more secure way.
08:10So where this token is not exposed directly in Python, or at least you can't see it.
08:17It wouldn't be like this.
08:19It would basically be interacting with the environment variables.
08:23And that's how I would get it.
08:26So this probably is a more secure way.
08:29But anyway, so this first way, we just copied the token.
08:32And we'll go back here.
08:34So we copied the token.
08:36And now we have the API key.
08:40And then we're going to...
08:44For example, this is an example token.
08:48I think that's a different token.
08:50And this should have been deleted already.
08:52Or it's a fake token.
08:53But that was just an example.
08:56And then...
08:58Yeah, so let's run through this code.
09:01So now that we have a token, I'm going to clear everything.
09:05So I'm going to restart and clear all output.
09:10And this is a Jupyter notebook.
09:13But I'm going to show you later some Python code.
09:17This is very similar Python code.
09:19Except this is just a .py file.
09:24And it's slightly different.
09:25But this is the more efficient way to run the code.
09:29Using Jupyter notebook, this is more for like presentation.
09:33But anyway, so I'm going to show you.
09:35So I just restarted.
09:36And run it like that.
09:40And then you've made an account at Hugging Face.
09:43You've got your API key.
09:45And here I just added the key in Python.
09:49And the steps, again, you would...
09:53Oh, yeah, I forgot to mention too.
09:55Again, for when you're copying...
09:57When you want to get the model, for example.
10:00For this one, 20B.
10:02You would go to Inference.
10:04And then you've got to make sure that you copy this model exactly.
10:08For example, if it's GPT-OSS-20B.
10:12It's going to be using this provider, Fireworks.ai.
10:18Or it could be Novita.
10:19I think I used Novita.
10:21You've got different options.
10:23I think I used Novita.
10:26Yeah, so I used Novita.
10:28It doesn't really matter.
10:30Just make sure that you...
10:31When you're getting the code, you know which...
10:37So basically, this one and then knowing the token are basically the only two things you really need to know.
10:45And, okay, so you can just follow me along.
10:47Or you could just use the same code as me and just edit the key.
10:53Okay, so we're going to try out the 120B Novita.
10:58I'll enter here.
10:59And then I just made some code to make a custom prompt.
11:04So, for example, I have something to test the quality of AI models.
11:10Descriptive process of photosynthesis and plants.
11:13I have this file called...
11:16Let's see here.
11:18It's called just custom prompt.
11:21And I'm just going to put this as teach me to learn Latin.
11:27Excuse me.
11:28I'm going to change this.
11:34Okay, I was editing in a file that was read-only.
11:38So that was the reason I couldn't type that.
11:40Okay, so what I have here is this code.
11:44And I'm putting in this custom prompt.
11:47But actually, to make it easier,
11:49what I'll do is I'll just put the custom prompt like this.
11:52This is prompt equals.
11:57And later, I'll show you editing this.
11:59I think it'll make it easier just to show it like this.
12:02So I have the custom prompt here.
12:03And I'll just paste it.
12:05It says describe the process of photosynthesis and plants.
12:08And then later, probably a better way is to have a text file.
12:12And you can just edit the text file.
12:13So we don't have to edit this every time.
12:17And so this is the prompt.
12:20Describe the process of photosynthesis and plants.
12:23The model we chose is the GPT-OSS-120B.
12:29And it's using Novita.
12:31And then finally, what we're going to do is run the code.
12:35So this is going to use the key that we have.
12:39It's going to send it to HuggingFace.
12:43And it's going to use this prompt, basically.
12:46And then what we're going to do is we're going to get output.
12:49And I'll print out the output.
12:57So this might take a few seconds.
12:59Generally, it was pretty fast before.
13:07And let's see how long it's going to take here.
13:13OK.
13:14It's taking a little bit longer than I thought it would.
13:17OK.
13:17I'll pause it and come back when it's done.
13:22OK.
13:23It didn't take that long, actually.
13:24I think it probably only took 10 to 15 seconds, which is not too long.
13:29And it was using the bigger model.
13:32And it gave this output.
13:35And I have this code to write the output to a file.
13:40So I'll do that right now.
13:41And I'll open up the file.
13:45OK.
13:46So I'm going to open up the file now.
13:48Here we have the output.
13:50I called it LLM output.
13:53I'll reload it.
13:55And you see here it says photosynthesis, a step-by-step overview.
13:58OK.
13:58That's fantastic.
13:59So it gives the output as markdown.
14:03And then we're going to use this website, markdown2html.com.
14:07I'm going to paste it like this.
14:09I'm going to copy this.
14:10And then, let's say, I'm going to put this in here, photosynthesis.
14:21And it's probably much better to use something like only office or this, Google Docs.
14:32And you can see it formatted better, converting the markdown to HTML.
14:39And let's just read this first part.
14:41Photosynthesis is the way green plants and many algae and bacteria capture light energy
14:47and convert it into chemical energy stored in sugars.
14:51So I think that's a great answer.
14:53And it gives five whole pages, which I think is fantastic, or four pages plus almost five pages.
15:04And quick summary, so it gives a very comprehensive answer of what the synthesis is.
15:11And let's call this 120 using the 120 model.
15:15Now, let's ask the same question, but this time, let's just change the model to using the OSS20B.
15:26So one of the great things about programming is that if you make code efficiently,
15:32you can just change one line or change very little,
15:37and you can rerun it and basically get a whole new output.
15:41Okay, so like this, I'll just rerun it for you here manually.
15:47So we have the same key, and now we're going to use a different model,
15:52the same prompt, and I'm going to run this again.
15:56And I don't know how long this will take, but I'll pause it and come back when it's done.
16:02Okay, so the 20B actually was much faster than the 120B.
16:06And let's see the output for here.
16:09So it says photosynthesis, the step-by-step overview.
16:14And let's write it to output as well.
16:18So it would have overwritten this.
16:21And you can see this is a different output.
16:26And let's convert this to HTML.
16:28And let's put this as photosynthesis 20 to mean to be for 20B.
16:41So it gives almost three pages of output compared to the almost five pages of output for 120B.
16:49But the 20B was much faster.
16:55So like I said before, usually the number of parameters goes up.
16:59Usually the output is better, but also it often means it's slower and takes more computational power.
17:04This one, it seems to be much faster.
17:08So let's look at the output here.
17:10So I asked it, again, the question was,
17:14describe the process of photosynthesis in plants.
17:17And this one gives the output of,
17:19it is the biochemical process by which green plants, algae, and some bacteria
17:25convert light energy from the sun into chemical energy stored in organic molecules,
17:32mostly sugars.
17:34And, yeah, I think this gives a really great output.
17:37Okay, and now let's modify this slightly.
17:47And now what I'm going to do is,
17:49before I mention that this is manually,
17:51that manually enters the prompt,
17:54but this is probably a very inefficient way to have to manually edit this every time.
17:59Like if you wanted to put another,
18:01you could put it like that,
18:02but that's, I think, very inefficient.
18:04It's probably much better to read it in from a file.
18:08So what this does is,
18:10it's going to have a file called custom prompt.txt,
18:13and we'll be able to play that.
18:19So, for example,
18:22let's ask it,
18:25teach me how to play golf.
18:28I am a beginner.
18:35So let's say you are a beginner at golf.
18:39I'm going to save that here.
18:42And, by the way,
18:42that file is in the same folder as that.
18:47So what I'm going to do now is,
18:50we'll use the same model as before,
18:51the smaller one.
18:53And now let's have the prompt be this.
18:55Teach me how to play golf.
18:56I am a beginner.
18:58And now let's run this output,
19:01because I think the 20B was pretty fast.
19:06And let's see how long that's going to take.
19:12So it's already done now.
19:13That's fantastic.
19:16And did it write to output?
19:19Okay, let's have it write to output.
19:20And now let's have it,
19:27let's convert the markdown to HTML.
19:32And now let's say golf,
19:34one,
19:34golf 20B.
19:35So this is the output for the 20B model.
19:45When I say 20B,
19:46I'm referring to this one,
19:47OSS-20B.
19:50And it says here,
19:52below is a practical beginner-friendly roadmap
19:54that will get you playing a full round of golf
19:56in no time.
19:57Feel free to skim or deep dive
19:59into sections that interest you.
20:01So it teaches you about different clubs.
20:04You've got the one wood,
20:05three wood,
20:06five iron,
20:07wedge,
20:08putter,
20:08and so on.
20:12Golf balls,
20:13tees,
20:16clothing.
20:17So yeah,
20:17this is really cool.
20:18It gives seven pages of output.
20:21And it only took like,
20:23I don't know,
20:23five seconds?
20:24Definitely less than 10 seconds.
20:27So this is,
20:29yeah.
20:30And again,
20:31the thing that really I like very much about this
20:33is that this is open source.
20:35GPT-5 is not open source,
20:37at least as of now.
20:40Okay.
20:41And now let's do one more thing here.
20:44Instead of using the 20B,
20:46now let's use the 120B.
20:48And let's do the same prompt.
20:51So we're going to do the golf prompt.
20:53I'll run all this code
20:55because it might,
20:56the 120B is a little slower.
20:57I'll come back,
20:58I'll run this,
20:59and I'll come back when it's done.
21:02Okay.
21:02The 120B actually was really fast.
21:07And now I'm going to show you this output.
21:12So notice here,
21:14it's different text than the other one.
21:19See here,
21:19this says,
21:20welcome to the green.
21:21That was from 20B.
21:22Now we're going to put in the 120B.
21:25Beginner's Guide to Playing Golf,
21:27and we'll call it Golf 120B.
21:36Okay.
21:36So,
21:38golf is a sport
21:42that blends skill,
21:43strategy,
21:44and a fair amount of patience.
21:45If you've never stepped onto a green before,
21:48this quick guide will
21:49walk you through the essentials,
21:51what you need,
21:52the basic layout of a round,
21:53fundamental swings,
21:54and the etiquette that keeps the game running smoothly.
21:58So it talks about clubs,
22:01and
22:02it gives kind of a similar answer,
22:06but it's still a different answer.
22:07So I think this is quite good.
22:14Now I personally don't play golf hardly ever.
22:17I don't really play golf
22:18really ever,
22:20but
22:20I think this is a very comprehensive answer.
22:25And I like that it gives a typical day at the course.
22:28Yeah,
22:29this is kind of true.
22:30I mean,
22:30I used to be a caddy,
22:32and this kind of
22:33seems realistic.
22:34Yeah,
22:39that seems pretty realistic.
22:41And it talks about common mistakes
22:43beginners make.
22:45Overswinging,
22:45poor balance,
22:46losing lift and distance,
22:48inaccuracy,
22:49too much power.
22:51Okay,
22:51that's a great answer.
22:54Okay,
22:55now what I want to do is
22:56I want to show you,
22:59hopefully this will work,
23:01that
23:01remember I said before
23:02this is sort of the easy way
23:04is to put the key
23:06directly in the file.
23:08And
23:08if you're just working with yourself,
23:10that should be fine.
23:12But if you're going to interact
23:13with other people
23:14with the code,
23:15or you want to be more secure,
23:17probably this is a more secure way
23:19to use environment variables.
23:22And for example,
23:23if you're using Linux,
23:25you could in a bash shell
23:26type something like this,
23:27export
23:28HF
23:29underscore token
23:30or
23:31or put
23:32put it in
23:35dot bash
23:36RC file.
23:39Okay,
23:40put
23:42put this in the
23:43dot bash
23:44RC file
23:44or put
23:49something like that.
23:52And you would put your actual key there.
23:54Now let's use the
23:56environment variable.
23:58I've already
23:58I've already done this before,
24:00so hopefully it should be
24:02available.
24:04Okay,
24:04so I'm using
24:05a different key now.
24:08It should be
24:10one of
24:10from another account.
24:14And
24:14now let's see.
24:16Okay,
24:18now
24:18let's use
24:20the faster model
24:2220B
24:22and
24:24I'm going to ask it
24:25a different question now.
24:26Let's say,
24:27for example,
24:29teach me
24:29how to learn
24:31Portuguese
24:32within three years.
24:39How to learn
24:40Portuguese
24:40and be fluent
24:42within three years.
24:44So I'd be curious to know
24:46what it
24:46what it thinks
24:47how to become
24:47fluent
24:48in Portuguese.
24:51And
24:52I'm going to ask this
24:53and I'll come back
24:54when it's done.
24:56Okay,
24:56I think it took
24:57less than 10 seconds,
24:58although I didn't actually
24:59time it.
25:02And
25:03then here
25:03it gives
25:04a road to fluency map
25:06for Portuguese.
25:08And
25:09I'm going to write that
25:10to the output.
25:12And
25:13I'll reload this now.
25:14and then I'll copy
25:16this output
25:17to
25:17markdown to HTML
25:19and let's see
25:21what it looks like.
25:26I'll set
25:27Portuguese
25:27120B
25:28and let's see
25:30what it says here.
25:32Below is a road
25:33to fluency handbook.
25:35You can print out,
25:36keep in your planner,
25:37or copy into
25:37a note-taking app.
25:38Three years
25:39is approximately
25:40say
25:42almost
25:421,100 days.
25:45A realistic target
25:46for a motivated adult
25:48if you spend
25:49roughly
25:49one and a half
25:50to two hours a day.
25:52Okay,
25:52that's a lot of
25:53study time,
25:54honestly.
25:57But let's see,
25:58practice the language,
26:00the simple grammar,
26:01and
26:04let's see here.
26:08Three hours a day?
26:09Oh boy,
26:10that's
26:11that seems
26:13difficult.
26:15Especially if
26:15you have a full-time job
26:17and lots of other
26:17things.
26:20Okay,
26:20quick tips
26:21for the long game.
26:22Never stop speaking.
26:24Celebrate micro-wins.
26:25Keep a cultural journal.
26:27Join a Brazilian
26:28or Portuguese
26:29community.
26:30Play games.
26:35And
26:35teach someone else.
26:41All right,
26:42I think that's
26:42quite a good answer.
26:45And then now,
26:45let's ask the same question,
26:47but let's do it
26:48with,
26:48oh,
26:49that was with 20B.
26:50Okay,
26:51120B
26:51will probably give
26:52a more comprehensive answer.
26:54I'll come back
26:55when it's done.
26:55I think it took
26:58more than 15 seconds,
27:00but let's see.
27:01It might have given
27:02a very comprehensive output.
27:07And
27:08I'm gonna
27:09copy this
27:10markdown
27:11to HTML.
27:13And I just
27:13edited this,
27:14so the last one
27:15was actually
27:16using 20B.
27:19And
27:20we'll put this one
27:21in here.
27:21Oh,
27:23wow.
27:24It gave
27:2411 pages
27:25of output
27:26just within
27:27even 15 seconds.
27:29That's incredible.
27:30I am truly
27:31blown away here.
27:33Okay,
27:33it says,
27:34below is a step-by-step
27:35three-year
27:35roadmap
27:36that'll take you
27:37from zero Portuguese
27:38to confident
27:39fluency.
27:40So,
27:41a C1
27:42or C2
27:42level.
27:44If you follow
27:44the daily habits
27:45and milestones
27:45it outlines,
27:47it's organized
27:47in four phases.
27:48each of the
27:50clear focus,
27:51recommended resources,
27:52a weekly hour budget,
27:54and concrete checkpoints.
27:56Feel free to adjust
27:56the exact hours
27:57to match the time
27:58you can devote
27:58each day,
27:59but try to keep
28:00the minimum
28:01of,
28:02let's say,
28:0330 minutes a day
28:04and at least
28:06two hours
28:07of exposure.
28:11Okay,
28:12so
28:12at least
28:1330 minutes
28:13of active study
28:14and at least
28:15two hours
28:16of exposure.
28:17So,
28:17I don't know
28:17what that means
28:18just listening
28:19to videos
28:21online
28:21or the radio.
28:23This actually
28:24seems like
28:25quite a lot
28:26of effort.
28:27Honestly,
28:28this to me
28:28would seem
28:29like if you
28:30go to just
28:31a language school,
28:32this seems
28:34difficult.
28:35Okay,
28:35so typically
28:36a week,
28:37a weekly,
28:38you spend
28:39about eight hours,
28:40five to eight
28:41hours a week.
28:43Okay,
28:44so this
28:45basically is,
28:46as you build
28:47up your
28:47foundations
28:48from
28:48beginner
28:49to,
28:51so this
28:51is after
28:52two years
28:53and then
28:53this is
28:53three years.
28:59You're
28:59spending
28:59about
29:0014 hours
29:01a week,
29:0212 to 14
29:03hours a week.
29:04It's a lot
29:04of time,
29:05but
29:05one and a half
29:08hours a day.
29:10Oh,
29:10boy,
29:10that's all.
29:10But let's
29:11see if,
29:13I think it
29:14gives
29:14interesting
29:15answer.
29:21So it
29:22says,
29:22it's not a
29:23sprint,
29:23three-year
29:24timeline,
29:24is realistic
29:25if you commit
29:26to daily
29:26exposure,
29:27even if it's
29:28just a short
29:29podcast while
29:29commuting.
29:31Balance input
29:32and output.
29:33Okay.
29:35And I don't
29:35know Portuguese,
29:36I just know
29:37some Spanish,
29:38but I think
29:39this says
29:40something like
29:42have a good
29:43journey.
29:45Have a good
29:46journey studying
29:47Portuguese.
29:47So what I
29:52wanted to say
29:53is that,
29:53yeah,
29:53this really
29:54is quite
29:55good.
29:58So now
30:00I've just
30:00shown you
30:01in Jupyter
30:01Notebook,
30:03now I want
30:04us to
30:05graduate to
30:06Python,
30:06just the
30:07Python file,
30:09and I'm
30:09going to do
30:09that right
30:10now.
30:13Okay,
30:13so this
30:15is basically
30:16the same
30:16code as
30:17before.
30:18Except now
30:18it's just
30:19in a Python
30:20file,
30:20and it's
30:20not just
30:21for presentation.
30:23With this,
30:24I'll be able
30:24to more
30:25easily run
30:25the files.
30:28And
30:29basically
30:30what I'm
30:31going to
30:31do is
30:31run a
30:32file like
30:32this.
30:39For
30:40teaching
30:40hugging
30:41face.
30:43Yeah.
30:43So I
30:44would run
30:44a model
30:45like,
30:45I would
30:46run the
30:46code like
30:46this,
30:47clear this
30:50here.
30:53So I
30:55would run
30:56the code
30:56something like
30:57this.
31:01But first
31:02I want to
31:02show you
31:03here.
31:04So I
31:04have this
31:05code,
31:05and I'll
31:06basically,
31:07you can run
31:07all this
31:08code and
31:10not really
31:12have to
31:12change much
31:13at all,
31:14except just
31:14change the
31:15model,
31:16and you
31:17would change
31:17the,
31:18for example,
31:19here you
31:19would change
31:20the token.
31:21If you want
31:21to run it,
31:22if you don't
31:23want to deal
31:23with environment
31:24variables,
31:25you could
31:26deal like
31:26this.
31:27Let's say,
31:27for example,
31:28let's copy the
31:29environment
31:29variable,
31:30not the
31:31environment,
31:31let's copy the
31:32token we had
31:33earlier,
31:33this token.
31:37So for
31:38example,
31:39we can have
31:40this token,
31:41and what this
31:41code does is
31:42it imports
31:43some packages.
31:45Don't really
31:46need this one.
31:46This one I
31:47set up to
31:48have a
31:48custom name
31:50for the
31:50file,
31:51but that
31:52doesn't matter
31:53so much.
31:54This is the
31:54most important
31:55package to
31:55use because
31:56that's what
31:58I set up
31:58with hugging
31:59face.
32:00So we
32:01have the
32:01key,
32:02and here
32:03we're going
32:03to choose
32:04the model.
32:05If you don't
32:05want this
32:06model,
32:06you can
32:07change to
32:08the 120B
32:09or use a
32:09different
32:10model.
32:12If you
32:13don't want
32:13to use
32:13one of
32:14these,
32:14you can
32:14use this.
32:16The method
32:16is very
32:17similar to
32:17change models
32:18on the
32:18hugging
32:18face.
32:19And then
32:20we have
32:20the custom
32:21prompt.
32:21This opens
32:22the custom
32:22prompt,
32:23but here
32:23we're not
32:24going to
32:24print it
32:24because it's
32:25not really
32:25needed.
32:26Now we
32:26just kind
32:27of assume
32:27that we
32:28know,
32:28okay,
32:29we know
32:29we're going
32:30to change
32:30this,
32:31say,
32:32teach me
32:32how to
32:33learn
32:34data
32:35science,
32:36for example,
32:38within two
32:39years
32:39to become
32:41an expert.
32:43I'm curious
32:44to know
32:44what this
32:45will say.
32:46So let's
32:46say that
32:46you want
32:47to learn
32:47data science
32:48and become
32:49an expert
32:50within two
32:50years.
32:52I want
32:52to know
32:52what it
32:53has to
32:53say.
32:54And then
32:54this code
32:55is basically
32:56the same
32:56code as
32:57the other
32:57one.
32:58See here,
32:59more or less
32:59it's the
33:00same code,
33:00I just
33:01did a
33:01lot of
33:01copy and
33:02paste.
33:04And this
33:06code here,
33:07it gives a
33:08custom name.
33:12But honestly,
33:13I don't want
33:14to confuse you.
33:14That's something
33:15I used for
33:16myself.
33:16because I
33:17like this
33:18basically
33:18what it
33:19would have
33:19is it
33:21would have
33:21the date
33:24in it
33:24and it
33:25would put
33:26the model
33:26name in
33:26it.
33:29But for
33:30the purpose
33:30of this
33:30video,
33:31you can
33:31edit this
33:32later if
33:33you're so
33:33interested.
33:34I'm just
33:34going to
33:34have it
33:35have the
33:35same
33:35output
33:36name,
33:37LOM
33:37output.
33:39So here,
33:39again,
33:40it's basically
33:40the same.
33:42But now I
33:42want to show
33:42you how to
33:43run it in
33:43Python.
33:44So this
33:47is going
33:48to run
33:49the how
33:51to become
33:51a how to
33:52learn data
33:52science within
33:53two years
33:53basically using
33:54the 20B
33:55model.
33:56And let's
33:57run this
33:57and see
33:58what happens.
34:03Okay,
34:04so I had
34:04it print
34:05out the
34:06I think
34:07I had it
34:07print out
34:08the output.
34:10Yeah,
34:10so it
34:11printed out
34:12the output
34:12to the
34:13command,
34:14to the
34:14console.
34:16But
34:16what's more
34:18useful is
34:19that it's
34:19actually written
34:20to the
34:20file as
34:20well.
34:21So here,
34:22for example,
34:22it says
34:2320 to
34:2425 hours
34:25per week
34:26continuous
34:26practice
34:27real-world
34:27projects.
34:29Expert
34:29can mean
34:30many things.
34:31Okay,
34:32so let's
34:32copy the
34:34output.
34:38I'm going
34:38to put
34:38this in
34:39here
34:39and then
34:41copy it
34:42to
34:42and that
34:48was the
34:4820B
34:49model.
34:52Okay,
34:52and it
34:53says,
34:53oh,
34:53well,
34:53so it
34:54just gave
34:54a six
34:55pages.
34:56I think
34:56that's
34:56quite
34:57good.
34:5920 to
34:5925 hours
35:00per week.
35:00So that's
35:01if you're
35:02just working
35:02five hours
35:04per week,
35:04that's five
35:04hours a
35:05day.
35:05That's a
35:05lot.
35:08So
35:09foundations,
35:10math and
35:10programming
35:11basics,
35:11statistical
35:12inference and
35:13classical
35:13machine
35:13learning,
35:14deep
35:15learning,
35:15big data,
35:16real-world
35:17impact,
35:18internship or
35:19full-time role
35:20or freelance
35:21gigs,
35:22publish paper,
35:23blog series,
35:24teach or
35:24mentor.
35:25So I'm
35:26sort of
35:26in this
35:27phase right
35:27now.
35:29But I
35:30think that
35:31this is
35:32quite a
35:33good answer.
35:34yeah,
35:39so I
35:40think
35:40building
35:41some
35:42atomic
35:43goal
35:44setting
35:45and habit
35:45building.
35:49Let's
35:49see here.
35:51So
35:52calculus,
35:52linear
35:52algebra,
35:53probability,
35:56Khan
35:56Academy.
35:57My
35:57gosh,
35:58you could
35:58use this
35:58to sort
36:00of have
36:00your own
36:01master's
36:01degree.
36:02I mean,
36:02not actually
36:03have the
36:03degree,
36:03but at
36:04least you
36:04have the
36:05knowledge.
36:08Data
36:08wrangling,
36:09Python,
36:10statistics,
36:11deep
36:12learning,
36:12big data,
36:15machine
36:15learning,
36:17operations,
36:21data
36:21visualization.
36:25So
36:25yeah,
36:26learning to
36:27use
36:27matplotlib
36:28and
36:28seaborne
36:29and
36:29plotly
36:30are all
36:30pretty
36:30good.
36:32And
36:33Tableau,
36:33so I
36:35think this
36:35is a
36:36very
36:36great
36:36answer.
36:38And
36:38just to
36:39be fair,
36:40what I
36:40want to
36:40do is I
36:40want to
36:41ask the
36:41same
36:41question to
36:42120B.
36:43So I'm
36:44going to
36:44comment this
36:45out and
36:46go to
36:47120B.
36:50And I'm
36:51going to run
36:51this code
36:52now.
36:52and I'll
36:55come back
36:56when it's
36:56done.
36:59Okay,
37:00so it
37:00finally
37:00finished.
37:02And this
37:02was a
37:02bit slow,
37:03honestly.
37:03This took
37:04more than
37:0430 seconds.
37:06But let's
37:07see the
37:08output.
37:09So again,
37:10this was
37:10from the
37:11120B
37:11model.
37:13I'm going
37:13to copy
37:14it into
37:14Markdown
37:15to HTML.
37:15and let's
37:17get this.
37:20So we'll
37:21call it
37:21Data
37:21Science
37:22120B.
37:29Wow,
37:30it gave
37:3016 pages?
37:31Oh my
37:32goodness.
37:3316 pages
37:34in 30
37:34seconds?
37:35That's
37:35incredible.
37:37So it
37:38says,
37:38below is
37:38a step-by-step
37:39two-year
37:40roadmap that
37:41takes you
37:41from no
37:42background to
37:42a level where
37:43you can
37:43comfortably
37:44call yourself
37:44a Data
37:45Science
37:45Expert.
37:47Churn
37:47the date.
37:48So you
37:50have three
37:51month blocks.
37:52Each quarter
37:53has a
37:53focus.
37:54Deliverables,
37:55recommended
37:55resource.
37:57Active
37:57learning
37:58first.
37:58Build
37:58something
37:59every
37:59week.
38:00Theory
38:00is
38:01essential,
38:01but you
38:02retain it
38:03only when
38:03you apply
38:04it.
38:04That's
38:04fantastic.
38:05This is
38:05incredible.
38:07This is
38:07so true.
38:08Portfolio
38:08first mindset.
38:09Every project
38:10you finish
38:10goes into
38:11a public
38:11GitHub
38:11personal
38:12site.
38:13Recruiters
38:14and collaborators
38:14stud you
38:15by what
38:15you've
38:15built,
38:16not by
38:16the
38:16courses
38:17you've
38:17watched.
38:18Iterate
38:18and specialize.
38:19After the
38:20first year
38:20you have
38:20a solid
38:21generalist
38:21foundation.
38:23Second year
38:24you can do
38:24deep dives.
38:25focus.
38:28Honestly,
38:29this is
38:29incredible
38:29output.
38:31Both of
38:32them gave
38:32incredible
38:33output.
38:37I've
38:38now shown
38:38you the
38:38code.
38:40I want
38:41to review
38:41for this
38:42video.
38:43Again,
38:44to use
38:45these models
38:46on
38:47Hugging
38:48Face or
38:48really almost
38:49any LLM
38:50model,
38:50not all
38:51models,
38:51but probably
38:52most of the
38:52big models
38:53on Hugging
38:54Face,
38:55the LLMs.
38:57First,
38:58you need to
38:59make an
38:59account.
39:01I did want
39:02to show you
39:02just because
39:03this could
39:03change.
39:04Generally,
39:05just make an
39:05account like
39:06almost any
39:06other site.
39:08You'll probably
39:08need to
39:09verify an
39:09email.
39:11Then you're
39:11going to go
39:12to one of
39:12these models,
39:13the model
39:13pages.
39:15Actually,
39:15you can just
39:16use the code
39:17that I gave
39:17you,
39:18but if you
39:19don't want
39:19to for
39:19some
39:20reason,
39:20go to
39:21Inference
39:21Providers,
39:23and this
39:23gives you
39:23example code,
39:25and you
39:26can choose
39:26the provider
39:27and the
39:28language,
39:29or you
39:29can just
39:30go there
39:30Default,
39:31and the
39:31main thing
39:31is that
39:32you're
39:32going to
39:32need to
39:33have the
39:34token,
39:34so you
39:35can put
39:35the token
39:36like I
39:36have,
39:36or use
39:37an
39:37environment
39:37variable.
39:39Just as
39:39a final
39:41thing here,
39:42I showed
39:43you copying
39:44it directly
39:44in this
39:45Python
39:49with other
39:50people,
39:51is you
39:51can use
39:51an
39:52environment
39:52variable
39:52like this,
39:53or if
39:53you put
39:54it on
39:54the
39:54internet,
39:54if you
39:55don't want
39:55to expose
39:56your key,
39:57I'm going
39:58to delete
39:58this key,
39:59so it
39:59doesn't
39:59matter,
40:01but this
40:02is probably
40:02the more
40:02proper way,
40:03and I
40:04think I've
40:04already shown
40:05you in
40:06Jupyter
40:06Notebook
40:06this,
40:07so I
40:07won't
40:07rerun
40:08it.
40:09Okay,
40:10so going
40:10back here,
40:12so again,
40:13you're going
40:13to get the
40:13code like I
40:14showed you,
40:15this is
40:15similar code,
40:17and then
40:17you're going
40:17to get an
40:18API key,
40:19again,
40:20it's going
40:20to look
40:21something like
40:21this,
40:22I made
40:23a token,
40:23but you
40:24can make
40:24a new
40:24token,
40:25and you
40:26can give
40:26it whatever
40:26name you
40:27want,
40:28let's say
40:28example
40:29token 2,
40:30and I
40:31would recommend
40:31use read
40:32permissions,
40:33but if for
40:33some reason
40:34you want
40:34to choose
40:34others,
40:35you can,
40:35or you
40:36can even
40:36choose
40:36write,
40:37but probably
40:38read is
40:38good,
40:39you can
40:40create token
40:40and then
40:41you'll
40:41copy it,
40:43and to
40:43review the
40:44code that
40:44I made,
40:46so this
40:47code,
40:48what it
40:48does,
40:49this
40:49has the
40:50essential
40:51packages,
40:52this is the
40:53most important
40:53one,
40:54and also
40:55this one
40:55if you're
40:55going to
40:56use the
40:56environment
40:56variable,
40:58I'm going to
40:58copy the
40:58API key,
41:00and you
41:02could choose
41:03one way,
41:03which is this,
41:04or you can use
41:05the environment
41:05variable like
41:06that,
41:07it doesn't,
41:07it doesn't
41:08matter so much,
41:09but if you
41:09don't want it,
41:10if you're going to
41:10put it on the
41:11internet,
41:11this is probably
41:12more secure,
41:13to use an
41:13environment variable,
41:14but if only
41:15you're going to
41:16ever use it,
41:17the first
41:18way is
41:18fine,
41:18and then
41:21here,
41:23you'll have
41:24the model
41:24name,
41:25and again,
41:26like from
41:27here,
41:28get the
41:29code,
41:29make sure
41:30you get the
41:31model name
41:31exactly,
41:32it'll change
41:34based on the
41:34provider,
41:36so I
41:37used,
41:38honestly,
41:39I don't
41:39remember,
41:40I think I
41:40used Novita,
41:42here there's
41:42Novita,
41:43but there's
41:43other ones,
41:43make sure
41:44you use the
41:45you choose
41:47the right
41:47model name,
41:48so the main
41:49things you need
41:49to know are
41:50two things,
41:50one is the
41:51key,
41:52and then next
41:53is the
41:53model name,
41:54and then you
41:54can basically
41:55use the
41:56code just
41:58like I
41:59had,
41:59if you don't
42:00want to use
42:01a custom
42:01prompt,
42:02text file,
42:03you can set
42:04it up like
42:04this,
42:06you can
42:06manually edit
42:07this,
42:08and I said,
42:09for example,
42:09describe the
42:10process of
42:10photosynthesis,
42:11you can change
42:12that,
42:12but you
42:14probably,
42:15especially again
42:16if you're
42:16going to be
42:16using this
42:17a lot,
42:17it's far
42:17better to
42:18use it
42:18as a
42:19text file,
42:20so for
42:20example here,
42:21I have
42:22the custom
42:23prompt,
42:24and then I
42:24changed this
42:25several times,
42:26I asked it
42:26how to get
42:27fluent in
42:27Portuguese,
42:28I think I
42:29showed you
42:29how to get
42:30fluent in
42:30Spanish or
42:31Latin,
42:34and again,
42:35I asked it
42:35about,
42:36well the
42:36synthesis,
42:37I asked it
42:37about golf,
42:40so,
42:41and if you
42:42do,
42:42just make
42:43sure you
42:43have a
42:43file called
42:44custom
42:45prompt,
42:47and you
42:47would edit
42:48that,
42:48and then
42:49make sure
42:49it's in
42:49the same
42:50folder
42:50as this
42:53code,
42:54and then,
42:56let's see
42:58here,
42:59and then
43:00we have
43:01the prompt,
43:02this is the
43:03code that
43:03actually sends
43:04it to the
43:04API in
43:05hugging face,
43:07and this
43:08might take
43:08a few
43:08seconds,
43:09generally
43:11the faster
43:11one is
43:12going to
43:12be the
43:12GPT-20B,
43:15it's a
43:15smaller model,
43:17the 120B,
43:18one of the,
43:18the one I
43:19asked it
43:20about data
43:20science,
43:20it took
43:21more than
43:2130 seconds,
43:22I believe,
43:23so it was
43:23a little bit
43:23slow,
43:24but it gave
43:24incredible
43:25output,
43:26so this
43:26model,
43:27again,
43:27is probably
43:27more powerful,
43:28might give
43:29better answers,
43:29but probably
43:30takes longer,
43:32this one's
43:33probably a
43:33little bit
43:33faster,
43:34but honestly,
43:35I think both
43:35of them are
43:36excellent,
43:36and again,
43:38as a review,
43:39both of
43:39these,
43:39120B and
43:4020B are
43:41open source
43:42LLMs,
43:43and I think
43:44they're the
43:44first open
43:45source LLMs
43:46that OpenAI
43:48has released
43:49since GPT-2,
43:51which came out
43:51in 2019,
43:52so it's been
43:52quite a while,
43:53OpenAI has
43:54released other
43:55great open
43:57source software,
43:58but I don't
43:58think they've
43:59released LLMs
44:00since these,
44:03so again,
44:05and then you'll
44:05have this code,
44:06and lastly,
44:08again here,
44:09let's say that
44:10you have the
44:11prompt,
44:11and then this
44:12will send it
44:12to the prompt,
44:13and this will
44:14actually get
44:15what the
44:15actual LLM
44:16output is,
44:17which is,
44:18to me,
44:18this is the
44:19most useful,
44:20it might give
44:22you a lot of
44:22information,
44:23but this is the
44:24one that's the
44:24most useful,
44:25the actual
44:25output,
44:26and then here
44:27I printed the
44:28output,
44:28but printing the
44:29output isn't
44:29that useful,
44:31because I'd
44:31rather save it
44:32in a text file,
44:33and what this
44:34does is it
44:34saves it to a
44:35file called
44:36llm underscore
44:37output dot
44:39md,
44:39which is
44:40right here,
44:44and then
44:45this is actually
44:46a Markdown
44:46file,
44:48and what you
44:49can do is you
44:50can go to
44:50convert Markdown
44:52to HTML,
44:53and then what
44:54you can do,
44:55again,
44:55is you can copy
44:56that output,
44:57and use
44:58something like
44:59a Google Doc,
44:59or use
45:00only Office
45:01output,
45:05and then you
45:07can paste it
45:07into here,
45:10and again,
45:10this is the
45:11data science
45:12output,
45:13but we've got
45:14output for
45:15golf,
45:15photosynthesis,
45:16learning Latin,
45:18learning Portuguese,
45:19and so on.
45:21Okay,
45:21I hope you enjoyed
45:22this video.
45:22This is a video
45:23for how to use
45:24the new models
45:25GPT-OSS-120B
45:26and GPT-OSS-20B
45:29using Hugging Face.
45:31I hope you enjoyed
45:32this video.
45:33If you liked,
45:34please subscribe to
45:35or follow my channel,
45:36and see you in the
45:37next one.
Recommended
28:54
|
Up next
2:11
49:32
2:54
14:35
1:55
14:58
15:00
2:59
14:57
14:58
14:58
14:56
14:58
14:58