-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# How to build the wheel file | ||
|
||
## Intro | ||
|
||
In order to provide users a simpler way to install `Delta`, we need to | ||
build the Wheel file `.whl` and upload this wheel file to Pypi's | ||
website. Once we uploaded the wheel file, all that users need to do is | ||
typing `pip install delta-nlp`. | ||
|
||
**Notice**: installation by pip only supports NLP tasks now. If you need the | ||
full version of the Delta (with speech tasks), you should install the | ||
platform from source. | ||
|
||
## Prepare | ||
|
||
Before build the wheel file, you need to install the `DELTA` before. | ||
|
||
```bash | ||
bash ./tools/install/install-delta.sh nlp gpu | ||
``` | ||
|
||
For linux wheel building, you will need the docker image: | ||
|
||
```bash | ||
docker pull didi0speech0nlu/delta_pip:tf2_ub16 | ||
``` | ||
|
||
## Start to build | ||
|
||
### MacOS | ||
|
||
```bash | ||
bash ./tools/install/build_pip_pkg.sh | ||
``` | ||
|
||
The generated wheel will be under `dist` like | ||
`delta_nlp-0.2-cp36-cp36m-macosx_10_7_x86_64.whl` | ||
|
||
### Linux | ||
|
||
Wheel building in linux is more complicated. You need to run a docker | ||
|
||
```bash | ||
docker run --name delta_pip_tf2_u16 -it -v $PWD:/delta tensorflow/tensorflow:custom-op-ubuntu16 /bin/bash | ||
``` | ||
|
||
In the docker environment, run: | ||
|
||
```bash | ||
bash ./tools/install/build_pip_pkg.sh | ||
``` | ||
|
||
The generated wheel will be under `dist` like | ||
`delta_nlp-0.2-cp36-cp36m-linux_x86_64.whl` | ||
|
||
Repair the wheel file for multiple linux platform support: | ||
|
||
```bash | ||
auditwheel repair dist/xxx.whl | ||
``` | ||
|
||
The final wheel will be under `wheelhouse` like | ||
`delta_nlp-0.2-cp36-cp36m-manylinux1_x86_64.whl`. | ||
|
||
## Upload | ||
|
||
After building the wheel file, upload these files to Pypi: | ||
|
||
``` | ||
twine upload xxx.whl | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
support build and clean command.