"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "97ec8cfd4ef13190f3939fbb24b6f146d570ed12"
Commit acb9ab32 authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Don't allow abbreviated argument options

Reviewed By: jmp84

Differential Revision: D15264847

fbshipit-source-id: 4ba9224d1b35c3de0d26c9b4c1ee6d641d3d8535
parent 61f29f7f
...@@ -127,12 +127,12 @@ def parse_args_and_arch(parser, input_args=None, parse_known=False): ...@@ -127,12 +127,12 @@ def parse_args_and_arch(parser, input_args=None, parse_known=False):
def get_parser(desc, default_task='translation'): def get_parser(desc, default_task='translation'):
# Before creating the true parser, we need to import optional user module # Before creating the true parser, we need to import optional user module
# in order to eagerly import custom tasks, optimizers, architectures, etc. # in order to eagerly import custom tasks, optimizers, architectures, etc.
usr_parser = argparse.ArgumentParser(add_help=False) usr_parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
usr_parser.add_argument('--user-dir', default=None) usr_parser.add_argument('--user-dir', default=None)
usr_args, _ = usr_parser.parse_known_args() usr_args, _ = usr_parser.parse_known_args()
import_user_module(usr_args) import_user_module(usr_args)
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser(allow_abbrev=False)
# fmt: off # fmt: off
parser.add_argument('--no-progress-bar', action='store_true', help='disable progress bar') parser.add_argument('--no-progress-bar', action='store_true', help='disable progress bar')
parser.add_argument('--log-interval', type=int, default=1000, metavar='N', parser.add_argument('--log-interval', type=int, default=1000, metavar='N',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment