File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,24 @@ cleanup_files() {
3333 rm result* .txt
3434}
3535
36+ matches_base_response_prefix () {
37+ local output_file=" $1 "
38+ python - " $output_file " << 'PY '
39+ import pathlib
40+ import re
41+ import sys
42+
43+ text = pathlib.Path(sys.argv[1]).read_text()
44+ pattern = re.compile(
45+ r"^<\|im_start\|>user Calculate 15% of 80\?<\|im_end\|><\|im_start\|>assistant:\n"
46+ r"(?:<think>\n)+"
47+ r"Okay, so I need to calculate 15% of 80\.",
48+ re.MULTILINE,
49+ )
50+ sys.exit(0 if pattern.match(text) else 1)
51+ PY
52+ }
53+
3654# Hosting lora adapter in personal repo for now.
3755python -m pip install -q huggingface_hub
3856HF_ADAPTER_REPO=" lucylq/qwen3_06B_lora_math"
@@ -186,7 +204,7 @@ cmake-out/examples/models/llama/llama_main --model_path=qwen_q.pte --data_paths=
186204NOW=$( date +" %H:%M:%S" )
187205echo " Finished at ${NOW} "
188206RESULT=$( cat result.txt)
189- if [[ " ${RESULT} " == " ${EXPECTED_QUANT_PREFIX} " * ]] ; then
207+ if matches_base_response_prefix result.txt ; then
190208 echo " Expected result prefix: ${EXPECTED_QUANT_PREFIX} "
191209 echo " Actual result: ${RESULT} "
192210 echo " Test 3: Success"
Original file line number Diff line number Diff line change @@ -33,6 +33,24 @@ cleanup_files() {
3333 rm -f result* .txt
3434}
3535
36+ matches_base_response_prefix () {
37+ local output_file=" $1 "
38+ python - " $output_file " << 'PY '
39+ import pathlib
40+ import re
41+ import sys
42+
43+ text = pathlib.Path(sys.argv[1]).read_text()
44+ pattern = re.compile(
45+ r"^<\|im_start\|>user Calculate 15% of 80\?<\|im_end\|><\|im_start\|>assistant:\n"
46+ r"(?:<think>\n)+"
47+ r"Okay, so I need to calculate 15% of 80\.",
48+ re.MULTILINE,
49+ )
50+ sys.exit(0 if pattern.match(text) else 1)
51+ PY
52+ }
53+
3654# Download LoRA adapter.
3755python -m pip install -q huggingface_hub
3856HF_ADAPTER_REPO=" lucylq/qwen3_06B_lora_math"
@@ -107,7 +125,7 @@ NOW=$(date +"%H:%M:%S")
107125echo " Finished at ${NOW} "
108126
109127RESULT=$( cat result_base.txt)
110- if [[ " ${RESULT} " == " ${EXPECTED_BASE_PREFIX} " * ]] ; then
128+ if matches_base_response_prefix result_base.txt ; then
111129 echo " Test 2 (base_forward): Success"
112130else
113131 echo " Test 2 (base_forward): Failure"
Original file line number Diff line number Diff line change 258258if [ " $AUDIO_URL " != " " ]; then
259259 curl -L $AUDIO_URL -o ${MODEL_DIR} /$AUDIO_FILE
260260elif [[ " $MODEL_NAME " == * whisper* ]] || [ " $MODEL_NAME " = " voxtral_realtime" ]; then
261- conda install -y -c conda-forge " ffmpeg<8 "
261+ conda install -y -c conda-forge ffmpeg
262262 pip install datasets soundfile
263263 # We pushd'd into EXECUTORCH_ROOT above, so torch_pin is importable here.
264264 TORCHCODEC_PKG=$( python -c " from torch_pin import torchcodec_spec; print(torchcodec_spec())" )
You can’t perform that action at this time.
0 commit comments