Skip to content

Commit

Permalink
Sklearn type transformer should be automatically loaded with import f…
Browse files Browse the repository at this point in the history
…lytekit (#1423)

* add flytekit.extras.sklearn to main __init__ import

Signed-off-by: Niels Bantilan <[email protected]>

* fix docs

Signed-off-by: Niels Bantilan <[email protected]>

* add temporary docs/requirements.txt for onnx plugins

Signed-off-by: Niels Bantilan <[email protected]>

---------

Signed-off-by: Niels Bantilan <[email protected]>
  • Loading branch information
cosmicBboy authored and eapolinario committed Feb 22, 2023
1 parent 3e68e2b commit 4c3f8b3
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ sphinx:
python:
install:
- requirements: doc-requirements.txt
- requirements: docs/requirements.txt
7 changes: 7 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# TODO: Remove after buf migration is done and packages updated, see doc-requirements.in
# skl2onnx and tf2onnx added here so that the plugin API reference is rendered,
# with the caveat that the docs build environment has the environment variable
# PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python set so that protobuf can be parsed
# using Python, which is acceptable for docs building.
skl2onnx
tf2onnx
2 changes: 1 addition & 1 deletion flytekit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
from flytekit.core.workflow import ImperativeWorkflow as Workflow
from flytekit.core.workflow import WorkflowFailurePolicy, reference_workflow, workflow
from flytekit.deck import Deck
from flytekit.extras import pytorch, tensorflow
from flytekit.extras import pytorch, sklearn, tensorflow
from flytekit.extras.persistence import GCSPersistence, HttpPersistence, S3Persistence
from flytekit.loggers import logger
from flytekit.models.common import Annotations, AuthRole, Labels
Expand Down
5 changes: 3 additions & 2 deletions flytekit/extras/pytorch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"""
Flytekit PyTorch
=========================================
.. currentmodule:: flytekit.extras.pytorch
.. autosummary::
:template: custom.rst
:toctree: generated/
PyTorchCheckpoint
PyTorchCheckpointTransformer
PyTorchModuleTransformer
PyTorchTensorTransformer
"""
from flytekit.loggers import logger

Expand Down
4 changes: 2 additions & 2 deletions flytekit/extras/sklearn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
Flytekit Sklearn
=========================================
.. currentmodule:: flytekit.extras.sklearn
.. autosummary::
:template: custom.rst
:toctree: generated/
SklearnEstimatorTransformer
"""
from flytekit.loggers import logger

Expand Down
11 changes: 11 additions & 0 deletions flytekit/extras/tensorflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
"""
.. currentmodule:: flytekit.extras.tensorflow
.. autosummary::
:template: custom.rst
:toctree: generated/
TensorFlowRecordFileTransformer
TensorFlowRecordsDirTransformer
"""

from flytekit.loggers import logger

# TODO: abstract this out so that there's an established pattern for registering plugins
Expand Down

0 comments on commit 4c3f8b3

Please sign in to comment.