Commit b6710b99 authored by myhloli's avatar myhloli
Browse files

fix(magic_pdf): correct batch ratio conditions for GPU memory

- Update conditions for batch ratio assignment:
  -8 <= gpu_memory < 10: batch_ratio = 2 - 10 <= gpu_memory <= 12: batch_ratio =4
- This fix ensures proper batch ratio selection for GPU memory sizes
parent 55447c8b
...@@ -178,9 +178,9 @@ def doc_analyze( ...@@ -178,9 +178,9 @@ def doc_analyze(
gpu_memory = int(os.getenv("VIRTUAL_VRAM_SIZE", round(get_vram(device)))) gpu_memory = int(os.getenv("VIRTUAL_VRAM_SIZE", round(get_vram(device))))
if gpu_memory is not None and gpu_memory >= 8: if gpu_memory is not None and gpu_memory >= 8:
if 8 <= gpu_memory <= 10: if 8 <= gpu_memory < 10:
batch_ratio = 2 batch_ratio = 2
elif 10 < gpu_memory <= 12: elif 10 <= gpu_memory <= 12:
batch_ratio = 4 batch_ratio = 4
elif 12 < gpu_memory <= 16: elif 12 < gpu_memory <= 16:
batch_ratio = 8 batch_ratio = 8
......
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