Skip to content

Commit ee1fadd

Browse files
committed
better test with report
1 parent 7b9e7b8 commit ee1fadd

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

examples/llava/test-1.jpeg

121 KB
Loading

examples/llava/tests.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ cd $SCRIPT_DIR
88

99
set -eu
1010

11+
mkdir -p $SCRIPT_DIR/output
12+
1113
PROJ_ROOT="$SCRIPT_DIR/../.."
1214
cd $PROJ_ROOT
1315

@@ -37,6 +39,8 @@ add_test "llama-qwen2vl-cli" "bartowski/Qwen2-VL-2B-Instruct-GGUF"
3739

3840
cmake --build build -j --target "${arr_bin[@]}"
3941

42+
arr_res=()
43+
4044
for i in "${!arr_bin[@]}"; do
4145
bin="${arr_bin[$i]}"
4246
hf="${arr_hf[$i]}"
@@ -45,7 +49,17 @@ for i in "${!arr_bin[@]}"; do
4549
echo ""
4650
echo ""
4751

48-
"$PROJ_ROOT/build/bin/$bin" -hf "$hf" --image $PROJ_ROOT/media/llama1-logo.png -p "what do you see"
52+
output=$("$PROJ_ROOT/build/bin/$bin" -hf "$hf" --image $SCRIPT_DIR/test-1.jpeg -p "what is the publisher name of the newspaper?" --temp 0 | tee /dev/tty)
53+
54+
echo "$output" > $SCRIPT_DIR/output/$bin-$(echo "$hf" | tr '/' '-').log
55+
56+
if echo "$output" | grep -iq "new york"; then
57+
result="\033[32mOK\033[0m: $bin $hf"
58+
else
59+
result="\033[31mFAIL\033[0m: $bin $hf"
60+
fi
61+
echo -e "$result"
62+
arr_res+=("$result")
4963

5064
echo ""
5165
echo ""
@@ -55,3 +69,8 @@ for i in "${!arr_bin[@]}"; do
5569
echo ""
5670
echo ""
5771
done
72+
73+
for i in "${!arr_res[@]}"; do
74+
echo -e "${arr_res[$i]}"
75+
done
76+
echo ""

0 commit comments

Comments
 (0)