浏览代码

fix formula rec export with pir

zhangyubo0722 10 月之前
父节点
当前提交
194a37999e
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      paddlex/repo_apis/PaddleOCR_api/formula_rec/model.py

+ 6 - 0
paddlex/repo_apis/PaddleOCR_api/formula_rec/model.py

@@ -135,8 +135,11 @@ class FormulaRecModel(BaseModel):
         # PDX related settings
         device_type = device.split(":")[0]
         uniform_output_enabled = kwargs.pop("uniform_output_enabled", True)
+        export_with_pir = kwargs.pop("export_with_pir", False)
         config.update({"Global.uniform_output_enabled": uniform_output_enabled})
         config.update({"Global.pdx_model_name": self.name})
+        if export_with_pir:
+            config.update({"Global.export_with_pir": export_with_pir})
 
         self._assert_empty_kwargs(kwargs)
 
@@ -269,8 +272,11 @@ class FormulaRecModel(BaseModel):
 
         # PDX related settings
         uniform_output_enabled = kwargs.pop("uniform_output_enabled", True)
+        export_with_pir = kwargs.pop("export_with_pir", False)
         config.update({"Global.uniform_output_enabled": uniform_output_enabled})
         config.update({"Global.pdx_model_name": self.name})
+        if export_with_pir:
+            config.update({"Global.export_with_pir": export_with_pir})
 
         self._assert_empty_kwargs(kwargs)