Skip to content

Commit 7cfc370

Browse files
committed
Test
1 parent e5fcf38 commit 7cfc370

1 file changed

Lines changed: 52 additions & 5 deletions

File tree

.github/workflows/llm-android.yml

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,54 @@ jobs:
108108
fi
109109
done
110110
111-
- name: Run instrumentation tests
112-
uses: reactivecircus/android-emulator-runner@v2
111+
- name: Download model files
113112
env:
114113
MODEL_PRESET: ${{ inputs.model_preset || 'stories' }}
115114
CUSTOM_PTE_URL: ${{ inputs.custom_pte_url }}
116115
CUSTOM_TOKENIZER_URL: ${{ inputs.custom_tokenizer_url }}
116+
run: |
117+
mkdir -p /tmp/llama_models
118+
119+
# Determine URLs based on preset
120+
case "$MODEL_PRESET" in
121+
llama)
122+
PTE_URL="https://huggingface.co/executorch-community/Llama-3.2-1B-ET/resolve/main/llama3_2-1B.pte"
123+
TOKENIZER_URL="https://huggingface.co/executorch-community/Llama-3.2-1B-ET/resolve/main/tokenizer.model"
124+
;;
125+
qwen3)
126+
PTE_URL="https://huggingface.co/pytorch/Qwen3-4B-INT8-INT4/resolve/main/model.pte"
127+
TOKENIZER_URL="https://huggingface.co/pytorch/Qwen3-4B-INT8-INT4/resolve/main/tokenizer.json"
128+
;;
129+
custom)
130+
PTE_URL="$CUSTOM_PTE_URL"
131+
TOKENIZER_URL="$CUSTOM_TOKENIZER_URL"
132+
;;
133+
*)
134+
PTE_URL="https://ossci-android.s3.amazonaws.com/executorch/stories/snapshot-20260114/stories110M.pte"
135+
TOKENIZER_URL="https://ossci-android.s3.amazonaws.com/executorch/stories/snapshot-20260114/tokenizer.model"
136+
;;
137+
esac
138+
139+
PTE_FILE=$(basename "$PTE_URL")
140+
TOKENIZER_FILE=$(basename "$TOKENIZER_URL")
141+
142+
echo "Downloading model: $PTE_URL"
143+
curl -fL --progress-bar -o "/tmp/llama_models/$PTE_FILE" "$PTE_URL"
144+
145+
echo "Downloading tokenizer: $TOKENIZER_URL"
146+
curl -fL --progress-bar -o "/tmp/llama_models/$TOKENIZER_FILE" "$TOKENIZER_URL"
147+
148+
echo "Downloaded files:"
149+
ls -lh /tmp/llama_models/
150+
151+
# Export filenames for later steps
152+
echo "MODEL_FILE=$PTE_FILE" >> $GITHUB_ENV
153+
echo "TOKENIZER_FILE=$TOKENIZER_FILE" >> $GITHUB_ENV
154+
155+
- name: Run instrumentation tests
156+
uses: reactivecircus/android-emulator-runner@v2
157+
env:
158+
MODEL_PRESET: ${{ inputs.model_preset || 'stories' }}
117159
with:
118160
api-level: ${{ env.API_LEVEL }}
119161
arch: ${{ env.ARCH }}
@@ -124,11 +166,16 @@ jobs:
124166
script: |
125167
adb shell rm -rf /data/local/tmp/llama
126168
adb shell mkdir -p /data/local/tmp/llama
127-
echo "=== Model directory after cleanup ==="
128-
adb shell ls -la /data/local/tmp/llama/ || echo "Directory empty or not found"
169+
echo "=== Pushing pre-downloaded model files to device ==="
170+
adb push /tmp/llama_models/* /data/local/tmp/llama/
171+
echo "=== Model directory contents ==="
172+
adb shell ls -la /data/local/tmp/llama/
129173
adb logcat -c && adb logcat > /tmp/logcat.txt &
130174
LOGCAT_PID=$!
131-
./scripts/run-instrumentation-tests.sh "$MODEL_PRESET" "$CUSTOM_PTE_URL" "$CUSTOM_TOKENIZER_URL"
175+
./gradlew connectedCheck -PskipModelDownload=true \
176+
-PmodelPreset="$MODEL_PRESET" \
177+
-Pandroid.testInstrumentationRunnerArguments.modelFile="$MODEL_FILE" \
178+
-Pandroid.testInstrumentationRunnerArguments.tokenizerFile="$TOKENIZER_FILE"
132179
TEST_EXIT_CODE=$?
133180
echo "=== Model directory after Gradle ==="
134181
adb shell ls -la /data/local/tmp/llama/

0 commit comments

Comments
 (0)