deepset-ai / FARM

:house_with_garden: Fast & easy transfer learning for NLP. Harvesting language models for the industry. Focus on Question Answering.
https://farm.deepset.ai
Apache License 2.0
1.73k stars 247 forks source link

Changed default values of max_seq_len and doc_stride in infer load depending if they are explicit set #785

Closed ftesser closed 2 years ago

ftesser commented 3 years ago

I was experimenting with different values of max_seq_len, looking at the following line in the QA example:

https://github.com/deepset-ai/FARM/blob/c9235f287ed92e09a46d7dc3572bf462f2ec95f7/examples/question_answering.py#L113

I noticed that the load method always sets max_seq_len=256. In fact if the load method is not explicitly set max_seq_len the value of 256 is used (https://github.com/deepset-ai/FARM/blob/c9235f287ed92e09a46d7dc3572bf462f2ec95f7/farm/infer.py#L279)

I think that, if it is not explicit set, a better value to set should be the one loaded from the model config. This PR do that for both max_seq_len and doc_stride.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 21 days if no further activity occurs.