dki-lab / Pangu

Code for reproducing the ACL'23 paper: Don't Generate, Discriminate: A Proposal for Grounding Language Models to Real-World Environments
https://arxiv.org/abs/2212.09736
71 stars 10 forks source link

ModuleNotFoundError: No module named 'utils.my_pretrained_transformer_indexer' #5

Closed AiRyunn closed 1 year ago

AiRyunn commented 1 year ago

Hi, I was trying to run the following command from the doc:

PYTHONHASHSEED=23 python run.py
    \ train
    \ acl_configs/grail_train.jsonnet
    \ --include-package
    \ new_model.bottom_up_parser
    \ --include-package
    \ new_model.bottom_up_parser_reader
    \ --include-package
    \ utils.huggingface_interface
    \ -s
    \ [output_dir]

But I got the error:

Traceback (most recent call last):
  File "/home/ubuntu/proj/Pangu/run.py", line 10, in <module>
    main()
  File "/home/ubuntu/proj/Pangu/allennlp/commands/__init__.py", line 118, in main
    import_module_and_submodules(package_name)
  File "/home/ubuntu/proj/Pangu/allennlp/common/util.py", line 345, in import_module_and_submodules
    module = importlib.import_module(package_name)
  File "/home/ubuntu/.conda/envs/pangu/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/ubuntu/proj/Pangu/new_model/bottom_up_parser_reader.py", line 24, in <module>
    from utils.my_pretrained_transformer_indexer import PretrainedTransformerIndexer
ModuleNotFoundError: No module named 'utils.my_pretrained_transformer_indexer'

Is there a missing module here? Thanks!

entslscheia commented 1 year ago

Hi @AiRyunn,

Thanks for your interest in Pangu! I've made some update to the repo and the issue is resolved now. Let me know if you have any further questions!