Commit 67715001 authored by myhloli's avatar myhloli
Browse files

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

fix: update environment variable names for formula and table enable in common.py and vlm_middle_json_mkcontent.py
parent 804a3cd6
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:
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment