-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Reduce the config parsing codes (-360 Lines) for DS2 and make it looks cleaner. #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
deep_speech_2/demo_server.py
Outdated
| add_arg('host_port', int, 8086, "Server's IP port.") | ||
| add_arg('host_ip', str, | ||
| 'localhost', | ||
| "Server's IP address.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we allow more than 80 columns of codes in this part to make it look better?
kuke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost LGTM
deep_speech_2/demo_server.py
Outdated
| from data_utils.utils import read_manifest | ||
|
|
||
|
|
||
| def add_arg(argname, type, default, help, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move down or out this function?
deep_speech_2/evaluate.py
Outdated
| add_arg('batch_size', int, 128, "Minibatch size.") | ||
| add_arg('trainer_count', int, 8, "# of Trainers (CPUs or GPUs).") | ||
| add_arg('beam_size', int, 500, "Beam search width.") | ||
| add_arg('parallels_bsearch',int, 12, "# of CPUs for beam search.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we'd better keep the prefix num_ here, can use num_proc_beam_search or something like that.
| add_arg('decoder_method', str, | ||
| 'ctc_beam_search', | ||
| "Decoder method. Options: ctc_beam_search, ctc_greedy", | ||
| choices = ['ctc_beam_search', 'ctc_greedy']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should beam_search and greedy be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "ctc" to be more specific.
deep_speech_2/demo_server.py
Outdated
| add_arg('alpha', float, 0.36, "Coef of LM for beam search.") | ||
| add_arg('beta', float, 0.25, "Coef of WC for beam search.") | ||
| add_arg('cutoff_prob', float, 0.99, "Cutoff probability for pruning.") | ||
| add_arg('use_gru', bool, False, "Use GRUs instead of Simple RNNs.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple -> simple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
deep_speech_2/evaluate.py
Outdated
| add_arg('lang_model_path', str, | ||
| 'lm/data/common_crawl_00.prune01111.trie.klm', | ||
| "Filepath for language model.") | ||
| add_arg('decoder_method', str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe decode_method or decoding_method would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
deep_speech_2/evaluate.py
Outdated
| add_arg('batch_size', int, 128, "Minibatch size.") | ||
| add_arg('trainer_count', int, 8, "# of Trainers (CPUs or GPUs).") | ||
| add_arg('beam_size', int, 500, "Beam search width.") | ||
| add_arg('parallels_bsearch',int, 12, "# of CPUs for beam search.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we'd better keep the prefix num_, and can use num_proc_bsearch, num_proc_data or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
pkuyym
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM++

Resolved #226