You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched the issues and found no similar issues.
Component
Transforms/Other
What happened + What you expected to happen
ImportError Traceback (most recent call last)
Cell In[4], line 1
----> 1 from dpk_pii_redactor.transform_python import PIIRedactor
File ~\OneDrive\Documents\GitHub\data-prep-kit\transforms\language\pii_redactor\dpk_pii_redactor_init_.py:1
----> 1 from .transform import *
File ~\OneDrive\Documents\GitHub\data-prep-kit\transforms\language\pii_redactor\dpk_pii_redactor\transform.py:24
22 from data_processing.transform import AbstractTableTransform, TransformConfiguration
23 from data_processing.utils import CLIArgumentProvider, TransformUtils, get_logger
---> 24 from dpk_pii_redactor.pii_analyzer import PIIAnalyzerEngine
25 from dpk_pii_redactor.pii_anonymizer import PIIAnonymizer
28 short_name = "pii_redactor"
File ~\OneDrive\Documents\GitHub\data-prep-kit\transforms\language\pii_redactor\dpk_pii_redactor\pii_analyzer.py:15
12 import logging
14 import spacy
---> 15 from dpk_pii_redactor.flair_recognizer import FlairRecognizer
16 from presidio_analyzer import AnalyzerEngine, RecognizerRegistry
17 from presidio_analyzer.nlp_engine import NlpEngineProvider
File ~\OneDrive\Documents\GitHub\data-prep-kit\transforms\language\pii_redactor\dpk_pii_redactor\flair_recognizer.py:20
17 from typing import List, Optional, Set, Tuple
19 from data_processing.utils import get_logger
---> 20 from flair.data import Sentence
21 from flair.models import SequenceTagger
22 from presidio_analyzer import AnalysisExplanation, EntityRecognizer, RecognizerResult
File ~\anaconda3\Lib\site-packages\flair\__init__.py:6
3 from pathlib import Path
5 import torch
----> 6 from transformers import set_seed as hf_set_seed
8 # global variable: cache_root
9 from .file_utils import set_proxies
File ~\AppData\Roaming\Python\Python312\site-packages\transformers\__init__.py:26
23 from typing import TYPE_CHECKING
25 # Check the dependencies satisfy the minimal versions required.
---> 26 from . import dependency_versions_check
27 from .utils import (
28 OptionalDependencyNotAvailable,
29 _LazyModule,
(...)
48 logging,
49 )
52 logger = logging.get_logger(__name__) # pylint: disable=invalid-name
File ~\AppData\Roaming\Python\Python312\site-packages\transformers\dependency_versions_check.py:16
1 # Copyright 2020 The HuggingFace Team. All rights reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
(...)
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 from .dependency_versions_table import deps
---> 16 from .utils.versions import require_version, require_version_core
19 # define which module versions we always want to check at run time
20 # (usually the ones defined in `install_requires` in setup.py)
21 #
22 # order specific notes:
23 # - tqdm must be checked before tokenizers
25 pkgs_to_check_at_runtime = [
26 "python",
27 "tqdm",
(...)
37 "pyyaml",
38 ]
File ~\AppData\Roaming\Python\Python312\site-packages\transformers\utils\__init__.py:27
25 from .. import __version__
26 from .backbone_utils import BackboneConfigMixin, BackboneMixin
---> 27 from .chat_template_utils import DocstringParsingException, TypeHintParsingException, get_json_schema
28 from .constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD
29 from .doc import (
30 add_code_sample_docstrings,
31 add_end_docstrings,
(...)
35 replace_return_docstrings,
36 )
File ~\AppData\Roaming\Python\Python312\site-packages\transformers\utils\chat_template_utils.py:39
36 from PIL.Image import Image
38 if is_torch_available():
---> 39 from torch import Tensor
42 BASIC_TYPES = (int, float, str, bool, Any, type(None), ...)
43 # Extracts the initial segment of the docstring, containing the function description
ImportError: cannot import name 'Tensor' from 'torch' (unknown location)
Reproduction script
On Windows 11, start Conda Navigator with python 3.12 and run the pii redactor notebook from here:
data-prep-kit/transforms/language/pii_redactor/piiredactor.ipynb
Anything else
No response
OS
Windows WSL
Python
Other
Are you willing to submit a PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Search before asking
Component
Transforms/Other
What happened + What you expected to happen
ImportError Traceback (most recent call last)
Cell In[4], line 1
----> 1 from dpk_pii_redactor.transform_python import PIIRedactor
File ~\OneDrive\Documents\GitHub\data-prep-kit\transforms\language\pii_redactor\dpk_pii_redactor_init_.py:1
----> 1 from .transform import *
Reproduction script
On Windows 11, start Conda Navigator with python 3.12 and run the pii redactor notebook from here:
data-prep-kit/transforms/language/pii_redactor/piiredactor.ipynb
Anything else
No response
OS
Windows WSL
Python
Other
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: