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_tokenizer'` #4

Closed dhdhagar closed 1 year ago

dhdhagar commented 1 year ago

Hi! In trying to run the provided command for training, I get the following error:

Traceback (most recent call last):
  File "/home/ubuntu/code/git-Pangu/run.py", line 10, in <module>
    main()
  File "/home/ubuntu/code/git-Pangu/allennlp/commands/__init__.py", line 118, in main
    import_module_and_submodules(package_name)
  File "/home/ubuntu/code/git-Pangu/allennlp/common/util.py", line 345, in import_module_and_submodules
    module = importlib.import_module(package_name)
  File "/home/ubuntu/miniconda3/envs/pangu/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/ubuntu/code/git-Pangu/new_model/bottom_up_parser.py", line 14, in <module>
    from utils.my_pretrained_transformer_tokenizer import PretrainedTransformerTokenizer
ModuleNotFoundError: No module named 'utils.my_pretrained_transformer_tokenizer'

On checking, my_pretrained_transformer_tokenizer doesn't seem to exist in the repo. Any suggestions?

entslscheia commented 1 year ago

I intended to remove this file in my code cleaning, but looks like some dependencies were not properly dissolved. I have uploaded the original my_predrained_transformer_tokenizer.py file (link) as a temporary solution.

Meanwhile, I'll do more tests and fix this with a more graceful solution.

dhdhagar commented 1 year ago

Thanks - I now get the following error: ModuleNotFoundError: No module named 'utils.my_pretrained_transformer_indexer' (related issue https://github.com/dki-lab/Pangu/issues/5).

entslscheia commented 1 year ago

I have made some update to the repo and the issue should be resolved now. Feel free to reach out if you have any further concerns!

dhdhagar commented 1 year ago

Both training and inference are working well now! Thank you!