11@ echo off
2+ setlocal
3+
4+ rem Bypass "Terminate Batch Job" prompt.
5+ if " %~1 " == " -FIXED_CTRL_C" (
6+ REM Remove the -FIXED_CTRL_C parameter
7+ SHIFT
8+ ) ELSE (
9+ REM Run the batch with < NUL and -FIXED_CTRL_C
10+ CALL < NUL %0 -FIXED_CTRL_C %*
11+ GOTO :EOF
12+ )
213
314set " TEMP = C:\Users\%UserName% \AppData\Local\Temp"
415set " MODEL_LLM_PATH = %TEMP% \testllm"
@@ -69,6 +80,7 @@ set "curl_data3={\"llama_model_path\":\"%MODEL_LLM_PATH_STRING%\"}"
6980set " curl_data4 = {\" llama_model_path\" :\" %MODEL_EMBEDDING_PATH_STRING% \" , \" embedding\" : true, \" model_type\" : \" embedding\" }"
7081set " curl_data5 = {}"
7182set " curl_data6 = {\" input\" : \" Hello\" , \" model\" : \" test-embedding\" , \" encoding_format\" : \" float\" }"
83+ set " curl_data7 = {\" model\" : \" test-embedding\" }"
7284
7385rem Print the values of curl_data for debugging
7486echo curl_data1=%curl_data1%
@@ -77,6 +89,7 @@ echo curl_data3=%curl_data3%
7789echo curl_data4=%curl_data4%
7890echo curl_data5=%curl_data5%
7991echo curl_data6=%curl_data6%
92+ echo curl_data7=%curl_data7%
8093
8194rem Run the curl commands and capture the status code
8295curl.exe --connect-timeout 60 -o " %TEMP% \response1.log" -s -w " %% {http_code}" --location " http://127.0.0.1:%PORT% /loadmodel" --header " Content-Type: application/json" --data " %curl_data1% " > %TEMP% \response1.log 2 >& 1
@@ -95,6 +108,8 @@ curl.exe --connect-timeout 60 -o "%TEMP%\response6.log" -s -w "%%{http_code}" --
95108--header " Content-Type: application/json" ^
96109--data " %curl_data6% " > %TEMP% \response6.log 2 >& 1
97110
111+ curl.exe --connect-timeout 60 -s -w " %% {http_code}" --location " http://127.0.0.1:%PORT% /unloadmodel" --header " Content-Type: application/json" --data " %curl_data7% " 2 >& 1
112+
98113set " error_occurred = 0"
99114
100115rem Read the status codes from the log files
0 commit comments