mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-26 07:39:22 +02:00
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:
parent
7f2bf715df
commit
94a5e9da14
1 changed files with 2 additions and 1 deletions
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue