From the course: Applied AI: Getting Started with Hugging Face Transformers

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Loading a pipeline

Loading a pipeline

- [Instructor] Let's load the sentiment analysis pipeline from hugging face in this video. First, we need to import the pipeline module from transformers. To load a pipeline, we simply create a pipeline with the specific task name, which in this case is sentiment analysis. When this code is executed, the pipeline module will download the model checkpoint, tokenizer, and other artifacts from the hugging face website to a local cache. The local cache is usually available under the user home directory. Do note that these artifacts are huge and may take a long time to download, depending upon the available bandwidth. You will also need enough disk space to store these models locally. Once the artifacts are available in the local cache, further calls to this pipeline will only use the local cache and not download from the website. To download again, simply delete the directory from the cache. Here, we create the pipeline,…

Contents