Prechádzať zdrojové kódy

feat: 注释掉模型名称的断言,允许使用其他模型配置

zhch158_admin 2 týždňov pred
rodič
commit
1859b996df

+ 3 - 3
paddlex/inference/pipelines/paddleocr_vl/pipeline.py

@@ -93,9 +93,9 @@ class _PaddleOCRVLPipeline(BasePipeline):
                 {"model_config_error": "config error for layout_det_model!"},
             )
             model_name = layout_det_config.get("model_name", None)
-            assert (
-                model_name is not None and model_name == "PP-DocLayoutV2"
-            ), "model_name must be PP-DocLayoutV2"
+            # assert (
+            #     model_name is not None and model_name == "PP-DocLayoutV2"
+            # ), "model_name must be PP-DocLayoutV2"
             layout_kwargs = {}
             if (threshold := layout_det_config.get("threshold", None)) is not None:
                 layout_kwargs["threshold"] = threshold