You can send “top_k” parameter to “fill-mask” method, to return more/all tokens.
Check here:
  
      github.com
  
  
    huggingface/transformers/blob/1c1a2ffbff2052100053cddb3a87d45fb9d210ca/src/transformers/pipelines.py#L1184 1

"""def __init__(    self,    model: Union["PreTrainedModel", "TFPreTrainedModel"],    tokenizer: PreTrainedTokenizer,    modelcard: Optional[ModelCard] = None,    framework: Optional[str] = None,    args_parser: ArgumentHandler = None,    device: int = -1,    top_k=5,    task: str = "",):    super().__init__(        model=model,        tokenizer=tokenizer,        modelcard=modelcard,        framework=framework,        args_parser=args_parser,        device=device,        binary_output=True,



  
  
    
    
  
  


If it is still doesn’t fit your use-case, then you have to implement it your self.