@@ -20,45 +20,6 @@ function detect_platform() {
20
20
echo -e " ${COLOR_GREEN} Detected platform: $PLATFORM ${COLOR_OFF} "
21
21
}
22
22
23
- function prepare_test_files() {
24
- echo -e " ${COLOR_GREEN} [ INFO ]Preparing test files ${COLOR_OFF} "
25
- local EX_DIR=" ${TR_DIR} /examples/"
26
- rsync -a --link-dest=../../test/resources/ ${BASE_DIR} /test/resources/ ${TR_DIR} /
27
- if [ ! -f " ${EX_DIR} /babyllama/babyllama_handler/tokenizer.bin" ]; then
28
- wget -q https://github.com/karpathy/llama2.c/raw/master/tokenizer.bin -O " ${EX_DIR} /babyllama/babyllama_handler/tokenizer.bin"
29
- fi
30
- if [ ! -f " ${EX_DIR} /babyllama/babyllama_handler/stories15M.bin" ]; then
31
- wget -q https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin -O " ${EX_DIR} /babyllama/babyllama_handler/stories15M.bin"
32
- fi
33
- # PT2.2 torch.expport does not support Mac
34
- if [ " $PLATFORM " = " Linux" ]; then
35
- if [ ! -f " ${EX_DIR} /aot_inductor/llama_handler/stories15M.so" ]; then
36
- local HANDLER_DIR=${EX_DIR} /aot_inductor/llama_handler/
37
- if [ ! -f " ${HANDLER_DIR} /stories15M.pt" ]; then
38
- wget -q https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.pt? download=true -O " ${HANDLER_DIR} /stories15M.pt"
39
- fi
40
- local LLAMA_SO_DIR=${BASE_DIR} /third-party/llama2.so/
41
- PYTHONPATH=${LLAMA_SO_DIR} :${PYTHONPATH} python ${BASE_DIR} /../examples/cpp/aot_inductor/llama2/compile.py --checkpoint ${HANDLER_DIR} /stories15M.pt ${HANDLER_DIR} /stories15M.so
42
- fi
43
- if [ ! -f " ${EX_DIR} /aot_inductor/bert_handler/bert-seq.so" ]; then
44
- pip install transformers
45
- local HANDLER_DIR=${EX_DIR} /aot_inductor/bert_handler/
46
- export TOKENIZERS_PARALLELISM=false
47
- cd ${BASE_DIR} /../examples/cpp/aot_inductor/bert/
48
- python aot_compile_export.py
49
- mv bert-seq.so ${HANDLER_DIR} /bert-seq.so
50
- mv Transformer_model/tokenizer.json ${HANDLER_DIR} /tokenizer.json
51
- export TOKENIZERS_PARALLELISM=" "
52
- fi
53
- if [ ! -f " ${EX_DIR} /aot_inductor/resnet_handler/resnet50_pt2.so" ]; then
54
- local HANDLER_DIR=${EX_DIR} /aot_inductor/resnet_handler/
55
- cd ${HANDLER_DIR}
56
- python ${BASE_DIR} /../examples/cpp/aot_inductor/resnet/resnet50_torch_export.py
57
- fi
58
- fi
59
- cd " $BWD " || exit
60
- }
61
-
62
23
function build() {
63
24
echo -e " ${COLOR_GREEN} [ INFO ]Building backend ${COLOR_OFF} "
64
25
MAYBE_BUILD_QUIC=" "
@@ -121,7 +82,6 @@ function build() {
121
82
fi
122
83
123
84
make -j " $JOBS "
124
- make format
125
85
make install
126
86
echo -e " ${COLOR_GREEN} torchserve_cpp build is complete. To run unit test: \
127
87
./_build/test/torchserve_cpp_test ${COLOR_OFF} "
@@ -207,6 +167,5 @@ cd $BASE_DIR
207
167
208
168
git submodule update --init --recursive
209
169
210
- prepare_test_files
211
170
build
212
171
install_torchserve_cpp
0 commit comments