chore: Clean up blank lines across multiple files to enhance readability

- Removed excessive blank lines in various Python scripts, markdown files, and configuration files to improve overall code clarity and maintainability.
- Ensured consistent formatting throughout the project, contributing to a more organized codebase.
This commit is contained in:
Your Name committed 2025-12-31 17:00:58 +08:00
1 parent ace3bbfa04
commit 07c387751d
62 files changed
+2432 -1734

No files matched your search

+9 -1
View File
@@ -14,7 +14,15 @@ from typing import Any, Optional
os.environ.setdefault("DISABLE_MODEL_SOURCE_CHECK", "True")
# 额外抑制 paddle/oneDNN/glog 的冗余信息(INFO/WARNING)
os.environ.setdefault("GLOG_minloglevel", "2")
os.environ.setdefault("OMP_NUM_THREADS", "1")
# 优化OMP_NUM_THREADS:允许底层库使用多线程,但不要设置太高避免线程竞争
# 设置为CPU核心数的一半,平衡性能和资源使用
import os as os_module
cpu_count = os_module.cpu_count() or 4
# 对于OCR任务,每个线程内部会使用多个OMP线程,所以设置为2-4比较合适
# 如果CPU核心数>=8,设置为4;否则设置为2
optimal_omp_threads = min(4, max(2, cpu_count // 3))
os.environ.setdefault("OMP_NUM_THREADS", str(optimal_omp_threads))
class OCRProcessor: