瀏覽代碼

fix: prevent server URL assignment for non-client backends in VLM processing

myhloli 4 月之前
父節點
當前提交
86391acf28
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      mineru/cli/common.py

+ 4 - 0
mineru/cli/common.py

@@ -229,6 +229,8 @@ async def _async_process_vlm(
     """异步处理VLM后端逻辑"""
     """异步处理VLM后端逻辑"""
     parse_method = "vlm"
     parse_method = "vlm"
     f_draw_span_bbox = False
     f_draw_span_bbox = False
+    if not backend.endswith("client"):
+        server_url = None
 
 
     for idx, pdf_bytes in enumerate(pdf_bytes_list):
     for idx, pdf_bytes in enumerate(pdf_bytes_list):
         pdf_file_name = pdf_file_names[idx]
         pdf_file_name = pdf_file_names[idx]
@@ -267,6 +269,8 @@ def _process_vlm(
     """同步处理VLM后端逻辑"""
     """同步处理VLM后端逻辑"""
     parse_method = "vlm"
     parse_method = "vlm"
     f_draw_span_bbox = False
     f_draw_span_bbox = False
+    if not backend.endswith("client"):
+        server_url = None
 
 
     for idx, pdf_bytes in enumerate(pdf_bytes_list):
     for idx, pdf_bytes in enumerate(pdf_bytes_list):
         pdf_file_name = pdf_file_names[idx]
         pdf_file_name = pdf_file_names[idx]