提交 d2b8bcf5 编写于 作者: T tangwei

add internal data

上级 761d2d69
......@@ -18,6 +18,7 @@ import sys
from fleetrec.core.utils.envs import lazy_instance
from fleetrec.core.utils.envs import get_global_env
from fleetrec.core.utils.envs import get_runtime_environ
def dataloader(readerclass, train, yaml_file):
......@@ -30,6 +31,11 @@ def dataloader(readerclass, train, yaml_file):
reader_name = "EvaluateReader"
data_path = get_global_env("test_data_path", None, namespace)
if data_path.startswith("fleetrec::"):
package_base = get_runtime_environ("PACKAGE_BASE")
assert package_base is not None
data_path = os.path.join(package_base, data_path.split("::")[1])
files = [str(data_path) + "/%s" % x for x in os.listdir(data_path)]
reader_class = lazy_instance(readerclass, reader_name)
......@@ -50,4 +56,5 @@ def dataloader(readerclass, train, yaml_file):
for pased in parsed_line:
values.append(pased[1])
yield values
return gen_reader
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册