timoschick / pet

This repository contains the code for "Exploiting Cloze Questions for Few-Shot Text Classification and Natural Language Inference"
https://arxiv.org/abs/2001.07676
Apache License 2.0
1.62k stars 283 forks source link

GenPET cli.py error #42

Closed ghost closed 3 years ago

ghost commented 3 years ago

Here are the commands I am running to install GenPET:

git clone --single-branch --branch feature/genpet https://github.com/timoschick/pet
pip install -r pet/requirements.txt

Then, when I run this:

python pet/cli.py --help

It throws an unexpected error:

Traceback (most recent call last):
  File "pet/cli.py", line 328, in <module>
    main()
  File "pet/cli.py", line 259, in main
    args = parser.parse_args()
  File "/usr/lib/python3.7/argparse.py", line 1764, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.7/argparse.py", line 1796, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.7/argparse.py", line 2002, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.7/argparse.py", line 1942, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.7/argparse.py", line 1870, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/python3.7/argparse.py", line 1052, in __call__
    parser.print_help()
  File "/usr/lib/python3.7/argparse.py", line 2490, in print_help
    self._print_message(self.format_help(), file)
  File "/usr/lib/python3.7/argparse.py", line 2474, in format_help
    return formatter.format_help()
  File "/usr/lib/python3.7/argparse.py", line 293, in format_help
    help = self._root_section.format_help()
  File "/usr/lib/python3.7/argparse.py", line 224, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.7/argparse.py", line 224, in <listcomp>
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.7/argparse.py", line 224, in format_help
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.7/argparse.py", line 224, in <listcomp>
    item_help = join([func(*args) for func, args in self.items])
  File "/usr/lib/python3.7/argparse.py", line 540, in _format_action
    help_text = self._expand_help(action)
  File "/usr/lib/python3.7/argparse.py", line 629, in _expand_help
    return self._get_help_string(action) % params
TypeError: %o format: an integer is required, not dict
timoschick commented 3 years ago

Hi @BleepLogger, thanks for pointing out this issue, which is due to one of the help strings containing a % (see here). Should be fixed now!

ghost commented 3 years ago

Yes, it works now! Thank you :)