get the default max encoding length from config. Args: config (PretrainedConfig): the instance of PretrainedConfig default (int): the default value of max encoding length Returns: int: the default max_length of encoding length
(config: PretrainedConfig, default: int = 1024)
| 695 | |
| 696 | |
| 697 | def get_default_max_encoding_length(config: PretrainedConfig, default: int = 1024) -> int: |
| 698 | """get the default max encoding length from config. |
| 699 | |
| 700 | Args: |
| 701 | config (PretrainedConfig): the instance of PretrainedConfig |
| 702 | default (int): the default value of max encoding length |
| 703 | |
| 704 | Returns: |
| 705 | int: the default max_length of encoding length |
| 706 | """ |
| 707 | |
| 708 | max_position_embeddings = get_model_max_position_embeddings(config) |
| 709 | if max_position_embeddings is None: |
| 710 | return default |
| 711 | return max_position_embeddings // 4 * 3 |
| 712 | |
| 713 | |
| 714 | def read_res(model_name_or_path: str, tensor_queue: mp.Queue, result_queue: mp.Queue): |
no test coverage detected
searching dependent graphs…