Skip to content

Commit

Permalink
[feat]: add py3 pai xflow support (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiankongdeguiji authored Jan 26, 2024
1 parent b08d324 commit a08bf22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/export.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pai -name easy_rec_ext
```

```sql
pai -name easy_rec_ext
pai -name easy_rec_py3_ext
-Dcmd='custom'
-DentryFile='easy_rec/python/tools/faiss_index_pai.py'
-Dtables='odps://{project}/tables/dssm_item_embedding'
Expand Down
12 changes: 11 additions & 1 deletion pai_jobs/deploy_ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ mode=0
odps_config=""

is_tf15=0
while getopts 'V:C:OGc:D' OPT; do
is_py3=0
while getopts 'V:C:OGc:D:P' OPT; do
case $OPT in
V)
VERSION="$OPTARG";;
Expand All @@ -37,13 +38,16 @@ while getopts 'V:C:OGc:D' OPT; do
mode=2;;
D)
is_tf15=1;;
P)
is_py3=1;;
?)
echo "Usage: `basename $0` -V VERSION [-C odpscmd_path] [-c odps_config_path] [-O]"
echo " -O: only update easy_rec resource file"
echo " -G: generate resource file and xflow, but not deploy"
echo " -c: odps_config file path"
echo " -C: odpscmd file path, default to: odpscmd, so in default odpscmd must be in PATH"
echo " -D: use tf1.15 or deeprec"
echo " -P: use tf1.12_py3"
echo " -V: algorithm version, chars must be in [0-9A-Za-z_-], default: version info in easy_rec/version.py"
exit 1
esac
Expand Down Expand Up @@ -171,6 +175,12 @@ then
sed -i -e "s/tensorflow1120_ext/tensorflow1150_ext/g" easy_rec_ext.xml
fi

if [ $is_py3 -gt 0 ]
then
echo "will deploy TF1.12_py3 version"
sed -i -e "s/name=\"easy_rec_ext\"/name=\"easy_rec_py3_ext\"/g" easy_rec_ext.xml
sed -i -e "s/tensorflow1120_ext/tensorflow1120_py3_ext/g" easy_rec_ext.xml
fi

tar -cvzf easy_rec_flow_ex.tar.gz easy_rec_ext.lua easy_rec_ext.xml

Expand Down

0 comments on commit a08bf22

Please sign in to comment.