Skip to content

Commit

Permalink
Merge pull request #13 from zentrum-lexikographie/fix/gpu-use
Browse files Browse the repository at this point in the history
fix(preprocessing): Instruct spacy to use gpu if available
  • Loading branch information
knit-bee authored Jan 8, 2025
2 parents 7f45a1e + 3d21d68 commit aed9fd8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wordprofile/preprocessing/cli/annotate_deprel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time
from datetime import datetime
from typing import Iterable, Iterator

import click
import conllu
import spacy
Expand Down Expand Up @@ -87,6 +88,7 @@ def main(input, output, model, batch_size):
"Processing corpus %s with %s model (batch size: %d)."
% (input_file, model, batch_size)
)
spacy.prefer_gpu()
parser = SpacyParser(model=model, batch_size=batch_size)

start = time.time()
Expand Down

0 comments on commit aed9fd8

Please sign in to comment.