What is Hugging Face? - Machine Learning Hub Explained

NeuralNine · Beginner ·📐 ML Fundamentals ·2y ago

Key Takeaways

The video explains Hugging Face, a machine learning hub, and its relevance for machine learning engineers, covering its tools and applications for ML development.

Full Transcript

what is going on guys welcome back in this video today we're going to learn about hugging face and specifically we're going to cover the question what is hugging face so let us get right into [Music] it all right so we're going to talk about hugging phas in this video today I want to cover the question what is hugging phas for those of you guys who don't know about it who don't know why you should care about it what you can find on it why it's relevant for machine learning engineers obviously it's going to be a foundational video mainly targeted towards people new into the generative AI field because most of you if you're working on a uh on generative AI on a regular basis you know about hugging face you've used it in the past but for those of you who don't know about it I want to cover the basics I want to show you what this platform is about now hugging face is basically a central Hub you could say a landing page a community for machine learning and for artificial intelligence you can find models data sets and so on on this platform it's basically like GitHub but instead of having General code bases it has machine learning models and data sets primarily so you can go to huggingface doco and you can go to the models uh page here and you can find a lot of different models uh to be precise you can find uh around 740,000 models here and you can also filter them by family or type so for example maybe I'm interested in a text to image model I want to generate images based on a text prompt and you can see I have a bunch of different models that I can um use here and the good thing about this is with hugging face you can easily use these models locally in Python without having um to do a lot of work when it comes to deployment so let's say for example I want to use this Runway ml stable diffusion v15 I can just go to the model I can look at the model card I can get a description I can get sample code that I can easily copy paste and use right away uh and I can scroll down to see some more information about the model to see also some benchmarks probably yeah there you go some benchmarks um and for every model you have a different model card with information benchmarks and so on you can also go to the files directly if you want to you can also go to the community discussions but the interesting thing is that you can just go ahead open up a terminal install a package which is most of the time either diffusers or Transformers so let's install both of them um and in addition to that you usually also want to have torch so Pi torch installed um and once you have these packages you can easily just go copy paste this code here uh go into your python development environment open up a python file for example main py copy paste this and now you can see uh this is the code I need to run stable diffusion locally of course you need to have the proper Hardware because you're not running this on the hugging face Cloud you're running this on your system which means you're getting the model but you're running it uh running it on your GPU as you can see here pipe to Cuda so I'm running this on my 3060 TI um and when I run this uh what's basically happening is it loads a pipeline uh it loads the model from hugging face and when it's done it basically just generates an image based on the prompt here a photo of an astronaut riding a horse on Mars which is the default prompt I can of course change that um but this is what hugging fa is all about you pick a model that you like you pick a model that you need and you just use the diffusers package use D Transformers package or some other package to just use the model as you can see now I have a new image here uh which is an astronaut writing a horse on Mars uh I can of course change that so let's do something like skydiving uh with sunet let's see if that works and this is an example of using the diffusers package now while this is working I can also go to something else let's go for um a basic language model let's go for the uh Bart large CNN from Facebook here uh and I can use this to summarize some text so for example here again copy paste the code uh let's look at the image once it's done oh actually it has the same file name yeah okay this is skydiving with the sunset doesn't look too good but this is how you can use a model easily then I can also go ahead replace this with the new code Transformers pipeline summarization task and I'm using the model Facebook Bart large CN so you can see all I have to do is I have to define a pipeline and I can have I have to pass the model Facebook Bart large CNN then I can add some text here I can summarize it and when I run this it's going to use this generative or this this Transformer based AI model uh to summarize the text of this article so actually in this case I didn't pass a GPU so this might be a problem in terms of effic efficiency so let's go and say device equals Cuda then it should work faster I think yeah I mean a little bit and you can see we get a summary um then maybe another thing that we can look at is a text to speech model so we can go to um speech 5 TTS from Microsoft again just copy paste the code again we're using the Transformers pack pack AG we're also using data sets we're loading data sets from um from hugging face because we also have this tap here data sets where you can explore a lot of different data sets for a lot of different tasks so for example again let's go to um text to image and I have these different data sets that I can use here um and you can also look at the data set card having the information describing the features I can look at the data set in the viewer in the hugging face viewer um to explore them in my browser here as you can see uh so I can also load data sets using the data sets package here directly here I think there's an import missing import torch uh and we also want this to run on Cuda so on my GPU and uh we want to generate some audio based on a text so let's go and say subscribe to neural 9 run this and then this is going to take the text turn it into a sound file which we can hopefully play um subscribe to nural 9 subscribe to nurl 9 there you go it works so this is how easily you can just specify models use them and then you can build your whole application around them you can just say Okay I want to have now a textas speech uh model in my application I just have to use this code and I have it I can always do the same or I want to have stable diffusion ready or I want to have the uh text summarization or anything else that you can find on the model uh page here on the models page here now another part of hugging face which is kind of cool is the spaces where you can use models in the browser so you don't need to deploy them locally you can just use them in the cloud for example I can go and say stable to find stable diffusion 3 medium and then I can just use this web application here which is not running on my system it's running actually um on the cloud so it's running on hugging face I don't need to have have a GPU for that and I can play around with a model to to see how well it works so I can say again something like astronaut on the moon which is not exactly the same as before because we had I think astronaut uh oh actually I misspelled that astronaut um riding a horse on Mars was was the prompt but let's see what happens now we should hopefully get some decent image even though I misspelled it and I think I still have the same prompt that was misspelled but there you go astronaut on Aon that that's actually very this is actually very impressive so let's see if we can get something more uh specific let's go with um let's go with something like python snake coding on a laptop in Jungle now I don't know if this is going to just generate python code or if it's actually going to generate a snake in the jungle coding on a laptop but the accuracy the quality of the images is kind of impressive so let's see okay no this is not exactly what I wanted but yeah you can see it uh you can play around with the model here directly you can also go with different models so maybe we have something like I don't know if we have llama here uh yeah we have a llama 370 billion parameter chatbot so I can say hello what is hogging face and you can see we can use these different models without having to deploy them without using our own GPU you can play around with all the different stuff that you can find here in the browser directly then you can go to the models download it uh use it in your application and you can train on these various data sets so to summarize it hugging face is basically a central Hub a landing page a community for AI machine learning very comparable to GitHub just with a focus not on General code basis but on AI related stuff so that's it for today's video I hope you enjoyed it and I hope you learned something if so let me know by hitting a like button and leaving a comment in the comment section down below and of course don't forget to subscribe to this Channel and hit the notification Bell to not miss a single future video for free other than that thank you much for watching see you in the next video and bye

Original Description

In this video we learn about Hugging Face and why it is relevant for machine learning engineers. ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾ 📚 Programming Books & Merch 📚 🐍 The Python Bible Book: https://www.neuralnine.com/books/ 💻 The Algorithm Bible Book: https://www.neuralnine.com/books/ 👕 Programming Merch: https://www.neuralnine.com/shop 💼 Services 💼 💻 Freelancing & Tutoring: https://www.neuralnine.com/services 🌐 Social Media & Contact 🌐 📱 Website: https://www.neuralnine.com/ 📷 Instagram: https://www.instagram.com/neuralnine 🐦 Twitter: https://twitter.com/neuralnine 🤵 LinkedIn: https://www.linkedin.com/company/neuralnine/ 📁 GitHub: https://github.com/NeuralNine 🎙 Discord: https://discord.gg/JU4xr8U3dm
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from NeuralNine · NeuralNine · 0 of 60

← Previous Next →
1 Visualizing Stock Data With Candlestick Charts in Python
Visualizing Stock Data With Candlestick Charts in Python
NeuralNine
2 Python Beginner Tutorial #1 - Installation and First Program
Python Beginner Tutorial #1 - Installation and First Program
NeuralNine
3 Python Beginner Tutorial #2 - Variables and Data Types
Python Beginner Tutorial #2 - Variables and Data Types
NeuralNine
4 Python Beginner Tutorial #3 - Operators and User Input
Python Beginner Tutorial #3 - Operators and User Input
NeuralNine
5 Python Beginner Tutorial #4 - If Statements and Conditions
Python Beginner Tutorial #4 - If Statements and Conditions
NeuralNine
6 Python Beginner Tutorial #5 - Loops
Python Beginner Tutorial #5 - Loops
NeuralNine
7 Python Beginner Tutorial #6 - Sequences and Collections
Python Beginner Tutorial #6 - Sequences and Collections
NeuralNine
8 Python Beginner Tutorial #7 - Functions
Python Beginner Tutorial #7 - Functions
NeuralNine
9 Python Beginner Tutorial #8 - Exception Handling
Python Beginner Tutorial #8 - Exception Handling
NeuralNine
10 Python Beginner Tutorial #9 - File Operations
Python Beginner Tutorial #9 - File Operations
NeuralNine
11 Python Beginner Tutorial #10 - String Functions
Python Beginner Tutorial #10 - String Functions
NeuralNine
12 Python Intermediate Tutorial #1 - Classes and Objects
Python Intermediate Tutorial #1 - Classes and Objects
NeuralNine
13 Python Intermediate Tutorial #2 - Inheritance
Python Intermediate Tutorial #2 - Inheritance
NeuralNine
14 Python Intermediate Tutorial #3 - Multithreading
Python Intermediate Tutorial #3 - Multithreading
NeuralNine
15 Python Intermediate Tutorial #4 - Synchronizing Threads
Python Intermediate Tutorial #4 - Synchronizing Threads
NeuralNine
16 Python Intermediate Tutorial #5 - Events and Daemon Threads
Python Intermediate Tutorial #5 - Events and Daemon Threads
NeuralNine
17 Python Intermediate Tutorial #6 - Queues
Python Intermediate Tutorial #6 - Queues
NeuralNine
18 Python Intermediate Tutorial #7 - Sockets and Network Programming
Python Intermediate Tutorial #7 - Sockets and Network Programming
NeuralNine
19 Python Intermediate Tutorial #8 - Database Programming
Python Intermediate Tutorial #8 - Database Programming
NeuralNine
20 Python Intermediate Tutorial #9 - Recursion
Python Intermediate Tutorial #9 - Recursion
NeuralNine
21 Python Intermediate Tutorial #10 - XML Processing
Python Intermediate Tutorial #10 - XML Processing
NeuralNine
22 Python Intermediate Tutorial #11 - Logging
Python Intermediate Tutorial #11 - Logging
NeuralNine
23 Python Data Science Tutorial #1 - Anaconda and PyCharm Setup
Python Data Science Tutorial #1 - Anaconda and PyCharm Setup
NeuralNine
24 Python Data Science Tutorial #2 - NumPy Arrays
Python Data Science Tutorial #2 - NumPy Arrays
NeuralNine
25 Python Data Science Tutorial #3 - Numpy Functions
Python Data Science Tutorial #3 - Numpy Functions
NeuralNine
26 Python Data Science Tutorial #4 - Plotting Functions With Matplotlib
Python Data Science Tutorial #4 - Plotting Functions With Matplotlib
NeuralNine
27 Python Data Science Tutorial #5 - Subplots and Multiple Windows
Python Data Science Tutorial #5 - Subplots and Multiple Windows
NeuralNine
28 Python Data Science Tutorial #6 - Matplotlib Styling
Python Data Science Tutorial #6 - Matplotlib Styling
NeuralNine
29 Python Data Science Tutorial #7 - Bar Charts with Matplotlib
Python Data Science Tutorial #7 - Bar Charts with Matplotlib
NeuralNine
30 Python Data Science Tutorial #8 - Pie Charts with Matplotlib
Python Data Science Tutorial #8 - Pie Charts with Matplotlib
NeuralNine
31 Python Data Science Tutorial #9 - Plotting Histograms with Matplotlib
Python Data Science Tutorial #9 - Plotting Histograms with Matplotlib
NeuralNine
32 Python Data Science Tutorial #10 - Scatter Plots with Matplotlib
Python Data Science Tutorial #10 - Scatter Plots with Matplotlib
NeuralNine
33 Python Data Science Tutorial #11 - 3D Plotting with Matplotlib
Python Data Science Tutorial #11 - 3D Plotting with Matplotlib
NeuralNine
34 Python Data Science Tutorial #12 - Pandas Series
Python Data Science Tutorial #12 - Pandas Series
NeuralNine
35 Python Data Science Tutorial #13 - Pandas Data Frames
Python Data Science Tutorial #13 - Pandas Data Frames
NeuralNine
36 Python Data Science Tutorial #14 - Pandas Statistics
Python Data Science Tutorial #14 - Pandas Statistics
NeuralNine
37 Python Data Science Tutorial #15 - Pandas Sorting and Functions
Python Data Science Tutorial #15 - Pandas Sorting and Functions
NeuralNine
38 Python Data Science Tutorial #16 - Pandas Merging Data Frames
Python Data Science Tutorial #16 - Pandas Merging Data Frames
NeuralNine
39 Python Data Science Tutorial #17 - Pandas Queries
Python Data Science Tutorial #17 - Pandas Queries
NeuralNine
40 Python Machine Learning Tutorial #1 - What is Machine Learning?
Python Machine Learning Tutorial #1 - What is Machine Learning?
NeuralNine
41 Python Machine Learning Tutorial #2 - Linear Regression
Python Machine Learning Tutorial #2 - Linear Regression
NeuralNine
42 Python Machine Learning Tutorial #3 - K-Nearest Neighbors Classification
Python Machine Learning Tutorial #3 - K-Nearest Neighbors Classification
NeuralNine
43 Python Machine Learning #4 - Support Vector Machines
Python Machine Learning #4 - Support Vector Machines
NeuralNine
44 Python Machine Learning Tutorial #5 - Decision Trees and Random Forest Classification
Python Machine Learning Tutorial #5 - Decision Trees and Random Forest Classification
NeuralNine
45 Python Machine Learning Tutorial #6 - K-Means Clustering
Python Machine Learning Tutorial #6 - K-Means Clustering
NeuralNine
46 Python Machine Learning Tutorial #7 - Neural Networks
Python Machine Learning Tutorial #7 - Neural Networks
NeuralNine
47 Python Machine Learning Tutorial #8 - Handwritten Digit Recognition with Tensorflow
Python Machine Learning Tutorial #8 - Handwritten Digit Recognition with Tensorflow
NeuralNine
48 Generating Poetic Texts with Recurrent Neural Networks in Python
Generating Poetic Texts with Recurrent Neural Networks in Python
NeuralNine
49 Stock Portfolio Visualization with Matplotlib in Python
Stock Portfolio Visualization with Matplotlib in Python
NeuralNine
50 Analyzing Coronavirus with Python (COVID-19)
Analyzing Coronavirus with Python (COVID-19)
NeuralNine
51 Making Text Images Readable Again with Python and OpenCV
Making Text Images Readable Again with Python and OpenCV
NeuralNine
52 Neural Networks Simply Explained (Theory)
Neural Networks Simply Explained (Theory)
NeuralNine
53 Motion Filtering with OpenCV in Python
Motion Filtering with OpenCV in Python
NeuralNine
54 Top 5 Programming Languages To Learn in 2020
Top 5 Programming Languages To Learn in 2020
NeuralNine
55 Simple TCP Chat Room in Python
Simple TCP Chat Room in Python
NeuralNine
56 Image Classification with Neural Networks in Python
Image Classification with Neural Networks in Python
NeuralNine
57 Edge Detection with OpenCV in Python
Edge Detection with OpenCV in Python
NeuralNine
58 S&P 500 Web Scraping with Python
S&P 500 Web Scraping with Python
NeuralNine
59 Simple Sentiment Text Analysis in Python
Simple Sentiment Text Analysis in Python
NeuralNine
60 Introduction - Algorithms & Data Structures #1
Introduction - Algorithms & Data Structures #1
NeuralNine

This video introduces Hugging Face, a platform for machine learning model sharing, dataset sharing, and community collaboration, and explains its importance for ML engineers.

Key Takeaways
  1. Explore Hugging Face Hub
  2. Create an account on Hugging Face
  3. Search and use pre-trained models
  4. Share and deploy ML models
💡 Hugging Face provides a comprehensive platform for ML engineers to share, deploy, and collaborate on machine learning models and datasets.

Related Reads

📰
Same Time Last Year, development was so different. This is what 10 years of programming taught me.
A developer reflects on 10 years of programming experience and shares key takeaways on how the field has evolved
Dev.to · SSK
📰
The best config in your bake-off didn't win. Selection did.
Learn how selection bias affects model evaluation and why the best config in your bake-off didn't win
Dev.to · Alexey Spinov
📰
Your AI query did not change. The Postgres plan did.
Learn how Postgres plan changes can impact AI query performance without altering the SQL query itself
Dev.to · Mads Hansen
📰
Python's Object Model in Depth: Why Two Lines That Look the Same Behave Differently
Understand Python's object model to explain differing behavior of two similar lines of code
Dev.to · Ameer Abdullah
Up next
The Adam Optimizer is Just Momentum + RMSProp
DataMListic
Watch →