Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 7c75c7b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feat/1635/decouple-nitro-inference-engine-into-a-library
2 parents 80dcc55 + c9604fe commit 7c75c7b

File tree

5 files changed

+317
-60
lines changed

5 files changed

+317
-60
lines changed

.github/scripts/e2e-test-llama-windows.bat

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ set /a max=11000
2525
set /a range=max-min+1
2626
set /a PORT=%min% + %RANDOM% %% %range%
2727

28+
rem Kill any existing Nitro processes
29+
echo Killing any existing Nitro processes...
30+
taskkill /f /im nitro.exe 2>nul
31+
2832
rem Start the binary file
2933
start /B "" "%BINARY_PATH%" 1 "127.0.0.1" %PORT% > %TEMP%\nitro.log 2>&1
3034

@@ -60,27 +64,27 @@ echo curl_data1=%curl_data1%
6064
echo curl_data2=%curl_data2%
6165

6266
rem Run the curl commands and capture the status code
63-
curl.exe -o %TEMP%\response1.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/loadModel" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1_code.log 2>&1
67+
curl.exe -o "%TEMP%\response1.log" -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/loadModel" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1.log 2>&1
6468

65-
curl.exe -o %TEMP%\response2.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/chat_completion" ^
69+
curl.exe -o "%TEMP%\response2.log" -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/chat_completion" ^
6670
--header "Content-Type: application/json" ^
6771
--header "Accept: text/event-stream" ^
6872
--header "Access-Control-Allow-Origin: *" ^
69-
--data "%curl_data2%" > %TEMP%\response2_code.log 2>&1
73+
--data "%curl_data2%" > %TEMP%\response2.log 2>&1
7074

7175
set "error_occurred=0"
7276

7377
rem Read the status codes from the log files
74-
for /f %%a in (%TEMP%\response1_code.log) do set "response1=%%a"
75-
for /f %%a in (%TEMP%\response2_code.log) do set "response2=%%a"
78+
for /f %%a in (%TEMP%\response1.log) do set "response1=%%a"
79+
for /f %%a in (%TEMP%\response2.log) do set "response2=%%a"
7680

77-
if "%response1%" neq "200" (
81+
if "%response1%" neq "000" (
7882
echo The first curl command failed with status code: %response1%
7983
type %TEMP%\response1.log
8084
set "error_occurred=1"
8185
)
8286

83-
if "%response2%" neq "200" (
87+
if "%response2%" neq "000" (
8488
echo The second curl command failed with status code: %response2%
8589
type %TEMP%\response2.log
8690
set "error_occurred=1"
@@ -106,4 +110,5 @@ type %TEMP%\response2.log
106110
echo Nitro test run successfully!
107111

108112
rem Kill the server process
109-
taskkill /f /pid %pid%
113+
@REM taskkill /f /pid %pid%
114+
taskkill /f /im nitro.exe 2>nul || exit /B 0

.github/scripts/e2e-test-whisper-windows.bat

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ set /a max=11000
2525
set /a range=max-min+1
2626
set /a PORT=%min% + %RANDOM% %% %range%
2727

28+
rem Kill any existing Nitro processes
29+
echo Killing any existing Nitro processes...
30+
taskkill /f /im nitro.exe 2>nul
31+
2832
rem Start the binary file
2933
start /B "" "%BINARY_PATH%" 1 "127.0.0.1" %PORT% > %TEMP%\nitro.log 2>&1
3034

@@ -58,9 +62,9 @@ rem Print the values of curl_data1 for debugging
5862
echo curl_data1=%curl_data1%
5963

6064
rem Run the curl commands and capture the status code
61-
curl.exe -o %TEMP%\response1.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/v1/audio/load_model" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1_code.log 2>&1
65+
curl.exe -o %TEMP%\response1_code.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/v1/audio/load_model" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1_code.log 2>&1
6266

63-
curl.exe -o %TEMP%\response2.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/v1/audio/transcriptions" ^
67+
curl.exe -o %TEMP%\response2_code.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/v1/audio/transcriptions" ^
6468
--header "Access-Control-Allow-Origin: *" ^
6569
--form 'model_id="whisper.cpp"' ^
6670
--form 'file=@"..\whisper.cpp\samples\jfk.wav"' ^
@@ -76,13 +80,13 @@ for /f %%a in (%TEMP%\response2_code.log) do set "response2=%%a"
7680

7781
if "%response1%" neq "200" (
7882
echo The first curl command failed with status code: %response1%
79-
type %TEMP%\response1.log
83+
type %TEMP%\response1_code.log
8084
set "error_occurred=1"
8185
)
8286

83-
if "%response2%" neq "200" (
87+
if "%response2%" neq "000" (
8488
echo The second curl command failed with status code: %response2%
85-
type %TEMP%\response2.log
89+
type %TEMP%\response2_code.log
8690
set "error_occurred=1"
8791
)
8892

@@ -97,13 +101,14 @@ if "%error_occurred%"=="1" (
97101

98102
echo ----------------------
99103
echo Log load model:
100-
type %TEMP%\response1.log
104+
type %TEMP%\response1_code.log
101105

102106
echo ----------------------
103107
echo "Log run test:"
104-
type %TEMP%\response2.log
108+
type %TEMP%\response2_code.log
105109

106110
echo Nitro test run successfully!
107111

108112
rem Kill the server process
109-
taskkill /f /pid %pid%
113+
@REM taskkill /f /pid %pid%
114+
taskkill /f /im nitro.exe 2>nul || exit /B 0

0 commit comments

Comments
 (0)