nogibjj/hugging-face-cli-with-codespaces

Repo that allows me to build AI tools on top of Hugging Face

Python

10

62 commits

updated Oct 5, 2022

See the code

README

Python application test with Github Actions using devcontainers Codespaces Prebuilds

hugging-face-cli-with-codespaces

Repo that allows me to build AI tools on top of Hugging Face and OpenAI Whisper

Try out fine-tuning

Run this script

"When you use a pretrained model, you train it on a dataset specific to your task. This is known as fine-tuning, an incredibly powerful training technique. In this tutorial, you will fine-tune a pretrained model with a deep learning framework of your choice:"

Tried conda with and failed:

https://huggingface.co/docs/transformers/training

Screen Shot 2022-09-20 at 8 15 55 PM

How to do fast inference using API

Monitor GPU while Training

Use split terminal and do:

nvidia-smi -l 1 in one htop in another

Verify GPU working

  • Reference PyTorch site
  • numba -s | grep cuda
  • run python utils/verify_cuda_pytorch.py
  • run nvidia-smi should show a GPU

Notes on OS X M1

conda create -n hf python=3.9
conda activate hf
conda env config vars set CONDA_SUBDIR=osx-arm64
#install nightly
pip install -U --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
#install rust if not installed
curl — proto ‘=https’ — tlsv1.2 -sSf https://sh.rustup.rs | sh
#install via brew
brew install cmake
brew install pkg-config

References

nogibjj/hugging-face-cli-with-codespaces

Repo that allows me to build AI tools on top of Hugging Face

Python

10

62 commits

updated Oct 5, 2022

See the code

README

Python application test with Github Actions using devcontainers Codespaces Prebuilds

hugging-face-cli-with-codespaces

Repo that allows me to build AI tools on top of Hugging Face and OpenAI Whisper

Try out fine-tuning

Run this script

"When you use a pretrained model, you train it on a dataset specific to your task. This is known as fine-tuning, an incredibly powerful training technique. In this tutorial, you will fine-tune a pretrained model with a deep learning framework of your choice:"

Tried conda with and failed:

https://huggingface.co/docs/transformers/training

Screen Shot 2022-09-20 at 8 15 55 PM

How to do fast inference using API

Monitor GPU while Training

Use split terminal and do:

nvidia-smi -l 1 in one htop in another

Verify GPU working

  • Reference PyTorch site
  • numba -s | grep cuda
  • run python utils/verify_cuda_pytorch.py
  • run nvidia-smi should show a GPU

Notes on OS X M1

conda create -n hf python=3.9
conda activate hf
conda env config vars set CONDA_SUBDIR=osx-arm64
#install nightly
pip install -U --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
#install rust if not installed
curl — proto ‘=https’ — tlsv1.2 -sSf https://sh.rustup.rs | sh
#install via brew
brew install cmake
brew install pkg-config

References