forked from skypilot-org/skypilot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
chatbot-meta.yaml
40 lines (33 loc) · 1.3 KB
/
chatbot-meta.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
resources:
memory: 32+
accelerators: A100:1
disk_size: 1024
disk_tier: best
envs:
MODEL_SIZE: 7
HF_TOKEN: # TODO: Fill with your own huggingface token, or use --env to pass.
setup: |
set -ex
git clone https://github.com/facebookresearch/llama.git || true
cd ./llama
pip install -e .
cd -
git clone https://github.com/skypilot-org/sky-llama.git || true
cd sky-llama
pip install torch==1.12.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
pip install -r requirements.txt
pip install -e .
cd -
# Download the model weights from the huggingface hub, as the official
# download script has some problem.
git config --global credential.helper cache
sudo apt -y install git-lfs
pip install transformers
python -c "import huggingface_hub; huggingface_hub.login('${HF_TOKEN}', add_to_git_credential=True)"
git clone https://huggingface.co/meta-llama/Llama-2-${MODEL_SIZE}b-chat
wget https://github.com/tsl0922/ttyd/releases/download/1.7.2/ttyd.x86_64
sudo mv ttyd.x86_64 /usr/local/bin/ttyd
sudo chmod +x /usr/local/bin/ttyd
run: |
cd sky-llama
ttyd /bin/bash -c "torchrun --nproc_per_node $SKYPILOT_NUM_GPUS_PER_NODE chat.py --ckpt_dir ~/sky_workdir/Llama-2-${MODEL_SIZE}b-chat --tokenizer_path ~/sky_workdir/Llama-2-${MODEL_SIZE}b-chat/tokenizer.model"