See this page for more details:
https://huggingface.co/docs/transformers/en/installation
Make sure that both python and pip packages are installed.
Create a directory to use for your tests: /home/mtitek/dev/llm
Create and activate a virtual environment in your project directory with venv:
Install Transformers with pip in your newly created virtual environment:
To install a CPU-only version of Transformers and a machine learning framework PyTorch, run the following command:
To test if the installation was successful, run the following command. It should return a label and a score for the provided text:
To deactivate the virtual environment in your project directory and clean it up: