Skip to content

Commit 9f409bb

Browse files
authored
feat(python): enable compression in the official pypi package (#3145)
Enable TFLM compression support in the official Python package builds by adding --//:with_compression=true to the bazel commands in pypi_build.sh. This ensures that: - Users who install tflite_micro from PyPI can use compressed models - The compression module functionality is available out of the box - Both the wheel build and tests run with compression enabled The Python package is primarily used for testing and development on desktop/server systems, not on embedded targets. There's no benefit to disabling compression support to save a few kilobytes when the package runs on machines with gigabytes of RAM. Enabling compression by default provides a better developer experience without any practical downside. BUG=#3125
1 parent 14638b6 commit 9f409bb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

python/tflite_micro/pypi_build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ docker run \
101101
}
102102
103103
# Build the wheel via bazel, using the Python compatibility tag matching the
104-
# build environment.
104+
# build environment. Enable compression support for the official package.
105105
call_bazel build //python/tflite_micro:whl.dist \
106-
--//python/tflite_micro:compatibility_tag=\$PY_COMPATIBILITY
106+
--//python/tflite_micro:compatibility_tag=\$PY_COMPATIBILITY \
107+
--//:with_compression=true
107108
108109
# Test, in the container environment.
109110
call_bazel test //python/tflite_micro:whl_test \
110-
--//python/tflite_micro:compatibility_tag=\$PY_COMPATIBILITY
111+
--//python/tflite_micro:compatibility_tag=\$PY_COMPATIBILITY \
112+
--//:with_compression=true
111113
EOF
112114

113115
# Make the output directory tree writable so it can be removed easily by the

0 commit comments

Comments
 (0)