Skip to content
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

Improve Instructions for pooling_layer #344

Open
GrierPhillips opened this issue May 7, 2019 · 3 comments
Open

Improve Instructions for pooling_layer #344

GrierPhillips opened this issue May 7, 2019 · 3 comments

Comments

@GrierPhillips
Copy link

GrierPhillips commented May 7, 2019


Description

The current documentation is slightly confusing regarding the use of the pooling_layer argument. For example, the documentation states:

pooling_layer list [-2] the encoding layer that pooling operates on, where -1means the last layer, -2 means the second-to-last, [-1, -2] means concatenating the result of last two layers, etc.

However, upon some testing the only correct way to launch the server with concatenation is as follows:

bert-serving-start ... -pooling_layer -4 -3 -2 -1

The documentation would lead one to believe this is passed as a list, but in fact it is an int with nargs='+'. Perhaps consider updating the documentation to make this more clear?

@cpmss521
Copy link

cpmss521 commented Aug 4, 2019

@jacobdevlin-google ,

@ayxemma
Copy link

ayxemma commented Jan 6, 2020

why it doesn't work when passed in from python?
args = get_args_parser().parse_args(['-pooling_layer', "-2 -1",...])

@acadTags
Copy link

acadTags commented Nov 14, 2020

I had the same question as the above.

To concatenate the hidden states of last 4 layers, the right way in python for -pooling_layer is

args = get_args_parser().parse_args(['-model_dir', model_path,
                                         '-pooling_strategy', 'NONE',
                                         '-pooling_layer', '-4','-3','-2','-1',
                                         '-max_seq_len', 'None',                                         
                                         '-cpu'])

Thanks,
A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants