-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdemo_pytest.sh
executable file
·83 lines (68 loc) · 3.06 KB
/
demo_pytest.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh
dfx identity use default
#######################################################################
# For Linux & Mac
#######################################################################
echo " "
echo "--------------------------------------------------"
echo "Stopping the local network"
dfx stop
echo " "
echo "--------------------------------------------------"
echo "Starting the local network as a background process"
dfx start --clean --background
#######################################################################
echo "--------------------------------------------------"
echo "Building the wasm with wasi-sdk"
icpp build-wasm --to-compile all
# icpp build-wasm --to-compile mine
#######################################################################
echo " "
echo "--------------------------------------------------"
echo "Deploying the wasm to a canister on the local network"
dfx deploy llama2_260K
#######################################################################
echo " "
echo "--------------------------------------------------"
echo "Setting canister_mode to chat-principal"
dfx canister call llama2_260K set_canister_mode chat-principal
#######################################################################
echo " "
echo "--------------------------------------------------"
echo "Checking health endpoint"
dfx canister call llama2_260K health
#######################################################################
echo " "
echo "--------------------------------------------------"
echo "Initializing the canister configurations"
python -m scripts.nft_init --network local --canister llama2_260K --nft-supply-cap 0 --nft-symbol "" --nft-name "" --nft-description ""
#######################################################################
echo " "
echo "--------------------------------------------------"
echo "Uploading the model & tokenizer"
python -m scripts.upload --network local --canister llama2_260K --model stories260K/stories260K.bin --tokenizer stories260K/tok512.bin
#######################################################################
echo " "
echo "--------------------------------------------------"
echo "Checking readiness endpoint"
dfx canister call llama2_260K ready
#######################################################################
echo " "
echo "--------------------------------------------------"
echo "Running the full smoketests with pytest"
pytest --network=local
#######################################################################
# echo "--------------------------------------------------"
# echo "Stopping the local network"
# dfx stop
# #######################################################################
# echo " "
# echo "--------------------------------------------------"
# echo "Building the OS native debug executable with clang++"
# icpp build-native --to-compile all
# # icpp build-native --to-compile mine
# #######################################################################
# echo " "
# echo "--------------------------------------------------"
# echo "Running the OS native debug executable"
# ./build-native/mockic.exe