ModelZoo.load_model: avoid attempting to load exported models as Keras

models (which causes a warning), but switch to TF-Serving import right away
This commit is contained in:
Robert Sachunsky 2026-05-21 02:41:19 +02:00
parent 7f2bf715df
commit 94a5e9da14

View file

@ -189,7 +189,8 @@ class EynollahModelZoo:
self.override_models((model_category, model_variant, model_path_override)) self.override_models((model_category, model_variant, model_path_override))
model_path = self.model_path(model_category, model_variant) model_path = self.model_path(model_category, model_variant)
try: try:
# avoid wasting VRAM on non-transformer models if model_path.is_dir() and not (model_path / "keras_metadata.pb").exists():
raise ValueError()
model = load_model(model_path, compile=False) model = load_model(model_path, compile=False)
model.make_predict_function() model.make_predict_function()
except (AttributeError, ValueError): except (AttributeError, ValueError):