From bad99f5c90a0fd5ab8d4add933ff8c25d1d1a21e Mon Sep 17 00:00:00 2001 From: yangxudong Date: Wed, 13 Nov 2024 14:03:29 +0800 Subject: [PATCH] add tensorflow-probability to resource tar (#500) * add tensorflow-probability to resource tar --- .readthedocs.yaml | 1 - pai_jobs/deploy_ext.sh | 24 ++++++++++++++++++++++-- requirements/docs.txt | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 308216a97..41a9f4e98 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,4 +14,3 @@ python: - requirements: requirements/docs.txt - method: setuptools path: . - - tensorflow-probability diff --git a/pai_jobs/deploy_ext.sh b/pai_jobs/deploy_ext.sh index f08a701c6..3c8383439 100755 --- a/pai_jobs/deploy_ext.sh +++ b/pai_jobs/deploy_ext.sh @@ -100,7 +100,6 @@ fi cp -R $root_dir/easy_rec ./easy_rec sed -i -e "s/\[VERSION\]/$VERSION/g" easy_rec/__init__.py find -L easy_rec -name "*.pyc" | xargs rm -rf -echo "tensorflow-probability==0.5.0" > requirements.txt if [ ! -d "datahub" ] then @@ -144,7 +143,28 @@ then rm -rf faiss.tar.gz fi -tar -cvzhf $RES_PATH easy_rec datahub lz4 cprotobuf kafka faiss run.py requirements.txt +if [ ! -d "tensorflow_probability" ] +then + if [ $is_tf15 -gt 0 ]; then + tfp_version='0.8.0' + else + tfp_version='0.5.0' + fi + if [ ! -e "tensorflow_probability" ] + then + wget http://easyrec.oss-cn-beijing.aliyuncs.com/3rdparty/probability-${tfp_version}.tar.gz + if [ $? -ne 0 ] + then + echo "tensorflow_probability download failed." + fi + fi + tar -xzvf probability-${tfp_version}.tar.gz --strip-components=1 probability-${tfp_version}/tensorflow_probability + rm -rf tensorflow_probability/examples + rm -rf tensorflow_probability/g3doc + rm -rf probability-${tfp_version}.tar.gz +fi + +tar -cvzhf $RES_PATH easy_rec datahub lz4 cprotobuf kafka faiss tensorflow_probability run.py # 2 means generate only if [ $mode -ne 2 ] diff --git a/requirements/docs.txt b/requirements/docs.txt index 2ee199bb6..a81d0986b 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -5,3 +5,4 @@ recommonmark==0.6.0 sphinx==5.1.1 sphinx_markdown_tables==0.0.17 sphinx_rtd_theme +tensorflow-probability \ No newline at end of file