skypilot
1name: huggingface
2
3resources:
4accelerators: V100
5# The above is a shorthand for <name>: <count=1>. Same as:
6# accelerators: V100:1
7
8# The setup command. Will be run under the working directory.
9setup: |
10git clone https://github.com/huggingface/transformers/
11# checkout to the correct version
12cd transformers
13git checkout v4.25.1
14pip3 install .
15cd examples/pytorch/text-classification
16# SkyPilot's default image on AWS/GCP has CUDA 11.6 (Azure 11.5).
17pip3 install -r requirements.txt tensorboard torch==1.12.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
18
19# The command to run. Will be run under the working directory.
20run: |
21cd transformers/examples/pytorch/text-classification
22python3 run_glue.py \
23--model_name_or_path bert-base-cased \
24--dataset_name imdb \
25--do_train \
26--max_seq_length 128 \
27--per_device_train_batch_size 32 \
28--learning_rate 2e-5 \
29--max_steps 50 \
30--output_dir /tmp/imdb/ --overwrite_output_dir \
31--fp16
32