Create run.sh
Browse files
run.sh
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
source /root/.wasmedge/env
|
4 |
+
|
5 |
+
chat_file_name=$1
|
6 |
+
embedding_file_name=$2
|
7 |
+
prompt_template=$3
|
8 |
+
chat_ctx_size=$4
|
9 |
+
embedding_ctx_size=$5
|
10 |
+
|
11 |
+
if [ -z "$chat_ctx_size" ]; then
|
12 |
+
chat_ctx_size=512
|
13 |
+
fi
|
14 |
+
|
15 |
+
if [ -z "$embedding_ctx_size" ]; then
|
16 |
+
embedding_ctx_size=256
|
17 |
+
fi
|
18 |
+
|
19 |
+
if [ "$embedding_ctx_size" -eq "0" ]; then
|
20 |
+
wasmedge --dir .:. --nn-preload default:GGML:AUTO:/models/$chat_file_name llama-api-server.wasm --prompt-template $prompt_template --ctx-size $chat_ctx_size --model-name $chat_file_name --socket-addr 0.0.0.0:8080
|
21 |
+
else
|
22 |
+
wasmedge --dir .:. --nn-preload default:GGML:AUTO:/models/$chat_file_name --nn-preload embedding:GGML:AUTO:/models/$embedding_file_name llama-api-server.wasm --prompt-template $prompt_template,embedding --ctx-size $chat_ctx_size,$embedding_ctx_size --model-name $chat_file_name,$embedding_file_name --socket-addr 0.0.0.0:8080
|
23 |
+
fi
|