Okay, so this is something completely different.
That hugging face is.
And of course they're related.
But but nonetheless this is different as well as being this this this platform, this hub that's online
that is basically a bunch of repos of data sets and models and also spaces.
Hugging face also has code, open source libraries that they've made available that everybody uses.
Everyone.
And these are these are open source libraries that implement open source transformer models.
So using PyTorch and also TensorFlow which is and also Jax.
These are all different deep neural network libraries.
But PyTorch is the most popular and that's the one that we'll use most.
And they've they've written Transformers in PyTorch so that you can then just import some Python code,
download some weights, and be running the model yourself in, in like in JupyterLab in cursor, or
as we will in a minute on Google Colab.
And so the first thing you might have in mind is, okay, what's the difference between running an open
source model that way versus running a llama, which we did in week one?
Well, I mentioned this at the time, but I'm going to do it again now.
But hopefully you're like, I get this llama is like a software product.
It's something that's been written.
It runs on your machine.
You don't get to run the code of it.
It's like an application and it is able to take files which are very efficient packaged models like
Gemma and Llama and the others.
They've been packaged into this file called a GIF file, and then it runs it with efficient C++ code
locally in a box, and it listens on a particular port, which and it provides an endpoint that's compatible
with OpenAI, as you know.
So you can just use OpenAI's libraries and connect to it.
So think of it as fast packaged pre-baked software.
Hugging faces libraries is like you get access to the actual code, the Python code, and you can step
through that code and you can run the model yourself in, in cursor or wherever, and in doing so,
you can change it as well.
You can mess around with the tokens.
You can swap out some layers of the neural network if you wish.
You can.
You can do things like fine tuning, and none of that is possible with a llama.
And so it's so completely different.
And I hope that now does make sense to you.
So the other thing that Hugging Face offers is a set of open source libraries for running Python code
to run neural networks with, with transformers as part of it yourself.
And that that that is the huge thing that they offer and something which is used everywhere.
And it started out that one of the the early models that you could run was llama, the model from Mata.
But but now almost any open source model you could imagine you can run using hugging face libraries.
And in particular there are six different hugging face libraries that we will use together during the
remainder of this course.
And the first of them is a little bit confusing, so bear with me here.
The first library that I will mention to you is a library called the Hugging Face hub, which you may
remember I told you was the name of the other thing.
That Hugging Face does the website and you were like, what?
And the reason is because this is a Python library that lets you connect to the hugging face hub to
download the models or the data sets that you can see on Hugging Face Hub and have them in your code
immediately.
So that's the kind of connection between them.
So you can import something which is like hugging Face Hub.
You can log in through code and you can say, I want this model in code talking to this, this, this
hub library, and it's connecting to the hugging face platform so that that's the first library.
Hope that makes sense.
And then the second library is called data sets.
And that particularly is a library that when you use the hub library to connect to the hub you can then
download a data set.
It becomes part of this data sets library.
And each each object represents a data set.
And you can do amazing things with it.
And it's super efficient.
And it allows you basically to manipulate vast amounts of data in an effective way.
And the third library is the big one Transformers.
This is the library that lets you say like like I want this particular model and I want the code for
it, and I want to be able to actually run it.
I want to train it.
I want to do anything with it.
You do it with the Transformers library that that is the iconic library at the heart of hugging face.
Then, pfft, we're now on this.
The second row is some of the more advanced library.
PFA is something we'll be using a lot in week seven.
It stands for parameter Efficient Fine Tuning, and it's a way to, uh, be able to train a model yourself,
but in a way that doesn't require you tweaking 8 billion weights or however many parameters there are
in this model, you can do it in a more efficient way.
And the library is the library that lets that be possible.
Also uses a technique that is known as Laura or Laura that maybe you have come across.
And then t which, uh, may remind you of some some ancient MTV show, but in this context, it's not
that it is the Transformers Reinforcement Learning library, which is again all about training Transformers
and Accelerate is a particular library that allows you to distribute models across multiple GPUs.
So this bottom row are the more advanced things that we may touch on distributed training and fine tuning
and and other stuff.
So this this set of libraries, this is at the heart of of so much work that happens with open source
with models.
And this is the the other part of hugging faces, the two things.
It's the the platform, the hub as it's called with with repos of datasets, models, spaces.
And then it is the software, the open source software, the libraries that you can use as Python code
yourself.
And we will we will use it a lot.
And then somewhat confusingly, one of them is called hub and allows you to connect to the hub.
All right.
All is clear.
Uh, let's, uh, let's let's now move on to the the other big topic.