From a01bef338e7de9fb675d7eb4f45c45fc6a34b1c7 Mon Sep 17 00:00:00 2001 From: tangwei Date: Wed, 29 Apr 2020 19:47:46 +0800 Subject: [PATCH] add internal data --- demo/ctr-dnn_train.yaml | 2 +- fleet_rec/run.py | 3 +++ setup.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/demo/ctr-dnn_train.yaml b/demo/ctr-dnn_train.yaml index 8fd0c3f6..0f49138c 100644 --- a/demo/ctr-dnn_train.yaml +++ b/demo/ctr-dnn_train.yaml @@ -22,7 +22,7 @@ train: reader: batch_size: 2 class: "fleetrec.models.rank.criteo_reader" - train_data_path: "models/rank/dnn/data/train" + train_data_path: "fleetrec::models/rank/dnn/data/train" model: models: "fleetrec.models.rank.dnn.model" diff --git a/fleet_rec/run.py b/fleet_rec/run.py index a2fe2428..bed88bae 100644 --- a/fleet_rec/run.py +++ b/fleet_rec/run.py @@ -183,6 +183,9 @@ if __name__ == "__main__": raise IOError("argument model: {} do not exist".format(args.model)) engine_registry() + abs_dir = os.path.dirname(os.path.abspath(__file__)) + envs.set_runtime_environs({"PACKAGE_BASE": abs_dir}) + which_engine = get_engine(args.engine, args.device) engine = which_engine(args) diff --git a/setup.py b/setup.py index 15115444..84091b67 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,8 @@ def build(dirname): packages = find_packages(dirname, include=('fleetrec.*')) package_dir = {'': dirname} + package_data = {'fleetrec.models.rank.dnn': ['data/*/*.txt'], } + setup( name=about["__title__"], version=about["__version__"], @@ -60,6 +62,7 @@ def build(dirname): url=about["__url__"], packages=packages, package_dir=package_dir, + package_data=package_data, python_requires=">=2.7", install_requires=requires, zip_safe=False -- GitLab