-
Notifications
You must be signed in to change notification settings - Fork 90
Make TensorFlow dependencies optional #275
Make TensorFlow dependencies optional #275
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
CI passed in my repo for largely the same requirements list yesterday but pulled in |
|
It turns out Relatedly, should we bump the minimum required Python version in MCT to 3.8 since Python 3.7 reaches end of support in June? |
|
regarding py 3.8 I would ensure first that tfx and all those drop it first |
What does this pull request do?
This pull request creates a basic
model-card-toolkitpackage that supports only core functionality and moves dependencies specific to using MCT with TensorFlow and MLMD to extras. Here, core functionality means creatingModelCardandModelCardToolkitobjects, only manually annotating graphics and performance metrics, and rendering and exporting the model card. In other words, the features needed to run the example notebooks. This change will enable faster installations for developers who aren't working with TensorFlow models and reduce potential dependency conflicts. It will also enable using MCT on Apple Sillicon machines, which are unable to installml-metadata,tensorflow-data-validation, and other TensorFlow extended libraries.What changed
New required dependencies
jinja2: rendering model card templatesjsonschema: validating JSON schemamatplotlib: graphicsprotobuf: working with model card protospip listoutputNew extras
docs: building documentationexamples: running documentation example scriptstensorflow: TensorFlow utilstest: running testsall: everything everywhere all at once except for the docs extraRefactoring and other changes
model_card_toolkittensorflowextra dependencies in dunder initstf_to make it explicit when utils are specific to TensorFlowcore_test.pytocore_tf_test.py--ignore-requires-optional-depsand--fail-if-skippedfor easier testingBackwards incompatible changes to the API
The primary change is that utilities that require optional TensorFlow dependencies are in files prefixed with
tf_.Fixes #93
How did you test this change?
pip install -e ".[test]"and ranmodel_card_toolkit --ignore-requires-optional-deps. Passing--ignore-requires-optional-depstellspytestnot to collect tests that require optional dependencies, based on their file pattern.pip install -e ".[all]"and ranmodel_card_toolkit --fail-if-skipped. In general, tests are marked asskipif they require optional dependencies that aren't installed. Failing skipped tests let us catch when tests are skipped even though all optional dependencies are installed.How did you document this change?
Docstrings and updates to README, contributing guide, and installation guide.
Before submitting
Before submitting a pull request, please be sure to do the following: