From 380f59ad675717145e4512c5ed9b9d361c4d6249 Mon Sep 17 00:00:00 2001 From: vahid Date: Tue, 18 Apr 2023 15:06:18 +0200 Subject: [PATCH] let hybrid textline light model be loaded --- qurator/eynollah/eynollah.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qurator/eynollah/eynollah.py b/qurator/eynollah/eynollah.py index 1346672..4fecfed 100644 --- a/qurator/eynollah/eynollah.py +++ b/qurator/eynollah/eynollah.py @@ -665,8 +665,12 @@ class Eynollah: if model_dir in self.models: model = self.models[model_dir] else: - model = load_model(model_dir, compile=False) - self.models[model_dir] = model + try: + model = load_model(model_dir, compile=False) + self.models[model_dir] = model + except: + model = load_model(model_dir , compile=False,custom_objects = {"PatchEncoder": PatchEncoder, "Patches": Patches}) + self.models[model_dir] = model return model, None