我将输出数据保存为 Sagemaker 管道中训练步骤的一部分。其中一些数据稍后用于另一个步骤进行评估,而不是模型。有什么办法可以获取执行前的路径吗?管道变量就足够了。任何可以让我指向 s3 数据路径以供以后用作ProcessingInput 的东西。 示例:
estimator = HuggingFace(
py_version="py310",
entry_point="entrypoint.py",
source_dir=os.path.join("code", "nlp", "train"),
transformers_version="4.28.1",
pytorch_version="2.0.0",
sagemaker_session=session,
role=role,
instance_count=1,
instance_type="ml.p3.2xlarge",
)
step_train = TrainingStep(
name="TrainHuggingFaceModel",
estimator=estimator,
inputs={
"data": TrainingInput(s3_data="PathToData"),
},
cache_config=CACHE_CONFIG,
)
从训练步骤中,我想获得训练输出。如果这不起作用,还有其他建议吗? :)
您可以参考步骤输出例如:
step_process.properties.ProcessingOutputConfig.Outputs["train_data"].S3Output.S3Uri