Skip to content

Commit 68001d9

Browse files
change(ml): Deprecate AutoML model support (#670)
* chore(ml): Deprecate AutoML model support * fix lint
1 parent 18714fb commit 68001d9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

firebase_admin/ml.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import time
2525
import os
2626
from urllib import parse
27+
import warnings
2728

2829
import requests
2930

@@ -383,11 +384,14 @@ def __ne__(self, other):
383384

384385
@staticmethod
385386
def _init_model_source(data):
387+
"""Initialize the ML model source."""
386388
gcs_tflite_uri = data.pop('gcsTfliteUri', None)
387389
if gcs_tflite_uri:
388390
return TFLiteGCSModelSource(gcs_tflite_uri=gcs_tflite_uri)
389391
auto_ml_model = data.pop('automlModel', None)
390392
if auto_ml_model:
393+
warnings.warn('AutoML model support is deprecated and will be removed in the next '
394+
'major version.', DeprecationWarning)
391395
return TFLiteAutoMlSource(auto_ml_model=auto_ml_model)
392396
return None
393397

@@ -604,9 +608,14 @@ def as_dict(self, for_upload=False):
604608

605609

606610
class TFLiteAutoMlSource(TFLiteModelSource):
607-
"""TFLite model source representing a tflite model created with AutoML."""
611+
"""TFLite model source representing a tflite model created with AutoML.
612+
613+
AutoML model support is deprecated and will be removed in the next major version.
614+
"""
608615

609616
def __init__(self, auto_ml_model, app=None):
617+
warnings.warn('AutoML model support is deprecated and will be removed in the next '
618+
'major version.', DeprecationWarning)
610619
self._app = app
611620
self.auto_ml_model = auto_ml_model
612621

0 commit comments

Comments
 (0)