Flickr30K (https://datasets.activeloop.ai/docs/ml/datasets/flickr30k-dataset/)
pip install -r requirements.txt
mkdir checkpoints
On Mac OSX
export PYTORCH_ENABLE_MPS_FALLBACK=1; accelerate launch trainer.py --config_file training_configs/local/nano.yaml --chkpt_file checkpoints/nano.pt
To disable MPS / CUDA, do this
accelerate launch --cpu trainer.py --config_file training_configs/local/nano.yaml --chkpt_file checkpoints/nano.pt
Choose configs from training_configs/local
for local runs or training_configs/gpu
for gpu runs or
write your own (In which case it must a yaml file that maps to the TrainingConfig
class in
configs/trainer.py
). Try using training_configs/local/nano.yaml
for fast prototyping locally.
- Subclass
HuggingfaceDecoder
inmodels/decoder.py
like howGPT2HuggingfaceDecoder
andFalconHuggingfaceDecoder
do so. - Update the
Decoder.from_config
method in the same file appropriately
- Some transformer encoder/decoder code was taken from nanoGPT repository (https://github.com/karpathy/nanoGPT)
- Huggingface ecosystem (transformers, accelerate and peft libraries and of course the model hub)
- Momentum distillation (https://arxiv.org/abs/2107.07651). Why does this help? Intuition is this helps with choosing the right scale for learning rate (self-similarity that momentum distillation enforces essentially promotes slower updates)
Using config training_configs/local/nano.yaml
Labels:
- The teenage boys in black shirts skateboarding in a skate park , surrounded by people
- Two teen guys are doing skateboard tricks at a skate park
- Two kids in jeans perform skateboard tricks
- Two guys are in the air while skateboarding
- Two teenagers doing tricks on skateboards
Predictions:
- A young man is riding his skateboard while wearing a helmet.
- Three skateboarders are doing tricks on a sidewalk.
- A man skateboarded down some stairs.
- Two skateboarders skateboarding on the sidewalk of a park.
- A man skateboards down a brick railing on an empty lot.
- Three people playing tricks in a park.
- A boy skateboarding down stairs.
- A man in a black shirt is doing a skate park trick.
Labels:
- Two white dogs walk through a huge bank of mountain snow
- Two white dogs are walking through deep white snow
- Two fluffy white dogs are in the snow
- Two white dogs walk in a snowy setting
- Two white dogs walking in the snow
Predictions:
- A young dog running through snow.
- A dog running through snow
- A dog on a sled in the snow.
- A dog in the snow.
- A black dog stands on a snowy side of a trail.
- Two small dogs running down the road.
- A dog is carrying a small snow pack in a snowy field.
- A dog is running in the snow in a field of trees.