fix(ocr): narrow exception handling and add unit tests for ensure_blla_model
- _model_is_loadable: narrow bare except to (RuntimeError, OSError, ValueError) with DEBUG-level fallback for unexpected exceptions — prevents silent masking of missing kraken install or AttributeError on vgsl - _run_segtrain: replace bare except:pass with log.warning so height-check fallback is visible in container logs - New test_ensure_blla_model.py: covers model-OK early return, incompatible model rename+replace, and missing model download paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -494,8 +494,8 @@ async def segtrain_model(
|
||||
"will train from scratch at 800px",
|
||||
_m.input[2],
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as exc:
|
||||
log.warning("Could not inspect base model height, training from scratch: %s", exc)
|
||||
|
||||
if use_base_model:
|
||||
cmd += ["-i", blla_model_path, "--resize", "union", "-s", seg_spec]
|
||||
|
||||
Reference in New Issue
Block a user