Skip to content

Commit

Permalink
CU-8693u6b4u: Make deid tests run with cpu-only torch
Browse files Browse the repository at this point in the history
  • Loading branch information
mart-r committed Feb 13, 2024
1 parent 5927b25 commit 58d4e93
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ types-aiofiles==0.8.3
types-PyYAML==6.0.3
types-setuptools==57.4.10
timeout-decorator==0.5.0
instld~=0.0.24
24 changes: 15 additions & 9 deletions tests/utils/ner/test_deid.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
from medcat.utils.ner import deid
from medcat.utils.ner import make_or_update_cdb
import instld

from medcat.ner import transformers_ner
from .helper import TORCH_VERSION, CPU_ONLY_TORCH_URL

from spacy.tokens import Doc, Span
with instld('torch==' + TORCH_VERSION, catch_output=True,
index_url=CPU_ONLY_TORCH_URL):
from medcat.utils.ner import make_or_update_cdb

from typing import Any, List, Tuple
import os
import json
import tempfile
from medcat.ner import transformers_ner

import unittest
import timeout_decorator
from spacy.tokens import Doc, Span

from typing import Any, List, Tuple
import os
import json
import tempfile

import unittest
import timeout_decorator

FILE_DIR = os.path.dirname(os.path.realpath(__file__))

Expand Down

0 comments on commit 58d4e93

Please sign in to comment.