This folder contains the materials for the tutorial Hugging Face Transformers: Leverage Open-Source AI in Python.
Create and activate a virtual environment, and then install the required dependencies:
(venv) $ python -m pip install transformers torch pillow notebook ipywidgetsAlternatively, if you use Poetry, then you can issue the following command to handle the installation process for you:
$ poetry installRun the sample Python scripts:
(venv) $ python auto_classes.py
(venv) $ python running_pipelines.pyRun the sample Jupyter notebook:
(venv) $ python -m jupyter notebook gpus_google_colab.ipynbNote that if you run this notebook in Google Colab, then you'll need to update the path to the requirements.txt file and the DATA_PATH constant accordingly:
-!pip install -r requirements.txt
+!pip install -r /content/requirements.txt
-DATA_PATH = "Scraped_Car_Review_dodge.csv"
+DATA_PATH = "/content/Scraped_Car_Review_dodge.csv"