• Stefy Lanza (nextime / spora )'s avatar
    ocr: no engine moves GPU work to the CPU on its own · 52dfaca3
    Stefy Lanza (nextime / spora ) authored
    docTR called .cuda() when torch happened to see a card and otherwise simply
    stayed on the CPU, so a GPU-less install read every page many times slower
    with nothing in the response to say why — the result looked normal, it just
    arrived minutes late. Nothing else in coderai quietly relocates GPU work, and
    paddle refuses outright in exactly this situation; docTR was the odd one out.
    
    `doctr_use_gpu` is now a requirement: no CUDA device means a 503 that names
    the setting. Running docTR on the CPU is still fully supported and unchanged —
    it just has to be asked for, with doctr_use_gpu = false.
    
    The test drives the real load() with docTR and torch stubbed, rather than
    re-implementing the placement rules beside it; reintroducing the fallback
    makes it fail, which is the only reason to trust it.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01PxYHWbCAjjjD7A1rhFKtaW
    52dfaca3
doctr.py 5.14 KB