AI开发平台MODELARTS-配置Workflow参数:使用案例

时间:2024-08-16 20:39:02

使用案例

  • int类型参数
    from modelarts import workflow as wf
    wf.Placeholder(name="placeholder_int", placeholder_type=wf.PlaceholderType.INT, default=1, description="这是一个int类型的参数")
  • str类型参数
    from modelarts import workflow as wf
    wf.Placeholder(name="placeholder_str", placeholder_type=wf.PlaceholderType.STR, default="default_value", description="这是一个str类型的参数")
  • bool类型参数
    from modelarts import workflow as wf
    wf.Placeholder(name="placeholder_bool", placeholder_type=wf.PlaceholderType.BOOL, default=True, description="这是一个bool类型的参数")
  • float类型参数
    from modelarts import workflow as wf
    wf.Placeholder(name="placeholder_float", placeholder_type=wf.PlaceholderType.FLOAT, default=0.1, description="这是一个float类型的参数")
  • Enum类型参数
    from modelarts import workflow as wf
    wf.Placeholder(name="placeholder_enum", placeholder_type=wf.PlaceholderType.ENUM, default="a", enum_list=["a", "b"], description="这是一个enum类型的参数")
  • dict类型参数
    from modelarts import workflow as wf
    wf.Placeholder(name="placeholder_dict", placeholder_type=wf.PlaceholderType.JSON, default={"key": "value"}, description="这是一个dict类型的参数")
  • list类型参数
    from modelarts import workflow as wf
    wf.Placeholder(name="placeholder_list", placeholder_type=wf.PlaceholderType.LIST, default=[1, 2], placeholder_format="int", description="这是一个list类型的参数,并且value类型为int")
support.huaweicloud.com/usermanual-standard-modelarts/modelarts_workflow_0353.html