MCPcopy Create free account
hub / github.com/NatsUIJM/autoContents / run_batch_processing

Function run_batch_processing

mainprogress/qwen_vl_extract.py:435–452  ·  view source on GitHub ↗
(image_files: list, output_path: Path)

Source from the content-addressed store, hash-verified

433 LLM_CONFIG = load_llm_config()
434
435 # 初始化 OpenAI 客户端 (兼容模式)
436 client = AsyncOpenAI(
437 api_key=LLM_CONFIG["api_key"],
438 base_url=LLM_CONFIG["base_url"]
439 )
440
441 base_dir = os.getenv("BASE_DIR")
442 if base_dir:
443 input_path = Path(base_dir) / "mark" / "input_image"
444 output_path = Path(base_dir) / "raw_content"
445 else:
446 input_path_str = os.getenv("QWEN_VL_EXTRACT_INPUT")
447 output_path_str = os.getenv("QWEN_VL_EXTRACT_OUTPUT")
448
449 if not input_path_str or not output_path_str:
450 print("错误:未设置必要的环境变量 QWEN_VL_EXTRACT_INPUT 或 QWEN_VL_EXTRACT_OUTPUT")
451 sys.exit(1)
452
453 input_path = Path(input_path_str)
454 output_path = Path(output_path_str)
455

Callers 1

main_asyncFunction · 0.70

Calls 3

process_image_asyncFunction · 0.85
write_logFunction · 0.70
get_encoded_imageFunction · 0.70

Tested by

no test coverage detected