-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support converting raw protos through Types.*Proto classes
- Loading branch information
Showing
5 changed files
with
81 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
from flyteidl.plugins.sagemaker import hyperparameter_tuning_job_pb2 as _pb2_hpo_job | ||
from flyteidl.plugins.sagemaker import parameter_ranges_pb2 as _pb2_parameter_ranges | ||
|
||
from flytekit.models.sagemaker import parameter_ranges as _parameter_range_models, hpo_job as _hpo_models | ||
from flytekit.sdk import types as _sdk_types | ||
|
||
HyperparameterTuningJobConfig = _sdk_types.Types.GenericProto(_pb2_hpo_job.HyperparameterTuningJobConfig) | ||
HyperparameterTuningJobConfig = _sdk_types.Types.GenericProto(_hpo_models.HyperparameterTuningJobConfig) | ||
|
||
ParameterRange = _sdk_types.Types.GenericProto(_pb2_parameter_ranges.ParameterRangeOneOf) | ||
ParameterRange = _sdk_types.Types.GenericProto(_parameter_range_models.ParameterRangeOneOf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
from flytekit.contrib.notebook.tasks import python_notebook, spark_notebook | ||
from flytekit.sdk.tasks import inputs, outputs | ||
from flytekit.sdk.types import Types | ||
from flytekit.sdk.workflow import Input, workflow_class | ||
|
||
interactive_python = python_notebook( | ||
notebook_path="../../../../notebook-task-examples/python-notebook.ipynb", | ||
inputs=inputs(pi=Types.Float), | ||
outputs=outputs(out=Types.Float), | ||
cpu_request="1", | ||
memory_request="1G", | ||
) | ||
|
||
interactive_spark = spark_notebook( | ||
notebook_path="../../../../notebook-task-examples/spark-notebook-pi.ipynb", | ||
inputs=inputs(partitions=Types.Integer), | ||
outputs=outputs(pi=Types.Float), | ||
) | ||
|
||
|
||
@workflow_class | ||
class FlyteNotebookSparkWorkflow(object): | ||
partitions = Input(Types.Integer, default=10) | ||
out1 = interactive_spark(partitions=partitions) | ||
out2 = interactive_python(pi=out1.outputs.pi) | ||
# interactive_python = python_notebook( | ||
# notebook_path="../../../../notebook-task-examples/python-notebook.ipynb", | ||
# inputs=inputs(pi=Types.Float), | ||
# outputs=outputs(out=Types.Float), | ||
# cpu_request="1", | ||
# memory_request="1G", | ||
# ) | ||
# | ||
# interactive_spark = spark_notebook( | ||
# notebook_path="../../../../notebook-task-examples/spark-notebook-pi.ipynb", | ||
# inputs=inputs(partitions=Types.Integer), | ||
# outputs=outputs(pi=Types.Float), | ||
# ) | ||
# | ||
# | ||
# @workflow_class | ||
# class FlyteNotebookSparkWorkflow(object): | ||
# partitions = Input(Types.Integer, default=10) | ||
# out1 = interactive_spark(partitions=partitions) | ||
# out2 = interactive_python(pi=out1.outputs.pi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters