Skip to content

Commit

Permalink
Add beam_search parser as parent
Browse files Browse the repository at this point in the history
  • Loading branch information
ezerhouni committed Jul 25, 2022
1 parent 9d4d1c8 commit e9ec2aa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
def get_args():
beam_search_parser = add_beam_search_arguments()
parser = argparse.ArgumentParser(
parents=[beam_search_parser],
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)

Expand Down Expand Up @@ -172,7 +173,7 @@ def get_args():
)

return (
parser.parse_known_args()[0],
parser.parse_args(),
beam_search_parser.parse_known_args()[0],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
def get_args():
beam_search_parser = add_beam_search_arguments()
parser = argparse.ArgumentParser(
parents=[beam_search_parser],
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)

Expand Down Expand Up @@ -172,7 +173,7 @@ def get_args():
)

return (
parser.parse_known_args()[0],
parser.parse_args(),
beam_search_parser.parse_known_args()[0],
)

Expand Down
5 changes: 3 additions & 2 deletions sherpa/bin/pruned_transducer_statelessX/offline_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
def get_args():
beam_search_parser = add_beam_search_arguments()
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter
parents=[beam_search_parser],
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)

parser.add_argument(
Expand Down Expand Up @@ -169,7 +170,7 @@ def get_args():
)

return (
parser.parse_known_args()[0],
parser.parse_args(),
beam_search_parser.parse_known_args()[0],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
def get_args():
beam_search_parser = add_beam_search_arguments()
parser = argparse.ArgumentParser(
parents=[beam_search_parser],
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)

Expand Down Expand Up @@ -174,7 +175,7 @@ def get_args():
)

return (
parser.parse_known_args()[0],
parser.parse_args(),
beam_search_parser.parse_known_args()[0],
)

Expand Down
4 changes: 3 additions & 1 deletion sherpa/python/sherpa/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@


def add_beam_search_arguments():
parser = argparse.ArgumentParser(description="Parameters for beam search")
parser = argparse.ArgumentParser(
description="Parameters for beam search", add_help=False
)

parser.add_argument(
"--decoding-method",
Expand Down

0 comments on commit e9ec2aa

Please sign in to comment.