a-normal-username commited on
Commit
6eed9f8
·
verified ·
1 Parent(s): 9415dca

Upload maxtext-setup/setup.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. maxtext-setup/setup.sh +35 -0
maxtext-setup/setup.sh ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # set your user name
4
+ export user=ljy
5
+
6
+ # clone maxtext
7
+ git clone https://github.com/google/maxtext
8
+
9
+ # installing libraries
10
+ cd jetstream
11
+ pip install .
12
+ cd ~/maxtext
13
+ bash setup.sh
14
+ cd ~
15
+
16
+ # getting checkpoint, then converting checkpoint to maxtext
17
+ pip3 install torch
18
+ # super fast download
19
+ sudo snap install axel
20
+ axel -a -n 128 https://files.mistral-7b-v0-1.mistral.ai/mistral-7B-v0.1.tar
21
+ tar -xf mistral-7B-v0.1.tar
22
+ rm -rf mistral-7B-v0.1.tar
23
+ python3 /home/${user}/maxtext/MaxText/llama_or_mistral_ckpt.py --base-model-path /home/${user}/mistral-7B-v0.1 --model-size mistral-7b --maxtext-model-path /home/${user}/maxtext-models/mistral-7b
24
+
25
+ # convert checkpoint to param only
26
+ python3 /home/${user}/maxtext/MaxText/generate_param_only_checkpoint.py \
27
+ /home/${user}/maxtext/MaxText/configs/base.yml \
28
+ base_output_directory=/home/${user}/maxtext-testing-output \
29
+ load_parameters_path=/home/${user}/maxtext-models/mistral-7b/0/items \
30
+ run_name=/home/${user}/maxtext-models/mistral-param-only \
31
+ model_name='mistral-7b' \
32
+ force_unroll=true
33
+
34
+ # done! now you can use byobu to run the server
35
+ # to run the server, run mistral_inference_test.sh after copying mistral-server-config.yaml to /hom$e/{user}