Skip to content

Package building/Installation error #3

@Aliasgarsaifee

Description

@Aliasgarsaifee

Can @karthik-mb you help me with packaging it and installing from source.
Tried installing via - pip install git+https://github.com/Kenpath/indic-text-normalization.git@main

But then getting import errors. Most probably issue with setup.py file.

from indic_text_normalization import Normalizer
Normalizer(lang="en")
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[2], line 2
      1 from indic_text_normalization import Normalizer
----> 2 Normalizer(lang="en")

File ~/.virtualenvs/venv/lib/python3.11/site-packages/indic_text_normalization/normalize.py:131, in Normalizer.__init__(self, input_case, lang, cache_dir, overwrite_cache, whitelist, post_process, max_number_of_permutations_per_split)
    128 base_path = f'indic_text_normalization.{lang}'
    130 # Load tagger
--> 131 tagger_module = importlib.import_module(f'{base_path}.taggers.tokenize_and_classify')
    132 ClassifyFst = tagger_module.ClassifyFst
    134 # Load verbalizer

File /opt/conda/lib/python3.11/importlib/__init__.py:126, in import_module(name, package)
    124             break
    125         level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)

File <frozen importlib._bootstrap>:1204, in _gcd_import(name, package, level)

File <frozen importlib._bootstrap>:1176, in _find_and_load(name, import_)

File <frozen importlib._bootstrap>:1147, in _find_and_load_unlocked(name, import_)

File <frozen importlib._bootstrap>:690, in _load_unlocked(spec)

File <frozen importlib._bootstrap_external>:940, in exec_module(self, module)

File <frozen importlib._bootstrap>:241, in _call_with_frames_removed(f, *args, **kwds)

File ~/.virtualenvs/venv/lib/python3.11/site-packages/indic_text_normalization/en/taggers/tokenize_and_classify.py:21
     18 import pynini
     19 from pynini.lib import pynutil
---> 21 from indic_text_normalization.en.graph_utils import (
     22     NEMO_WHITE_SPACE,
     23     GraphFst,
     24     delete_extra_space,
     25     delete_space,
     26     generator_main,
     27 )
     28 from indic_text_normalization.en.taggers.abbreviation import AbbreviationFst
     29 from indic_text_normalization.en.taggers.cardinal import CardinalFst

File ~/.virtualenvs/venv/lib/python3.11/site-packages/indic_text_normalization/en/__init__.py:15
      1 # Copyright (c) 2021, NVIDIA CORPORATION.  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 indic_text_normalization.en.taggers.tokenize_and_classify import ClassifyFst
     16 from indic_text_normalization.en.verbalizers.verbalize import VerbalizeFst
     17 from indic_text_normalization.en.verbalizers.verbalize_final import VerbalizeFinalFst

ImportError: cannot import name 'ClassifyFst' from partially initialized module 'indic_text_normalization.en.taggers.tokenize_and_classify' (most likely due to a circular import) (/home/jovyan/.virtualenvs/venv/lib/python3.11/site-packages/indic_text_normalization/en/taggers/tokenize_and_classify.py)

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