nyu-mll / jiant-v1-legacy

The jiant toolkit for general-purpose text understanding models
MIT License
21 stars 9 forks source link

[CLOSED] How to use the scripts in `/scripts`? #1050

Closed jeswan closed 4 years ago

jeswan commented 4 years ago

Issue by cjlovering Friday Apr 03, 2020 at 18:45 GMT Originally opened as https://github.com/nyu-mll/jiant/issues/1050


I can run jiant as outlined in the tutorial, but when I try to import jiant in an file from the scripts folder it breaks. A stray comment in one of the files suggested that there are (or should be) symlinks?

$ conda activate jiant; . ./user_config.sh; python main.py --config_file jiant/config/default.conf
% works!
% I am interested in running a custom (new) script, but for example:
$ conda activate jiant; ./user_config.sh; python scripts/ccg/align_tags_to_bert.py 
Traceback (most recent call last):
  File "scripts/ccg/align_tags_to_bert.py", line 8, in <module>
    from jiant.utils.retokenize import get_aligner_fn
ModuleNotFoundError: No module named 'jiant'
jeswan commented 4 years ago

Comment by pyeres Monday Apr 06, 2020 at 17:39 GMT


Hi @cjlovering — does running your script like this (using the -m option) resolve your issue?

jeswan commented 4 years ago

Comment by cjlovering Tuesday Apr 07, 2020 at 20:53 GMT


Thanks! This works!