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
From the course: Applied AI: Getting Started with Hugging Face Transformers
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,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.