Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save underwater/bcecc5a54a0d143d2293e904f31b8f22 to your computer and use it in GitHub Desktop.
Save underwater/bcecc5a54a0d143d2293e904f31b8f22 to your computer and use it in GitHub Desktop.
create hugging face transformers virtual env / jupyter lab
# Step 1: Navigate to your project directory
cd /path/to/your/project
# Step 2: Create a virtual environment named transformers-env
python3 -m venv transformers-env
# Step 3: Activate the virtual environment
source transformers-env/bin/activate
# Step 4: Install Jupyter Lab in the virtual environment
pip install jupyterlab
# Step 5: Install ipykernel to create a kernel for the virtual environment
pip install ipykernel
# Step 6: Create a kernel for the virtual environment with a display name
python -m ipykernel install --user --name=transformers-env --display-name "Python (transformers-env)"
# Step 7: Start Jupyter Lab
jupyter lab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment