summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Mak <tonymak@google.com>2019-06-17 15:08:28 +0100
committerTony Mak <tonymak@google.com>2019-06-17 15:01:34 +0000
commitca36cb94e0c619026b21fa73d21f8be298739655 (patch)
tree30db3cceeab42f0e57187692e7462f3ca352d0f1
parentd6b9e709a9400604d79cc323797d12f0296a04ab (diff)
downloadlibtextclassifier-android10-dev.tar.gz
Fix the update.shandroid10-dev
The script is used by OEMs to fetch the latest model files. It was broken before. Found this when working on the release doc. Test: Run the script Bug: 120852156 Change-Id: Iedae27064bb855fd01597c3c4b3381cfcf11817d
-rwxr-xr-xmodels/update.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/models/update.sh b/models/update.sh
index 8b60d2f..e756859 100755
--- a/models/update.sh
+++ b/models/update.sh
@@ -3,10 +3,22 @@
set -e
-BASE_URL=https://www.gstatic.com/android/text_classifier/p/live
+ANNOTATOR_BASE_URL=https://www.gstatic.com/android/text_classifier/q/live
+ACTIONS_BASE_URL=https://www.gstatic.com/android/text_classifier/actions/q/live
+LANGID_BASE_URL=https://www.gstatic.com/android/text_classifier/langid/q/live
+
+download() {
+ echo "$1/FILELIST"
+ for f in $(wget -O- "$1/FILELIST"); do
+ destination="$(basename -- $f)"
+ wget "$1/$f" -O "$destination"
+ done
+}
cd "$(dirname "$0")"
-for f in $(wget -O- "$BASE_URL/FILELIST"); do
- wget "$BASE_URL/$f" -O "$f"
-done
+download $ANNOTATOR_BASE_URL
+download $ACTIONS_BASE_URL
+download $LANGID_BASE_URL
+
+echo "You may want to edit the file name of downloaded files, see external/libtextclassifier/Android.bp"