Skip to content

Commit

Permalink
Update the package name to ai-edge-model-explorer-adapter
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 632196052
  • Loading branch information
yijie-yang authored and copybara-github committed May 9, 2024
1 parent 7e64ce1 commit c4e4502
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 137 deletions.
14 changes: 7 additions & 7 deletions src/builtin-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Install from TestPyPI

Install `model-explorer-adapter` via pip from TestPyPI. For example, in a
Python virtual environment:
Install `ai-edge-model-explorer-adapter` via pip from TestPyPI. For example, in
a Python virtual environment:

```
% python3 -m venv ~/tmp/venv
% source ~/tmp/venv/bin/activate
(venv) $ pip install -i https://test.pypi.org/simple/ model-explorer-converter
(venv) $ pip install -i https://test.pypi.org/simple/ ai-edge-model-explorer-adapter
```

## Use the Package
Expand All @@ -17,7 +17,7 @@ example:

```
(venv) $ python3
>>> from model_explorer_adapter import _pywrap_convert_wrapper as convert_wrapper
>>> from ai_edge_model_explorer_adapter import _pywrap_convert_wrapper as convert_wrapper
>>> config = convert_wrapper.VisualizeConfig()
>>> model_path = 'foo.tflite'
>>> json = convert_wrapper.ConvertFlatbufferToJson(config, model_path, True)
Expand All @@ -37,8 +37,8 @@ package version, which should be a string of the form "x.x.x". For example:
% tree gen/adapter_pip/dist
gen/adapter_pip/dist
├── model_explorer_adapter-0.1.0-cp311-cp311-linux_x86_64.whl
└── model-explorer-adapter-0.1.0.linux-x86_64.tar.gz
├── ai_edge_model_explorer_adapter-0.1.0-cp311-cp311-linux_x86_64.whl
└── ai-edge-model-explorer-adapter-0.1.0.linux-x86_64.tar.gz
```

### Install
Expand All @@ -49,7 +49,7 @@ environment:
```
% python3 -m venv ~/tmp/venv
% source ~/tmp/venv/bin/activate
(venv) $ pip install gen/adapter_pip/dist/model_explorer_adapter-0.1.0-cp311-cp311-linux_x86_64.whl
(venv) $ pip install gen/adapter_pip/dist/ai_edge_model_explorer_adapter-0.1.0-cp311-cp311-linux_x86_64.whl
```

The package should now be importable and usable.
121 changes: 0 additions & 121 deletions src/builtin-adapter/python/pip_package/build_cp39_package.sh

This file was deleted.

10 changes: 5 additions & 5 deletions src/builtin-adapter/python/pip_package/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ PYTHON_VERSION="$(${PYTHON} --version | cut -d " " -f 2)"
IFS='.' read -ra VERSION_PARTS <<< "${PYTHON_VERSION}"
# TF only supports python version ["3.9", "3.10", "3.11", "3.12"].
export TF_PYTHON_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}"
export PROJECT_NAME=${WHEEL_PROJECT_NAME:-model_explorer_adapter}
export PROJECT_NAME=${WHEEL_PROJECT_NAME:-ai_edge_model_explorer_adapter}
BUILD_DIR="gen/adapter_pip"
BAZEL_FLAGS="--copt=-O3"
ARCH="$(uname -m)"

# Build source tree.
rm -rf "${BUILD_DIR}" && mkdir -p "${BUILD_DIR}/model_explorer_adapter"
rm -rf "${BUILD_DIR}" && mkdir -p "${BUILD_DIR}/ai_edge_model_explorer_adapter"
cp -r "${SCRIPT_DIR}/MANIFEST.in" \
"${BUILD_DIR}"
cp "${SCRIPT_DIR}/setup_with_binary.py" "${BUILD_DIR}/setup.py"
echo "__version__ = '${PACKAGE_VERSION}'" >> "${BUILD_DIR}/model_explorer_adapter/__init__.py"
echo "__version__ = '${PACKAGE_VERSION}'" >> "${BUILD_DIR}/ai_edge_model_explorer_adapter/__init__.py"

# Build python _pywrap_convert_wrapper.

Expand Down Expand Up @@ -88,12 +88,12 @@ esac
bazel build -c opt -s --config=monolithic --config=noaws --config=nogcp --config=nohdfs --config=nonccl \
${BAZEL_FLAGS} python/convert_wrapper:_pywrap_convert_wrapper
cp "bazel-bin/python/convert_wrapper/_pywrap_convert_wrapper${LIBRARY_EXTENSION}" \
"${BUILD_DIR}/model_explorer_adapter"
"${BUILD_DIR}/ai_edge_model_explorer_adapter"

# Bazel generates the wrapper library with r-x permissions for user.
# At least on Windows, we need write permissions to delete the file.
# Without this, setuptools fails to clean the build directory.
chmod u+w "${BUILD_DIR}/model_explorer_adapter/_pywrap_convert_wrapper${LIBRARY_EXTENSION}"
chmod u+w "${BUILD_DIR}/ai_edge_model_explorer_adapter/_pywrap_convert_wrapper${LIBRARY_EXTENSION}"

# Build python wheel.
cd "${BUILD_DIR}"
Expand Down
8 changes: 4 additions & 4 deletions src/builtin-adapter/python/pip_package/setup_with_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
version=PACKAGE_VERSION,
description=DOCLINES[0],
long_description='\n'.join(DOCLINES[2:]),
url='https://www.tensorflow.org/lite/',
author='Google, LLC',
author_email='[email protected]',
url='https://github.com/google-ai-edge/model-explorer',
author='Google AI Edge',
author_email='[email protected]',
license='Apache 2.0',
include_package_data=True,
has_ext_modules=lambda: True,
keywords='tflite tensorflow tensor machine learning model explorer adapter',
keywords='google ai edge machine learning model explorer adapter',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand Down

0 comments on commit c4e4502

Please sign in to comment.