Skip to content

Commit

Permalink
Pass the tokenizer.model
Browse files Browse the repository at this point in the history
  • Loading branch information
huydhn committed Dec 31, 2024
1 parent 4024706 commit dfdd704
Showing 1 changed file with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,33 @@ phases:
- |
BIN_FOUND="$(adb -s $DEVICEFARM_DEVICE_UDID shell find /data/local/tmp/minibench/ -name '*.bin')"
if [ -z "$BIN_FOUND" ]; then
echo "No tokenizer files found in /data/local/tmp/minibench/"
echo "No *.bin tokenizer files found in /data/local/tmp/minibench/"
else
echo "tokenizer files found in /data/local/tmp/minibench/"
echo "*.bin tokenizer files found in /data/local/tmp/minibench/"
fi

MODEL_FOUND="$(adb -s $DEVICEFARM_DEVICE_UDID shell find /data/local/tmp/minibench/ -name '*.model')"
if [ -z "$MODEL_FOUND" ]; then
echo "No *.model tokenizer files found in /data/local/tmp/minibench/"
else
echo "*.model tokenizer files found in /data/local/tmp/minibench/"
fi

- echo "Run benchmark"
- |
adb -s $DEVICEFARM_DEVICE_UDID shell am force-stop org.pytorch.minibench
if [ -z "$BIN_FOUND" ]; then
adb -s $DEVICEFARM_DEVICE_UDID shell am start -W -n org.pytorch.minibench/.BenchmarkActivity \
--es "model_dir" "/data/local/tmp/minibench"
else

if [ -n "$BIN_FOUND" ]; then
adb -s $DEVICEFARM_DEVICE_UDID shell am start -W -n org.pytorch.minibench/.LlmBenchmarkActivity \
--es "model_dir" "/data/local/tmp/minibench" \
--es "tokenizer_path" "/data/local/tmp/minibench/tokenizer.bin"
elif [ -n "$MODEL_FOUND" ]; then
adb -s $DEVICEFARM_DEVICE_UDID shell am start -W -n org.pytorch.minibench/.LlmBenchmarkActivity \
--es "model_dir" "/data/local/tmp/minibench" \
--es "tokenizer_path" "/data/local/tmp/minibench/tokenizer.model"
else
adb -s $DEVICEFARM_DEVICE_UDID shell am start -W -n org.pytorch.minibench/.BenchmarkActivity \
--es "model_dir" "/data/local/tmp/minibench"
fi


Expand Down

0 comments on commit dfdd704

Please sign in to comment.