Chapter 4 live sessions with Omar
Key Takeaways
This video covers the Hugging Face Model Hub, including model hosting, sharing, and inference, as well as fine-tuning and deploying models using the Push-to-Hub API and hosted inference API.
Full Transcript
all right i think we can get started eh so as always welcome everyone if you have any questions you can ask in the chat uh lewis will will be there helping me so this is the fourth and last chapter of the course uh this is a bit different to the previous three in this one we'll show you a bit more of how to use the platform and how to leverage all of the hog in phase features so this is the quick agenda for today first we'll see a bit about the platform then we'll show you how to use existing pre-trained models then how to push models to the hub both with the push-to-hop method and the hook in phase a client command line interface i then will talk a bit about model cards and to close we'll show you like some bonus content that is not part of the of the core of the course so yeah so the hub and the cognitive help you've already used it a bit on the previous chapters it's the central platform that enables anyone to discover use and contribute new state-of-the-art models and datasets it costs a wide variety of models so it had more than ten thousand public available models we can check right now how many it has so right now it has 11 000 publicly available models for anyone to use so the hub has support for both models and datasets in this chapter we focus completely on the model side of the hub so the models in the hub are not limited to hog and phase transformers and it's not even limited to natural language processing there are modern models from flare and an alien nlp for nlp for speech there is asteroid and pi node and there is also theme for vision this is just to name a few so if you want to see all of the supported models in the hub so this is hogginface.com you can go to resources and here you can go to model health doc and at the left you can look at libraries and here we have the full list of supported libraries and how well supported they are depending on the different features so there is holding phase transformers but there's also adapter transformers alien nlp asteroid esp net flare by node sentence transformation transformers spacey tensorflow tts and tim so each of these models is hosted as a kit repository so if you used github before this will be very straightforward to you ensuring a model on the hub means opening it up to all the community it makes the model accessible to anyone looking to easily use it in turn it will eliminate their need to turn the model on their own and it will simplify sharing and using the model additionally the hub also has something called the inference api so in the moment you upload a model to the hub there will be an automatically deployed hosted inference api that allows you or anyone else in the community to try out the model directly on the website so the video will show you a bit more of this but just so you have an idea of what i'm talking about i think we already did a bit of this in the first chapter but if you open a repository here at the right you have a hosted in friends api so you can try this query and if you click compute this is a field mask model it will predict what word should go there so the goal of life is life okay so that wasn't great but you get the idea and it's not limited to field masks actually there are like a a lot of other tasks so okay i will show you the first video of this chapter but please feel free to ask anything in the chat if you have any questions in this video we're going to go over the hogging face model hub navigation this is the huggingface.co landing page to access the model hub click on the models tab in the upper right corner should be facing this web interface which can be split into several parts on the left you'll find categories which you can use to tailor your model search the first category is the tasks models on the hub may be used for a wide variety of tasks these include natural language processing tasks such as question answering or text classification but it isn't only limited to an lp other tasks from other fields are also available such as image classification for computer vision or automatic speech recognition for speech the second category is the libraries models on the hub usually share one of three backbones pie torch tensorflow or jacks however other backbones such as rust or onyx also exist finally this tab can also be used to specify from which high-level framework the model comes this includes transformers but it isn't limited to it the model hobby is used to host a lot of different frameworks models and we are actively looking to host other frameworks models the third category is the datasets tab selecting a dataset from this tab means filtering the modules so that they were trained on that specific data set the fourth category is the languages tab selecting a language from this tab means filtering the models so that they handle the language selected finally the last category allows to choose the license with which the model is shared on the right you'll find the models available on the model hub the models are ordered by downloads by default when clicking on a model you should be facing its model card the model card contains information about the model its description intended use limitations and biases it can also show code snippets on how to use the model as well as any relevant information training procedure data processing evaluation results or copyrights this information is crucial for the model to be used the better crafted a model card is the easier it will be for other users to leverage your model and their applications on the right of the model card is the inference api this inference api can be used to play with the model directly feel free to modify the text and click on compute to see how would the model behave to your inputs at the top of your screen lies the model tags these include the model task as well as any other tag that is relevant to the categories we have just seen the files and versions tab displays the architecture of the repository of that model here we can see all the files that define this model you'll see all usual features of a get repository the branches available the commit history as well as the commit diff three different buttons are available at the top of the model card the first one shows how to use the inference api programmatically the second one shows how to train this model in sagemaker and the last one shows how to load that model within the appropriate library for bert this is transformers okay so i think that was quite straightforward maybe let me just briefly expand a bit on some points so the ui change a bit but if you click now deploy accelerated in france you get this code snippet so you can make a request in in python but this is not limited to python this is like a normal api call so you can use javascript or whatever language you use then here at the right if you click using transformers you get this cool snippet that you can use but as we discussed before this is not limited to transformers so if you go to the models page and at the left you can click here the plus 19 and here you can see all of the supported libraries so for example if we go to sentence transformers that will filter out all of the sentence transformers and here the code snippet will change so for example here the code snippet is specifically for this library so that makes it very nice like a very nice integration with other libraries and if you click here compute this inference if this widget is for sentence similarity so you get a source sentence and then destinations or sentences and you will get the distance between the source sentence and each of the others so how similar these are so uh for this model the closest thing to that is a happy person is that is a very happy person so that makes sense so there is a question can we use a keyword based search to search for models for a particular task so if you are interested on a particular task you can go to models and you can then click text generation for example and then here you can do like additional search so for example gpt you can also have like additional filters so for library data sets languages but we are improving the search functionality now so just stay tuned and there will be like a nicer features for discoverability of the models good question though okay so this was how to use the how to navigate the hub let's quickly discuss something that you will probably be already familiar since you did this in the first and second chapters so let's say that we are interested in a french based model that can perform mask filling so yeah let me remove this so we set fill mask and you want french so we can use this one canvas base normally what you should do is read the description and the model card to understand what this model is about and what's the purpose and if it has any biases any limitations we'll talk a bit more about this in few minutes okay so there are like three different ways of using the model so the first one is like we did in the first chapter so we use the pipeline so this like this super high level function so from transformers import pipeline just specify what's the task that we are solving which is field mask and we specify the name a gun member base and as you can see here we get a prediction you can also use the specific model architecture to load the model this is similar to what you did in the second chapter so this is a gaming bird model it has the cumin bird architecture so you can import commemorator organizer and the camembert for masked language model and you can do this a language showed you in one of the previous sessions if you go to github transformer source transformers models you can see all of the architectures that are implemented in the transformers library and as you can see there are quite a bit so what is normally suggested is to use the auto tokenizer and auto model like the auto classes because these are architectural agnostic and then you don't need to worry about yeah about what's the specific architecture so let me just briefly step back to the pipeline which i think is something important is that you need to make sure that the model you're using the checkpoint you're using is for this task so let's say that you want to use instead text classification the model was not trained for this so of course this will not make any sense so it will give you an output but it will complain it will say that you probably need to train the model on a downstream task as you did in chapter three and yeah the prediction is pretty much meaningless here okay so this was nothing new but i think that what will be more interesting is the next next section which is how to share pre-trained models so these are like the last two videos of the first part of the course so the first one will show you how to manage a repo and how to upload files with a command line interface and the second video will show you how to use the push to have a methods so there are like three different ways of doing things so one is the web interface one is using the transformers or calling phase hub a command line interface and the third option is the push to hub api so let's jump to the video and remember to ask any questions in the chat in this video we're going to understand how to manage a model repository on the hogging face model hub in order to handle a repository you should first have a hugging face account aiding to create a new account is available in the description once you're logged in you can create a new repository by clicking on the new model option you should be facing a similar model to the following in the owner input you can put either your own namespace or any of your organization's namespaces the model name is the model identifier that will then be used to identify your model on the chosen namespace and the final choice is between public and private public models are accessible by anyone this is the recommended free option as this makes your model easily accessible and shareable the owners of your namespace are the only ones who can update and change your model a more advanced option is the private option in this case only the owners of your namespace will have visibility over your model other users won't know it exists and will not be able to use it let's create a dummy model to play with once your model is created comes the management of that model three tabs are available to you you're facing the first one which is the model card page this is the page you used to showcase your model to the world we'll see how it can be completed in a bit the second one is the files and versions your model itself is a git repository if you're unaware of what is a git repository you can think of it as a folder containing files which can be versioned if you have never used git before we recommend looking at an introduction like the one provided in this video's description the git repository allows you to see the changes happening over time in this folder hence the term versions we'll see how to add files and versions in a bit the final tab is the settings tab which allow you to manage your model's visibility and availability let's first start by adding files to the repository files can be added through the web interface thanks to the add file button the added files can be of any type python json text you name it alongside your adult file and its content you should name your change or comment generally adding files is simpler when using the command line we'll showcase how to do this using git in addition to git we're using git lfs which stands for git large file storage in order to manage large model files first i make sure that both git and git lfs are correctly installed on my system links to install git and git lfs are provided in the video description then we can get to work by cloning the repository locally we have a repository with a single file the file that we have just added to the repository using the web interface we can edit it to see the contents of this file and update these it turns out i have a model handy that can be used for sentiment analysis i'll simply copy over the contents to this folder this includes the model weights configuration file and tokenizer to the repository i can then track these files with the git add command then i commit the changes i'm giving this commit the title of add model weights and configuration finally i can push the new commit to the huggingface.co remote when going back to the files and versions tab on the web interface we can now see the newly added commit with the updated files we have seen two ways of adding files to a repository here a third way is explored in the video about the push to hub api a link to this video is in the description unfortunately the front page of our model is still very empty let's add a readme markdown file to complete it a little bit this readme is known as the model card and it's arguably as important as the model and tokenizer files in a model repository it is the central definition of the model ensuring reusability by fellow community members and reproducibility of results and providing a platform on which other members may build their own artifacts we'll only add a title and a small description here for simplicity's sake but we encourage you to add information relevant to how was the model train its intended uses and limitations as well as its identified and potential biases evaluation results and code samples on how should your model be used great for contributing a model to the model hub this model can now be used in downstream libraries simply by specifying your model identifier ok feel free to ask any questions in the chat item homes you asked so talk can suddenly come into play if we are working with organizations i guess you are referring to the authentication token so normally when you log in in your computer to hog interface with a cognitive command line interface every user has a token that is saved locally and then in the server when you push files the back end make sure that you have access a specific file so if you are a member of an organization and you push a model or you create a repo or delete a repo in an organization you will always need to your token will will be part of the request but this is for any request because we need to know like which is the user making the request let me know if that wasn't a very clear explanation or if you were referring to another token and not the authentication token okay so let me just show you the the last video and then we will do some coding if that sounds good and in the meantime feel free to ask any questions in the chat let's have a look at the push-to-api just before recording this video i function the best module onto the glue mr pc data set we won't go over the fine tuning code here because you can find it in any transformers tutorial or by looking at the videos linked below what interests us here is what happens when the training is finished and we've got metrics we're happy about this video requires you to one sign up for an account under the acmephase.com website and two have your authentication token to that website stored which can easily be done by typing face cli login into a terminal or like this in a collab notebook by using an exclamation mark this command won't work if you're using a regular jupyter notebook so if you are using that and don't have access to a terminal you'll need to copy your access token from the urgingface.co website into the training arguments i'll show you where exactly in a little bit with that done the push web api will allow us to upload to the input server model its configuration and the associated tokenizer to use it inside the trainer you have to make sure to set push to web equal to inside the training argument we can specify a model id for repository which will default to the name of the output tier if we don't say anything we can push to an organization as long as we're a member of that organization and this is where your organization should be pasted if you need to revolve is done we can call trainer.push2 once the training is finished in future developments we'll add the ability to automatically push to the up at the end of each epoch or every given number of steps so stay tuned the command returns a url for a specific commit which we'll be able to inspect if we copy it in our browser just before checking that note that if you are not using the trainer api you can directly push your model and your tokenizer to the by using the push to have method by passing the commuter role in my browser i can access my repository called findtruth.mrpc as expected and see that several files have been added a modal card the configuration of the model the model weights the transfer boundaries and all the files required by the tokenizer the trainer drafted a model card for us which contained the final results on the evaluation set the training upper parameters the intermediate training results as well as the frameworks i was using if i click edit model guard to see the raw content i can see the trainer also generated a table of metadata that the urging phase co website is going to use to properly apply filters to my model i can also directly access the transfer board runs inside the model hub by clicking training metrics here now that the model is on the heap we can use it from anywhere with the from.train method we just have to use the identifier from the hub and we can see that the model configuration on weights are automatically downloaded we can use this model as we would any transformers model for instance by loading it in a pipeline since the mrpc dataset is data set of pairs of sentences where the task is to determine if two sentences are paraphrases of one another or not we use it on two sentences separated by sep it's a little bit disappointing to see that it's predicting label 0. that's because i didn't specify any label when i created the modal configuration fixing this is super easy with the push-to-api first we can fix the configuration locally by setting label to id an id to label with a proper value then we can push the fixed config to our repo with the push to a method once again this returns the url of a commit which we could inspect and see the exact diff inside the config and note that the command is going super flat because i'm using the same local folder as before which on which my repo is already cloned once this is done and we create a new pipeline we can see the new configuration is automatically downloaded thanks to the built-in personaling system and we get the new label we can also play with the model directly on its model card by passing the text i was using and clicking compute i just have to wait a little bit of time before the model is loaded on the inference api and displays the result when the module is loaded we can double check we get the same results as before directly on the widget try the push to a bpa on your models today all right uh yeah going back to the question from iam holmes about the authentication token and now that i saw this example i think that i understood a bit more where your question came from so normally when you do hog interface uh click login your authentication token will be stored in the cache and then you will you won't need to do it ever again but for example if you're working in collab or yeah i don't know in an environment in which maybe you don't want to do login instead you can specify enforce a specific authentication token and that's the use case of the auth token param okay so let's do some coding so you will need to do your configuration in git if you are yeah your normal git configuration i already did login before oh so have a typo here who i am sorry it's who am i yeah there we go so i already did login before starting this session so my username is hackardtech so i showed you a few examples so the nice thing about the push-to-have api is that everything including phase in transformers has this method so models tokenizers yeah you name it so if you do this first three lines it will push the model file and it will push the tokenizer file what is very nice is that if you use the trainer api okay now i'm getting an error so let me just quickly hmm okay this is new okay let me try once more in the meantime let me show you an example of a repo uploaded with a trainer api that if you follow the pytorch tutorial in chapter three you are quite familiar so just by specifying push to hub you will get a bunch of very nice things so you will get a description you will get the loss accuracy f1 or other metrics you will get placeholder sections that you can later on complete you will get all of the training hyper parameters that were used during training you will get this nice table with the results during training for every epoch and you will also get the framework versions so this is very useful for reproducibility on top of this there is this very nice feature which is hosted tensorboard in the hub so if you have tensorboard traces in your repository and it's not limited just to hog in phase transformers like it can be like any any tensorboard traces you will get automatically a tensorboard deployed for you and here you will be able to look at the metrics okay uh it seems like i still have problems for some reason sorry so let me instead just do it in the terminal this will be easier [Music] yeah so let's first import what we care about so here we are just initializing a modern tokenizer off with as we've done before so nothing new okay it may take a bit and then like this to just do model dot push to have and then the name of the rep so let me just do it yeah it takes few seconds this command is uploading all of the all of the all of the model for you i'm actually not sure why i got the server because i tried it like 10 minutes before and i was not having this issue repository not found [Music] okay this is taking i think my computer is having a hard time with the live stream at the same time yeah in the meantime like if you also want to specify an organization you can do so and as we were discussing before you can also specify a token if you want okay so another option is using the hogging face yeah i don't know tokenizer push to help okay so the repo was created automatically because it didn't exist let's see if the files they are still being uploaded yeah normally it doesn't take this long i'm not sure if this is my computer or if there's any connection issue right now with hoping face [Music] okay in the meantime while that runs let me show you like the second approach which is using the hogging face clay so if you just hogging basically repo create dummy 2 it normally creates a record for you on the hub yeah so it asks you do you want to create repo hacker tech dummy 2 i say yes and it it gives you both the link to look at it on the browser and it also tells you how to clone it so this similar to what lisand was making in the first video here you can do yeah like the normal things for example you can create a model card which is this normal markdown file so this is a test you can preview it and you can commit and when you commit yeah you get here like this is a test this is what i wrote in the model card you can look at all of the files you can look at the history of the [Music] repository yeah and as you can see here i have this commit 14 seconds ago in which i did this change so it's like very nice because if you are used to github workflows you can use this to create branches for example you can also revert back changes very easily so it has like very nice versioning yeah so yeah okay so going back to the previous one of the tokenizer in which i use tokenizer.push2hub if you go here to files and versions you can see here that the files were uploaded now [Music] yeah so let me just quickly check the history yeah so i think that there was some connection error and as you can see actually both the model and the tokenizer uh were uploaded so that's good so what a the whole interface infrastructure normally does for transformers it is that it analyzes the configuration the configuration specifies a bit like what's the architecture uh yeah these kind of things and based on this it already tells you like this is a field mask model it's a camembert model it's transformers it's using by torch this is all based on the files and the config and you can already use here the hosted inference api you will need to wait especially the first time you need to wait for the model to load on the back end and you can even like if you want to deploy you can use this in in the accelerated inference api and make as many calls you want uh yeah and play around with the model and you can very easily integrate this to your own products okay uh yeah so that was a push to have so okay so we going back to the command line interface which was dummy 2 i think no me too maybe yeah so right now we don't have anything right we only created a the model card so let me know okay let's make computer that is very slow so what we can do now is like a normal github workflow you can do git clone and then the name of the web so now for example i already have the wrapper it just downloaded the readme which is the only file the git attributes is also there but it's a hidden file so you won't see it unless you specify also like the hidden files so as alessandro mentioned in the video apart from git we also use git lfs that is git a large file storage this is super useful for files that are very large which is very common in machine learning so this is for files that are larger than 10 megabytes and normally what we do is that you can specify which extensions you want to handle with lfs so yeah all of this so normally what you need to do is to do git lfs install just to make sure it's initialized and yeah let me show you a nice example so let's say that we want to work with a model locally maybe train it and then instead of using the push to have we want to save it locally and then push so that's what the safe pre-training method is for so let me just put the right name which is to me too let me now just copy paste all of these code snippets so what this is let me just explain line by line why it runs is that it will uh the same thing we load the model we love that organizer then we save the model in the directory domito which is where we clone the repo and we also save the tokenizer but as you can see my computer is having a hard time with the live stream so it's a bit slow sorry for that okay okay so if you look at now dummy 2 you can already see all of the files so let's just enter the repository and if you do get status it's normal git you will get like okay all of these files are to be added they are not they are not tracked right now so if you do get that this will add all of the files to be tracked then you can do get status and you will get a some things another thing you can do is get lfs status this is nice because now you can see which files will be used handled with normal git and which files will be handled by git large file storage this is just a like for additional info it's not something that you need to to worry too much about you will need to worry if you have like a file with a new extension that is very large but it's super easy to just add a new extension so for example you can just change the the git attributes anyways let's commit my first model super easy and then you just will get push this since these are like very large files normally it takes a bit uh [Music] so i'll just keep moving a bit for now and then shoot okay so this was pretty much everything for the sharing pre-trained models section er let me just quickly we already saw how to use the web interface and this is what we just did which one is how to upload a file yeah so as you can see 80 something megabytes that's why it's a bit slow even with a relatively fast connection okay so the last section is a bit uh different it's about how to build a model card so we already saw like few model cards uh just as a recap the model card is this file which is very important it explains the model it ensures that it's reusable by the rest of the community and it provides a platform on which other members can build their artifacts so documenting how the training and the evaluation was done helps others understand what to expect of a model and it will also provide and yes sorry and providing sufficient information regarding the data that was used and the processing and post processing that were done ensures that the limitations biases and context in which the model is not useful can be identified and understood so if you upload a model without anything in the model card no one will use it because they won't know what the model is for instead if you have like a very nice model card explaining what it does how it was trained what's the purpose what are the limitations which are the biases that will be super useful for other people and additionally as we'll see in one minute you can add some special metadata that will make your model discoverable by the rest of the community so as we saw it's just a rhythmic file and if you're more interested on this the model card concept originates from a research direction from google the paper is called model cards for model reporting that's by margaret mitchell so there's a lot of very useful information contained in that paper so we recommend you to take a look at it [Music] there are some sections that we recommend model description intended uses and limitations how to use limitations and bias training data trading procedure and evaluation results so these are not a strict we don't force any specific sections so the model card really has a lot of a lot of flexibility so here there's a paragraph explaining each of these sections i think that you can go over it by yourself but what might be more useful is to just quickly go through quickly go through a very nice model card so this is bird-based cased probably you're already a bit bored of this repo at the time we've seen this quite a quite a bit so it has like few sentences explaining the model where it was introduced eh then it has a description of the model explaining the high level overview of the model how it was trained in which objectives and what was what is what the model learned so for example the model learns an inner representation of the english language that can then be used to extract features useful for downstream tasks so it also has this intended uses and limitations section so yeah it tells you that you can use this for mass language modelling or next sentence prediction but the intention of this model is to be a fine tune on downstream tasks you can also get here like a code snippet although now the how to use section if you're using transformers you can also just click here using transformers and load it from here uh yeah then it shows you how to do it in pi torch and tensorflow a here actually there's a bug here this is for tensorflow it should be just paired model and here it should be df bird model but anyways you get the idea then there's a limitations and bias section which is very useful i think it's super important so let's just read it so even if the training data used for this model could be characterized as fairly neutral this model can have budget predictions and this is very similar to what we did at the end of the first chapter with the pipelines so the man worked as a and the predictions are lawyer waiter god detective doctor and as you can see the woman worked as a nurse waitress mate so as you can see the model has some biases and as it's mentioned here and as we saw before this bias will also affect all fine-tuned versions of this model so it's important that if you pick a model you need to understand the biases because very lightly those biases will probably trans transfer to your own model as well when you do a downstream a sorry when you do fine tuning it also explains what's the training data how the training was done what's the pre-processing pre-training a table of the evaluation results and finally yeah how to cite it the model cards are very flexible just let me quickly show you the metadata so at the top people can add a useful metadata so for example you can specify what's the language what's the license what data sets were used when training the model you can also add as many tags as you want so then people can click here expert and they will find all of the models that have this tag if you would like to learn a bit more about the metadata you can go to resources model hub talk then you can search here we have a couple of sections on metadata but this link in particular has a an example of the model card and what's the structure so which languages you have the license which tags you want to have so for example you can use this to specify a third-party libraries or specific tasks data sets metrics and also like a you can add specific metrics which can later on be processed by other pipelines yeah i think that's pretty much it feel free to ask any questions and if not i will show you yeah so this is the end of the chapter there are like two very small things i would like to show you which are part of the hogging face hub [Music] yeah so the first one let me just go out of this if you have transformers installed very likely you already have the hogging face hub installed this is a client library that gives you access to a lot of things so this is what allows anyone to push files to to the hub you can do a lot of very nice things nice things and if you would like to integrate this to your own code it's very straightforward apart from having like wrappers to upload things or download things from the hub you also have access to information information from from the hub so for example if you would like to get all of the models [Music] that are for a specific library let me actually this will return quite a bit so so this will return information not the actual models let's say in film mask i think that that will be clever so this will make a call to the backend this will return all of the information on all of the field mask models and as you can see there are 1000 va mask filling models on the hub so let me just show you the first item so as you can see the model name is albert based b1 it gives you all of the tags and it tells you what what's the task this model this repo is for so there was a person from the community that was doing the course and they decided to actually create a hog and phase data set of all of the models that are on the hub so that's quite nice so if you would like to do model exploration and more of that that that's like a fun project that anyone could already with this provided so actually you would like to learn a bit more about about this the repository is coginface hot and this is like the open source place for everything related to the hub so you get a client library to download and publish on the hub you get the inference api for third-party libraries you get the widgets so the widgets are the things at the right of the model language the model card in which you could try the model directly on the web and more things so that's very nice and this is a very recent feature let me first a login face click create dummy three okay so i'm first creating a wrapper and i need to specify repo before properly i am homes is asking if there is an option to certify the number of stars using the hog in face api yeah maybe wait for next week there will be some announcements on that so please stay tuned as well yeah so let me test this uh so right now i created a repo and let's say this is like context managers maybe let's first explain the code so the hog in face hub has this class which is repository which allows you to clone a repository in a specific directory so i just did a dummy three if i'm not wrong and it will clone yeah from the three and this is a context manager so you are you've probably done similar things with files so you can do with repo dot commit my first file anything that you do now will be committed to the hub so this is like a very nice grappler that will probably make your life easier just let me quickly check that this will work so we import yeah yeah so this initializes the repository so now you can do with repo dot commit so my first file with open file text text yeah okay so this is a i mean this part right uh sorry with open file as far blah blah blah this can be anything like this this is not limited to text files you can't do anything that is creating so you're probably very familiar with this the only new thing is this grappler with repo dot commit my first file and now if we go to the hub so let's go to my profile yeah here we have dummy three and if we go to files we'll see that the file that i just created here with this with open file blah blah blah is not actually a done for locally it's done to commit that to the repository so this is like a nice way of handling a file a file writing on the hub and as you can see the file is already here okay so that where those two were like the two bonus things i wanted to show you okay so this is like the last the last the last chapter but we will have like some different activities going on in the next few weeks uh we also have in in the forum this shared your projects section so at this point you already have all of the tools to to fine tuning for example of text classification on a specific task so what you can do now is searching for a an interesting dataset in the hub so here in the hub you can go to datasets and you can search there for interesting datasets and you can work on creating a classification project a text classification project and it's quite easy to it's quite easy to share this and feel free to comment here like hey i trained this with what i learned on the course that would be awesome we have one question which is so advantageous of the repo that commit context manager is that we don't need to do a git commit every time yeah so this is like a easy programmatic way of handling everything with a context manager it's mostly like a convenience grouper i hope that makes sense all right do we have any other questions thanks thanks again mark holmes all right then then thanks a lot for everyone that was able to join yeah and see you in the forum
Original Description
This is a recording of the twitch session on July 7th 2021.
Chapter 4 of the course: https://huggingface.co/course/chapter4
Have a question? Checkout the forums: https://discuss.huggingface.co/c/course/20
Subscribe to our newsletter: https://huggingface.curated.co/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from HuggingFace · HuggingFace · 46 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
▶
47
48
49
50
51
52
53
54
55
56
57
58
59
60
The Future of Natural Language Processing
HuggingFace
Trends in Model Size & Computational Efficiency in NLP
HuggingFace
Increasing Data Usage in Natural Language Processing
HuggingFace
In Domain & Out of Domain Generalization in the Future of NLP
HuggingFace
The Limits of NLU & the Rise of NLG in the Future of NLP
HuggingFace
The Lack of Robustness in the Future of NLP
HuggingFace
Inductive Bias, Common Sense, Continual Learning in The Future of NLP
HuggingFace
Train a Hugging Face Transformers Model with Amazon SageMaker
HuggingFace
What is Transfer Learning?
HuggingFace
The pipeline function
HuggingFace
Navigating the Model Hub
HuggingFace
Transformer models: Decoders
HuggingFace
The Transformer architecture
HuggingFace
Transformer models: Encoder-Decoders
HuggingFace
Transformer models: Encoders
HuggingFace
Keras introduction
HuggingFace
The push to hub API
HuggingFace
Fine-tuning with TensorFlow
HuggingFace
Learning rate scheduling with TensorFlow
HuggingFace
TensorFlow Predictions and metrics
HuggingFace
Welcome to the Hugging Face course
HuggingFace
The tokenization pipeline
HuggingFace
Supercharge your PyTorch training loop with Accelerate
HuggingFace
The Trainer API
HuggingFace
Batching inputs together (PyTorch)
HuggingFace
Batching inputs together (TensorFlow)
HuggingFace
Hugging Face Datasets overview (Pytorch)
HuggingFace
Hugging Face Datasets overview (Tensorflow)
HuggingFace
What is dynamic padding?
HuggingFace
What happens inside the pipeline function? (PyTorch)
HuggingFace
What happens inside the pipeline function? (TensorFlow)
HuggingFace
Instantiate a Transformers model (PyTorch)
HuggingFace
Instantiate a Transformers model (TensorFlow)
HuggingFace
Preprocessing sentence pairs (PyTorch)
HuggingFace
Preprocessing sentence pairs (TensorFlow)
HuggingFace
Write your training loop in PyTorch
HuggingFace
Managing a repo on the Model Hub
HuggingFace
Chapter 1 Live Session with Sylvain
HuggingFace
Chapter 2 Live Session with Lewis
HuggingFace
The push to hub API
HuggingFace
Chapter 2 Live Session with Sylvain
HuggingFace
Chapter 3 live sessions with Lewis (PyTorch)
HuggingFace
Day 1 Talks: JAX, Flax & Transformers 🤗
HuggingFace
Day 2 Talks: JAX, Flax & Transformers 🤗
HuggingFace
Day 3 Talks JAX, Flax, Transformers 🤗
HuggingFace
Chapter 4 live sessions with Omar
HuggingFace
Deploy a Hugging Face Transformers Model from S3 to Amazon SageMaker
HuggingFace
Deploy a Hugging Face Transformers Model from the Model Hub to Amazon SageMaker
HuggingFace
Run a Batch Transform Job using Hugging Face Transformers and Amazon SageMaker
HuggingFace
[Webinar] How to add machine learning capabilities with just a few lines of code
HuggingFace
Hugging Face + Zapier Demo Video
HuggingFace
Hugging Face + Google Sheets Demo
HuggingFace
Hugging Face Infinity Launch - 09/28
HuggingFace
Build and Deploy a Machine Learning App in 2 Minutes
HuggingFace
Hugging Face Infinity - GPU Walkthrough
HuggingFace
Otto - 🤗 Infinity Case Study
HuggingFace
Workshop: Getting started with Amazon Sagemaker Train a Hugging Face Transformers and deploy it
HuggingFace
Workshop: Going Production: Deploying, Scaling & Monitoring Hugging Face Transformer models
HuggingFace
🤗 Tasks: Causal Language Modeling
HuggingFace
🤗 Tasks: Masked Language Modeling
HuggingFace
More on: LLM Foundations
View skill →Related Reads
📰
📰
📰
📰
CodeIgniter 4 vs Laravel — When to Choose Which (From a Dev Who Uses Both)
Dev.to · sunakshi Thakur
The Only Git Commands You Actually Need — 47 Patterns for Daily Work
Dev.to · The AI producer
Common Next.js Errors (and How I Solved Them)
Dev.to · gary killen
Applying Scalability in Backend (CodeBuddy)
Medium · LLM
🎓
Tutor Explanation
DeepCamp AI