The Hugging Face Transformers Library | Example Code + Chatbot UI with Gradio

  Рет қаралды 40,826

Shaw Talebi

Shaw Talebi

Күн бұрын

This is the 3rd video in a series on using large language models (LLMs) in practice. Here, I give a beginner-friendly guide to the Hugging Face Transformers library, which provides an easy and cost-free way to work with various open-source language models.
Series Playlist: • Large Language Models ...
📰 Read more: towardsdatascience.com/cracki...
💻 Example code: github.com/ShawhinT/KZfaq-B...
More resources
pipeline() doc: huggingface.co/docs/transform...
pip installation: huggingface.co/docs/transform...
Vanilla Chatbot demo: huggingface.co/spaces/shawhin...
--
Book a call: calendly.com/shawhintalebi
Homepage: shawhintalebi.com/
Socials
/ shawhin
/ shawhintalebi
/ shawhint
/ shawhintalebi
The Data Entrepreneurs
🎥 KZfaq: / @thedataentrepreneurs
👉 Discord: / discord
📰 Medium: / the-data
📅 Events: lu.ma/tde
🗞️ Newsletter: the-data-entrepreneurs.ck.pag...
Support ❤️
www.buymeacoffee.com/shawhint
Intro - 0:00
What is Hugging Face? - 1:05
🤗Transformers - 2:05
Models - 4:40
Installation - 8:24
Sentiment Analysis - 9:49
Summarization - 11:48
Conversational - 13:04
Chatbot UI with Gradio - 14:42
Web app with Spaces - 17:38
What's next? - 20:46

Пікірлер: 76
@ShawhinTalebi
@ShawhinTalebi 11 ай бұрын
More in this series 👇 - Introduction: kzfaq.info/get/bejne/qqx4mLiEr6e9knk.html
 - OpenAI API Intro: kzfaq.info/get/bejne/meCmicyTp5jQgnU.html 📰Blog link: towardsdatascience.com/cracking-open-the-hugging-face-transformers-library-350aa0ef0161?sk=225a4171af141daeb3869dcf614201dd 💻Example code: github.com/ShawhinT/KZfaq-Blog/tree/main/LLMs/hugging-face More resources pipeline() doc: huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline.task pip installation: huggingface.co/docs/transformers/installation Vanilla Chatbot demo: huggingface.co/spaces/shawhin/vanilla-chatbot
@user-xj1pr3pn1p
@user-xj1pr3pn1p 3 ай бұрын
I think your video about LLM is the best one in the youtube, thanks very much!!!
@helrod6131
@helrod6131 8 ай бұрын
Appreciate you walking through this in an easy-to-understand style.
@ShawhinTalebi
@ShawhinTalebi 8 ай бұрын
Happy to help! I’m glad it was clear 😁
@Hys-01
@Hys-01 Ай бұрын
so much more helpful than every other tutorial on youtube! Straight to the point, very relevant and quick. Thanks so much!
@jmitterhofer
@jmitterhofer 6 ай бұрын
Great work Shaw!!!
@ShawhinTalebi
@ShawhinTalebi 6 ай бұрын
Thanks! :)
@muhammadroshanmughees1586
@muhammadroshanmughees1586 8 ай бұрын
I didn't know of the huggingface spaces. It is amazing. Thank you for this
@ShawhinTalebi
@ShawhinTalebi 8 ай бұрын
You’re welcome, I’m glad it was helpful :)
@jakewastaken
@jakewastaken 3 ай бұрын
I’ve been living under a rock and just learned about both Hugging Face and Jupyter. Consider my mind blown 😂
@GBangalore
@GBangalore 6 ай бұрын
Great introduction. Thanks for putting this together.
@mohammadalibazyar5079
@mohammadalibazyar5079 4 ай бұрын
Thanks for compiling the stuff....amazing!
@ShawhinTalebi
@ShawhinTalebi 4 ай бұрын
Happy to help!
@ifycadeau
@ifycadeau 11 ай бұрын
Great video as usual! SO helpful 🙌🏾
@ShawhinTalebi
@ShawhinTalebi 11 ай бұрын
Thanks, glad it was helpful!
@user-ms3nf6tv6h
@user-ms3nf6tv6h 8 ай бұрын
Thank you Shawhin for this really helpful and informative video.
@ShawhinTalebi
@ShawhinTalebi 8 ай бұрын
Thanks! Glad it helped :)
@user-vw1or7qt9w
@user-vw1or7qt9w 28 күн бұрын
It's very helpful, Thanks for making this video Shaw!.
@jakewastaken
@jakewastaken 3 ай бұрын
Thanks for this fantastic playlist.
@matthcw8745
@matthcw8745 7 ай бұрын
Extremely useful, I haven't used hugging face, so this is useful!
@ShawhinTalebi
@ShawhinTalebi 7 ай бұрын
Glad it was helpful!
@spotnuru83
@spotnuru83 6 ай бұрын
Really useful for beginners like me, thank you for this
@ShawhinTalebi
@ShawhinTalebi 6 ай бұрын
Glad it was helpful :)
@zahrahameed4098
@zahrahameed4098 3 ай бұрын
Your teaching method is exceptional, providing a balanced blend of theory and practical implementation. I would greatly appreciate it if you could create a video tutorial on training InsightFace using a custom dataset. I'm undertaking my thesis on this topic but struggling to find adequate instructional resources.
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
Thanks for the suggestion. I added it to my list :)
@jobarmure6169
@jobarmure6169 Ай бұрын
thx, I love how it was simple and helpful
@vipulbawankar3980
@vipulbawankar3980 6 ай бұрын
Really great content!!
@ShawhinTalebi
@ShawhinTalebi 6 ай бұрын
Glad you enjoyed it :)
@alemayehudendir3890
@alemayehudendir3890 5 ай бұрын
Amazing! Thank you so much.
@ShawhinTalebi
@ShawhinTalebi 5 ай бұрын
Happy to help!
@KumR
@KumR 7 ай бұрын
Great Intro Shaw
@ShawhinTalebi
@ShawhinTalebi 7 ай бұрын
Thanks, glad it helped!
@lalpremi
@lalpremi 4 ай бұрын
Thank you for sharing, have a great day :-)
@fuad471
@fuad471 Ай бұрын
nice informative and practical video I learned a lot keep sharing nice videos please
@hanimahdi7244
@hanimahdi7244 6 ай бұрын
Great video, Thank you!
@ShawhinTalebi
@ShawhinTalebi 6 ай бұрын
Happy to help!
@60pluscrazy
@60pluscrazy 8 ай бұрын
Thanks, excellent 👍
@sathvikmalgikar2842
@sathvikmalgikar2842 27 күн бұрын
Thanks !
@servelotfi
@servelotfi 24 күн бұрын
عالی بود thanks alot
@AniHunsaker
@AniHunsaker 2 ай бұрын
This is so helpful! can you record a video guiding us how data scientists can work in Transformers library if they work with low-resource languages?
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
Thanks for the suggestion! What's an example of a low-resource language?
@Techbro-ho3pp
@Techbro-ho3pp 6 ай бұрын
Thank you for pulling all actionable code in one place and the appropriate amount of technical details. Many of YT videos lab notebooks are stale considering version changes in library. Yours is the first one that worked! In a span of 12 mins, I could complete two of your exercise. While trying the chatbot example, when I import gradio in colab, it causes import of PyTorch and memory spikes and sometimes colab free vm collapses. BTW I want to implement a RAG example to query my pdf with tables. Since my laptop is under resources, was looking for some links or videos on how to push a RAG app to H.F. Would appreciate if you point me to one if you have it, or a better link.
@ShawhinTalebi
@ShawhinTalebi 6 ай бұрын
Great to hear! I'm not a Collab user so not sure what's going on with that Gradio import. I found this video helpful on RAG with docs: kzfaq.info/get/bejne/jbJniZx7ut-Wo3k.html
@Techbro-ho3pp
@Techbro-ho3pp 5 ай бұрын
Thank you Shaw! Do you host or attend live AI related meetups in Dallas area? @@ShawhinTalebi
@ShawhinTalebi
@ShawhinTalebi 5 ай бұрын
Yes, I host at least 1 meet-up a quarter via The Data Entrepreneurs community Events: lu.ma/tde
@emanuelokoth1973
@emanuelokoth1973 9 ай бұрын
This solved me big time, I am working on a client project and this app I'm surprised it's general purpose and answers fitness related questions that is exactly what I'm working on. Big Thanks! Is there a way to fine-tune the model more for my fitness AI?? Big Thanks!
@ShawhinTalebi
@ShawhinTalebi 9 ай бұрын
That’s awesome, glad it helped! I talk about fine-tuning in another video: kzfaq.info/get/bejne/m6lme8dizazan6c.html
@emanuelokoth1973
@emanuelokoth1973 9 ай бұрын
@@ShawhinTalebi cool let me check that out! was actually looking on how to fine tune this, since the first is a bitt simple!
@souravbarua3991
@souravbarua3991 5 ай бұрын
Thank you for sharing. Please make same video using hf api.
@ShawhinTalebi
@ShawhinTalebi 5 ай бұрын
Thanks for the rec! Anything specific you'd like to see?
@souravbarua3991
@souravbarua3991 5 ай бұрын
@@ShawhinTalebi when we are using transformers pipeline, everytime the model 1st downloads and then it works. I want to know is there any way so that we can call the above models with hf api/token?
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
HF's endpoints might help: huggingface.co/inference-endpoints/dedicated
@Deejayy08
@Deejayy08 2 ай бұрын
Great videos.. do you have something similar for AWS bedrock?
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
I do not but that's a great topic for a future video :)
@TheCloudShepherd
@TheCloudShepherd 7 ай бұрын
Where did you get the Conversation class?
@ShawhinTalebi
@ShawhinTalebi 7 ай бұрын
Good question. I forgot to show the imports in the slides, but Conversation() comes from the Transformers library. Here's the full notebook: github.com/ShawhinT/KZfaq-Blog/blob/main/LLMs/hugging-face/hf-sandbox.ipynb
@yumei6607
@yumei6607 Ай бұрын
Very useful information. I cannot clone the git repository. Got error: invalid path 'TDA/persistent_homology/homology_example_Homology-Changes-Predicted-Crash??.png', Could you please take a look?
@ShawhinTalebi
@ShawhinTalebi 26 күн бұрын
I wasn't able to reproduce this error. Note that GitHub doesn't let you clone a part of a repo so you have to download the whole thing: github.com/ShawhinT/KZfaq-Blog.git
@anicole14774
@anicole14774 2 ай бұрын
Hello...When i'm trying out the gradio chat interface with the vanilla_chatbox function, I run an error saying that the conversation variable is not defined. Why is this the case?
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
I believe there was a transformers library update which broke the could shown in the video. But I have an updated version on the GitHub that should work: github.com/ShawhinT/KZfaq-Blog/blob/main/LLMs/hugging-face/hf-sandbox.ipynb
@ncjatin
@ncjatin Ай бұрын
We dont need to create and use HuggingFace tokens to use these models ?
@ShawhinTalebi
@ShawhinTalebi Ай бұрын
Not if you are running these models locally!
@arturoruiz6274
@arturoruiz6274 3 күн бұрын
Conversation module is no longer available for those following these tutorials.
@djentlover
@djentlover Ай бұрын
Anaconda doesn't find all the depencies when I try to create the environment. What should I do?
@ShawhinTalebi
@ShawhinTalebi Ай бұрын
Are you using the .yml file from the GitHub repo? If that's not working, you can try making a fresh env and installing transformers following this guide: huggingface.co/docs/transformers/en/installation#install-with-conda
@djentlover
@djentlover Ай бұрын
@@ShawhinTalebi Yes I used your GitHub link and your yml file. Using a M1 mac. Thank you. I will try that.
@forheuristiclifeksh7836
@forheuristiclifeksh7836 8 ай бұрын
6:41
@amparoconsuelo9451
@amparoconsuelo9451 7 ай бұрын
Please display the full code and mention the Python version and system configuration, folders, files, etc.
@ShawhinTalebi
@ShawhinTalebi 7 ай бұрын
Code and env files are available here: github.com/ShawhinT/KZfaq-Blog/tree/main/LLMs/hugging-face
@himanshupatidar8040
@himanshupatidar8040 5 ай бұрын
it seems vanilla chat-bot is showing error as of current date.
@ShawhinTalebi
@ShawhinTalebi 5 ай бұрын
Thanks for pointing that out! It seems like hugging face updated the lib. I fixed the code on the GitHub repo.
@friedrichdergroe9664
@friedrichdergroe9664 3 ай бұрын
The sentiment analysis is strange. I put in: "It is fun to hurt people" and it came back with a .99 POSITIVE. I guess it has no clue about morality and values. Also, I have not used Python in a while, and I suppose it has trouble dealing with dependencies, because I had to install tensorflow and tf-keras separately. But it works.
@ShawhinTalebi
@ShawhinTalebi 3 ай бұрын
Thanks for raising this, it's a super important point. While I suspect larger and more recent models will handle that example better, accounting for these edge cases is a major challenge when working with language models.
Prompt Engineering: How to Trick AI into Solving Your Problems
29:58
Fine-tuning Large Language Models (LLMs) | w/ Example Code
28:18
Shaw Talebi
Рет қаралды 269 М.
100❤️
00:19
MY💝No War🤝
Рет қаралды 17 МЛН
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
HuggingFace Crash Course - Sentiment Analysis, Model Hub, Fine Tuning
38:12
How to access LLMs from hugging face? (Practical Demo)
7:02
AI Researcher
Рет қаралды 1,5 М.
I Was Wrong About AI Consulting (what I learned)
9:56
Shaw Talebi
Рет қаралды 7 М.
How to Build an LLM from Scratch | An Overview
35:45
Shaw Talebi
Рет қаралды 203 М.
The OpenAI (Python) API | Introduction & Example Code
23:46
Shaw Talebi
Рет қаралды 24 М.
A Practical Introduction to Large Language Models (LLMs)
14:57
Shaw Talebi
Рет қаралды 46 М.
Run your own AI (but private)
22:13
NetworkChuck
Рет қаралды 1,2 МЛН
100❤️
00:19
MY💝No War🤝
Рет қаралды 17 МЛН