Skip to content

Commit d2b8e7e

Browse files
committed
Disk size
1 parent 7cfc370 commit d2b8e7e

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/llm-android.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
path: |
8484
~/.android/avd/*
8585
~/.android/adb*
86-
key: avd-${{ env.API_LEVEL }}-${{ env.ARCH }}-ram${{ env.RAM_SIZE }}
86+
key: avd-${{ env.API_LEVEL }}-${{ env.ARCH }}-ram${{ env.RAM_SIZE }}-disk16G
8787

8888
- name: Create AVD and generate snapshot for caching
8989
if: steps.avd-cache.outputs.cache-hit != 'true'
@@ -97,14 +97,18 @@ jobs:
9797
working-directory: llm/android/LlamaDemo
9898
script: echo "Generated AVD snapshot for caching."
9999

100-
- name: Configure AVD RAM
100+
- name: Configure AVD RAM and disk
101101
run: |
102102
AVD_DIR="$HOME/.android/avd"
103103
for config in "$AVD_DIR"/*.avd/config.ini; do
104104
if [ -f "$config" ]; then
105-
echo "Updating RAM in $config"
105+
echo "Updating config in $config"
106+
# Update RAM
106107
sed -i 's/hw.ramSize=.*/hw.ramSize=${{ env.RAM_SIZE }}/' "$config" || true
107108
grep -q "hw.ramSize" "$config" || echo "hw.ramSize=${{ env.RAM_SIZE }}" >> "$config"
109+
# Update disk size to 16GB for large models
110+
sed -i 's/disk.dataPartition.size=.*/disk.dataPartition.size=16G/' "$config" || true
111+
grep -q "disk.dataPartition.size" "$config" || echo "disk.dataPartition.size=16G" >> "$config"
108112
fi
109113
done
110114
@@ -167,7 +171,10 @@ jobs:
167171
adb shell rm -rf /data/local/tmp/llama
168172
adb shell mkdir -p /data/local/tmp/llama
169173
echo "=== Pushing pre-downloaded model files to device ==="
170-
adb push /tmp/llama_models/* /data/local/tmp/llama/
174+
for file in /tmp/llama_models/*; do
175+
echo "Pushing $(basename "$file")..."
176+
adb push "$file" /data/local/tmp/llama/
177+
done
171178
echo "=== Model directory contents ==="
172179
adb shell ls -la /data/local/tmp/llama/
173180
adb logcat -c && adb logcat > /tmp/logcat.txt &

0 commit comments

Comments
 (0)