
Lesson Description
The "Google Colab & Hugging Face" Lesson is part of the full, Open Source AI with Python & Hugging Face course featured in this preview video. Here's what you'd learn in this lesson:
Steve discusses course tools including Google Colab notebooks and Hugging Face for the session. Participants will need a Google account for Colab. Hugging Face is like GitHub for open-source models and datasets, simplifying model access and usage.
Transcript from the "Google Colab & Hugging Face" Lesson
[00:00:00]
>> Steve Kinney: So we have a few tools that we're going to be using. Really the two that you need is a Google account. So you can use these Google Colab notebooks, but they are effectively just Jupyter notebooks. So worst case scenario, if you needed to download said Jupyter notebook, you could.
[00:00:21]
That said, there's a few things in there where for just clearing out logs and stuff like that that are Colab specific. The good news is as long as you have a Google account, using Colab is effectively free, right? There is a kinda limited version. We get either CPU bound stuff or a lightweight graphics card that you can use.
[00:00:42]
And like to be clear, could you run all of this code on your computer? Absolutely. I just don't trust all of your graphics cards. And so knowing that we could have a stable set of graphic cards at our disposal seemed like the mature and responsible choice. So that's what we're doing because I did run some of these even on my M1 max.
[00:01:05]
You have time to make a sandwich if you run it probably on your laptop. So I think using Google's free GPUs is probably a good choice. The other one is Hugging Face which is. We'll talk about this in a second. Literally the next slide. It's not wrong to think about GitHub but for open source models, getting those two accounts now, why I buy you some time is probably, probably good.
[00:01:35]
And yeah, so like I said, Hugging face, it's like GitHub but for models and data sets and all sorts of other fun stuff. And like GitHub is just more than just code repositories now where there's stuff like GitHub Actions and code spaces. There is obviously more to Hugging Face the overall platform than we will touch today.
[00:02:00]
We are predominantly going to use it. One for SDK that makes working with some of these models very easy and two for the fact that like doing a Git clone, it makes getting the models very easy. But there is a ton of cool stuff that I encourage you to go poke around with as well.
[00:02:17]
And there are lots of different models and data sets to play around with. We are going to be somewhat conservative today with some of these smaller ones that I know will work in time frames conducive to our chats, hardware conducive to our chats, so on and so forth.
[00:02:35]
Also, if you ever thought too hard about a company name, just naming it after an emoji that inspires joy is probably not the worst thing that you could do. So yeah, if you do not have a hugging face account. Now's the time to go do that. But as you can see, lots of really fun stuff and one could lose many a weekend exploring all of the data sets and models.
[00:02:59]
Ask me how I know the one thing that you will do and for some of this I will not do it with you. As I project my screen to hundreds of people is we will go into our settings and I'll get you halfway there, but you'll do the rest and getting yourself an access token that we will go put in our Google Colab notebooks in a little bit.
[00:03:20]
And once we get that token, after that we will head over to Google Colab, where we will go ahead and put it in the sidebar and have it as an environment variable. Google Colab will keep the knowledge of these environment variables and secrets, but you'll have to flip it on for each notebook.
[00:03:42]
I also say that in case I forget at some point that now I have said it and someone can remind me, because sometimes when you're talking encoding and moving your mouse around, you forget some very simple, simple things. But we will take a tour of all of these things.
[00:03:58]
The other thing I will put in your head now before we jump in, is by default, most of the time you will start out on a cpu, which for a lot of things is totally fine and good. You can get a little bit more of a boost, particularly when it comes to image stuff, by switching over to a gpu.
[00:04:19]
And so again, little seeds that I plant in your mind now. So if you're following along and you missed that, I have now at least put at least one stake in the ground. You're like, why is mine going so much slower than his? At one point I will switch to the fancy GPUs for the, the fancy stuff mostly because who wants to wait for my computer to do stuff?
[00:04:38]
But these are the kind of little pillars that we're gonna jump, you know, kind of like put in place right now in our brains so that when they come up later today, I can reference them as if I had a plan this entire time. A few other things to kind of look at.
[00:04:56]
Like there are other libraries that make an appearance. None of them are things that you need to have an in depth knowledge of. So you're like, I don't know what that is. That's fine. We will kind of explain most of it as we go along. We're kinda just using them somewhat lightly.
[00:05:12]
The one that we will see the most is Pytorch, which is built by our friends at Meta, and it is just a set of tools for working with things like tensors and other neural networks and models. Along those lines, that is Other things like Numpy and I will use matplotlib just to visualize stuff at one point or another, but those mostly just make guest appearances, right?
[00:05:38]
The main thing that we'll be using is the Hugging Face Transformers library and the Diffusers library and some other fun Pythoney stuff.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops