chapter two

2 Getting started

 

This chapter covers

  • Using Anaconda
  • Creating virtual environments with conda
  • Using GPU in the pipeline() function
  • Using the Hugging Face Hub package

In chapter 1, you saw some of the exciting projects you will be creating throughout this book using the Hugging Face pretrained models and services such as AutoTrain. The main programming language you’ll be using is Python, and you’ll also be using my favorite IDE, Jupyter Notebook. Jupyter Notebook is an open source web application that allows you to create and share documents containing live code, equations, visualizations, and narrative text. It’s widely used in data science, scientific research, machine learning, and education due to its interactive and exploratory nature. In the following sections, you’ll learn how to set up Jupyter Notebook and create a virtual environment to work with all the examples in this book.

2.1 Downloading Anaconda

The easiest way to install Jupyter Notebook is to download Anaconda, a distribution of Python and R programming languages that comes with a set of preinstalled libraries and tools commonly used in data science, machine learning, and scientific computing. It includes the conda package manager, which simplifies package management and environment creation. Jupyter Notebook is one of the core components of Anaconda. Therefore, installing Anaconda gives you access not only to Jupyter Notebook but also to many commonly used packages.

2.1.1 Creating virtual environments

2.1.2 Starting Jupyter Notebook

2.2 Installing the Transformers library

2.2.1 Support for GPU

2.2.2 Using GPU in the pipeline object

2.3 Installing the Hugging Face Hub package

2.3.1 Downloading files

2.3.2 Using the Hugging Face CLI

Summary