Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

_utils.py 867 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  1. # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  2. # SPDX-License-Identifier: MIT-0
  3. """Provides utilities for SageMaker Pipeline CLI."""
  4. from __future__ import absolute_import
  5. import ast
  6. def get_pipeline_driver(module_name, passed_args=None):
  7. """Gets the driver for generating your pipeline definition.
  8. Pipeline modules must define a get_pipeline() module-level method.
  9. Args:
  10. module_name: The module name of your pipeline.
  11. passed_args: Optional passed arguments that your pipeline may be templated by.
  12. Returns:
  13. The SageMaker Workflow pipeline.
  14. """
  15. _imports = __import__(module_name, fromlist=["get_pipeline"])
  16. kwargs = convert_struct(passed_args)
  17. return _imports.get_pipeline(**kwargs)
  18. def convert_struct(str_struct=None):
  19. return ast.literal_eval(str_struct) if str_struct else {}
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...