Selaa lähdekoodia

fix: update environment variable names for formula and table enable in common.py and vlm_middle_json_mkcontent.py

myhloli 4 kuukautta sitten
vanhempi
commit
67715001cf
2 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. 3 3
      mineru/backend/vlm/vlm_middle_json_mkcontent.py
  2. 4 4
      mineru/cli/common.py

+ 3 - 3
mineru/backend/vlm/vlm_middle_json_mkcontent.py

@@ -1,6 +1,6 @@
 import os
 
-from mineru.utils.config_reader import get_latex_delimiter_config
+from mineru.utils.config_reader import get_latex_delimiter_config, get_formula_enable, get_table_enable
 from mineru.utils.enum_class import MakeMode, BlockType, ContentType
 
 
@@ -188,8 +188,8 @@ def union_make(pdf_info_dict: list,
                img_buket_path: str = '',
                ):
 
-    formula_enable = os.getenv('MINERU_FORMULA_ENABLE', 'True').lower() == 'true'
-    table_enable = os.getenv('MINERU_TABLE_ENABLE', 'True').lower() == 'true'
+    formula_enable = get_formula_enable(os.getenv('MINERU_VLM_FORMULA_ENABLE', 'True').lower() == 'true')
+    table_enable = get_table_enable(os.getenv('MINERU_VLM_TABLE_ENABLE', 'True').lower() == 'true')
 
     output_content = []
     for page_info in pdf_info_dict:

+ 4 - 4
mineru/cli/common.py

@@ -326,8 +326,8 @@ def do_parse(
         if backend.startswith("vlm-"):
             backend = backend[4:]
 
-        os.environ['MINERU_FORMULA_ENABLE'] = str(formula_enable)
-        os.environ['MINERU_TABLE_ENABLE'] = str(table_enable)
+        os.environ['MINERU_VLM_FORMULA_ENABLE'] = str(formula_enable)
+        os.environ['MINERU_VLM_TABLE_ENABLE'] = str(table_enable)
 
         _process_vlm(
             output_dir, pdf_file_names, pdf_bytes_list, backend,
@@ -373,8 +373,8 @@ async def aio_do_parse(
         if backend.startswith("vlm-"):
             backend = backend[4:]
 
-        os.environ['MINERU_FORMULA_ENABLE'] = str(formula_enable)
-        os.environ['MINERU_TABLE_ENABLE'] = str(table_enable)
+        os.environ['MINERU_VLM_FORMULA_ENABLE'] = str(formula_enable)
+        os.environ['MINERU_VLM_TABLE_ENABLE'] = str(table_enable)
 
         await _async_process_vlm(
             output_dir, pdf_file_names, pdf_bytes_list, backend,