Skip to content

Instantly share code, notes, and snippets.

@fanbyprinciple
Last active January 13, 2022 11:46
Show Gist options
  • Save fanbyprinciple/9066f412b7e67d47282aed56b416159b to your computer and use it in GitHub Desktop.
Save fanbyprinciple/9066f412b7e67d47282aed56b416159b to your computer and use it in GitHub Desktop.
Steps to install hugging face locally

If you have a conda environment, create a new environement using conda create --name myenv

activate myenv

Install pytorch in the environment. if you have cuda: check commandline corresponding to your version.

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

Install transformers from conda-forge rather than conda

conda install -c conda-forge transformers

Add some more packages just to be sure:

conda install scikit-learn

conda install importlib-metadata

check successful installation with

python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('I love you'))"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment