Skip to content
forked from allenai/OLMo

Modeling, training, eval, and inference code for OLMo

License

Notifications You must be signed in to change notification settings

wangxuebing0906/OLMo

Repository files navigation



OLMo: Open Language Model

Installation

pip install ai2-olmo

Fine-tuning

To fine-tune an OLMo model you'll first need to prepare your dataset by tokenizing and saving it to a numpy memory-mapped array. See scripts/prepare_tulu_data.py for an example with the Tulu V2 dataset, which can be easily modified for other datasets.

Next, prepare your training config. There are many examples in the configs/ directory. Make sure the model parameters match up with the model your fine-tuning. To be safe you can always start from the config that comes with the model checkpoint.

Then launch the training job:

torchrun --nproc_per_node=8 scripts/train.py {path_to_train_config} \
    --data.paths=[{path_to_data}/input_ids.npy] \
    --data.label_mask_paths=[{path_to_data}/label_mask.npy] \
    --load_path={path_to_checkpoint} \
    --reset_trainer_state

About

Modeling, training, eval, and inference code for OLMo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.3%
  • Cuda 4.7%
  • Shell 1.7%
  • C++ 1.2%
  • Jsonnet 0.7%
  • Dockerfile 0.2%
  • Other 0.2%