Skip to content

layout() does not seem to respect spacy.require_cpu() #37

@marioangst

Description

@marioangst

I am trying to use spacy-layout (0.0.12) and spacy (3.8.4) on CPU for testing on an older machine. I am getting an OOM memory "CUDA out of memory (...)" when running (with a small test set of 14 files):

import spacy
from spacy_layout import spaCyLayout

spacy.require_cpu()
nlp = spacy.blank("en")

filepaths = <list of 14 filepaths>

docs = layout.pipe(filepaths)
for doc in docs:
    print(doc.text)

returns: "torch.OutOfMemoryError: CUDA out of memory. Tried to allocate (...)"

Does spacy-layout always require a GPU? https://explosion.ai/blog/pdfs-nlp-structured-data talks about how "Docling runs at 1-3 pages per second on CPU (...)", which is why I thought this might work on CPU.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions