From bef783af269859da9720b796ab8898561fa58b71 Mon Sep 17 00:00:00 2001 From: Lahiru Maramba Date: Wed, 1 Feb 2023 13:39:19 -0500 Subject: [PATCH 1/2] chore(ml): Deprecate AutoML model support --- firebase_admin/ml.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/firebase_admin/ml.py b/firebase_admin/ml.py index bcc4b9390..5ab45e041 100644 --- a/firebase_admin/ml.py +++ b/firebase_admin/ml.py @@ -24,6 +24,7 @@ import time import os from urllib import parse +import warnings import requests @@ -388,6 +389,8 @@ def _init_model_source(data): return TFLiteGCSModelSource(gcs_tflite_uri=gcs_tflite_uri) auto_ml_model = data.pop('automlModel', None) if auto_ml_model: + warnings.warn('AutoML model support is deprecated and will be removed in the next ' + 'major version.', DeprecationWarning) return TFLiteAutoMlSource(auto_ml_model=auto_ml_model) return None @@ -604,9 +607,14 @@ def as_dict(self, for_upload=False): class TFLiteAutoMlSource(TFLiteModelSource): - """TFLite model source representing a tflite model created with AutoML.""" + """TFLite model source representing a tflite model created with AutoML. + + AutoML model support is deprecated and will be removed in the next major version. + """ def __init__(self, auto_ml_model, app=None): + warnings.warn('AutoML model support is deprecated and will be removed in the next ' + 'major version.', DeprecationWarning) self._app = app self.auto_ml_model = auto_ml_model From 4195257e22e80885b2b875a2fd6de34dd6e9470c Mon Sep 17 00:00:00 2001 From: Lahiru Maramba Date: Wed, 1 Feb 2023 13:48:38 -0500 Subject: [PATCH 2/2] fix lint --- firebase_admin/ml.py | 1 + 1 file changed, 1 insertion(+) diff --git a/firebase_admin/ml.py b/firebase_admin/ml.py index 5ab45e041..98bdbb56a 100644 --- a/firebase_admin/ml.py +++ b/firebase_admin/ml.py @@ -384,6 +384,7 @@ def __ne__(self, other): @staticmethod def _init_model_source(data): + """Initialize the ML model source.""" gcs_tflite_uri = data.pop('gcsTfliteUri', None) if gcs_tflite_uri: return TFLiteGCSModelSource(gcs_tflite_uri=gcs_tflite_uri)