import os import sys from project_config import settings, DEFAULT_MODEL_DIR now_dir = os.getcwd() sys.path.insert(0, now_dir) from text.g2pw import G2PWPinyin g2pw = G2PWPinyin( model_dir=DEFAULT_MODEL_DIR / "G2PWModel", model_source=settings.BERT_PRETRAINED_DIR, v_to_u=False, neutral_tone_with_five=True, )