class_docstr: Masked language modeling prediction pipeline using any `ModelWithLMHead`. See the [masked language modeling
  examples](../task_summary#masked-language-modeling) for more information.
  
  This mask filling pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"fill-mask"`.
  
  The models that this pipeline can use are models that have been trained with a masked language modeling objective,
  which includes the bi-directional models in the library. See the up-to-date list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=fill-mask).
  
  <Tip>
  
  This pipeline only works for inputs with exactly one token masked. Experimental: We added support for multiple
  masks. The returned values are raw model output, and correspond to disjoint probabilities where one might expect
  joint probabilities (See [discussion](https://github.com/huggingface/transformers/pull/10222)).
  
  </Tip>
class_docstr_tok: ["Masked","language","modeling","prediction","pipeline","using","any","`","ModelWithLMHead","`",".","See","the","[","masked","language","modeling","examples","]","(","..","\/task_summary","#","masked-language-modeling",")","for","more","information",".","This","mask","filling","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","fill-mask","''","`",".","The","models","that","this","pipeline","can","use","are","models","that","have","been","trained","with","a","masked","language","modeling","objective",",","which","includes","the","bi-directional","models","in","the","library",".","See","the","up-to-date","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=fill-mask",")",".","<","Tip",">","This","pipeline","only","works","for","inputs","with","exactly","one","token","masked",".","Experimental",":","We","added","support","for","multiple","masks",".","The","returned","values","are","raw","model","output",",","and","correspond","to","disjoint","probabilities","where","one","might","expect","joint","probabilities","(","See","[","discussion","]","(","https",":","\/\/github.com\/huggingface\/transformers\/pull\/10222",")",")",".","<","\/Tip",">"]
docstr: Fill the masked token in the text(s) given as inputs.
  
  Args:
      args (`str` or `List[str]`):
          One or several texts (or one list of prompts) with masked tokens.
      targets (`str` or `List[str]`, *optional*):
          When passed, the model will limit the scores to the passed targets instead of looking up in the whole
          vocab. If the provided targets are not in the model vocab, they will be tokenized and the first
          resulting token will be used (with a warning, and that might be slower).
      top_k (`int`, *optional*):
          When passed, overrides the number of predictions to return.
  
  Return:
      A list or a list of list of `dict`: Each result comes as list of dictionaries with the following keys:
  
      - **sequence** (`str`) -- The corresponding input with the mask token prediction.
      - **score** (`float`) -- The corresponding probability.
      - **token** (`int`) -- The predicted token id (to replace the masked one).
      - **token** (`str`) -- The predicted token (to replace the masked one).
docstr_tok: ["Fill","the","masked","token","in","the","text","(","s",")","given","as","inputs",".","Args",":","args","(","`","str","`","or","`","List","[","str","]","`",")",":","One","or","several","texts","(","or","one","list","of","prompts",")","with","masked","tokens",".","targets","(","`","str","`","or","`","List","[","str","]","`",",","*","optional","*",")",":","When","passed",",","the","model","will","limit","the","scores","to","the","passed","targets","instead","of","looking","up","in","the","whole","vocab",".","If","the","provided","targets","are","not","in","the","model","vocab",",","they","will","be","tokenized","and","the","first","resulting","token","will","be","used","(","with","a","warning",",","and","that","might","be","slower",")",".","top_k","(","`","int","`",",","*","optional","*",")",":","When","passed",",","overrides","the","number","of","predictions","to","return",".","Return",":","A","list","or","a","list","of","list","of","`","dict","`",":","Each","result","comes","as","list","of","dictionaries","with","the","following","keys",":","-","*","*","sequence","*","*","(","`","str","`",")","--","The","corresponding","input","with","the","mask","token","prediction",".","-","*","*","score","*","*","(","`","float","`",")","--","The","corresponding","probability",".","-","*","*","token","*","*","(","`","int","`",")","--","The","predicted","token","id","(","to","replace","the","masked","one",")",".","-","*","*","token","*","*","(","`","str","`",")","--","The","predicted","token","(","to","replace","the","masked","one",")","."]
code: def __call__(self, inputs, *args, **kwargs):
      """
      Fill the masked token in the text(s) given as inputs.
  
      Args:
          args (`str` or `List[str]`):
              One or several texts (or one list of prompts) with masked tokens.
          targets (`str` or `List[str]`, *optional*):
              When passed, the model will limit the scores to the passed targets instead of looking up in the whole
              vocab. If the provided targets are not in the model vocab, they will be tokenized and the first
              resulting token will be used (with a warning, and that might be slower).
          top_k (`int`, *optional*):
              When passed, overrides the number of predictions to return.
  
      Return:
          A list or a list of list of `dict`: Each result comes as list of dictionaries with the following keys:
  
          - **sequence** (`str`) -- The corresponding input with the mask token prediction.
          - **score** (`float`) -- The corresponding probability.
          - **token** (`int`) -- The predicted token id (to replace the masked one).
          - **token** (`str`) -- The predicted token (to replace the masked one).
      """
      outputs = super().__call__(inputs, **kwargs)
      if isinstance(inputs, list) and len(inputs) == 1:
          return outputs[0]
      return outputs
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/fill_mask.py
imports: from typing import Dict
  import numpy
  from ..utils import add_end_docstrings, is_tf_available, is_torch_available, logging
  from .base import PIPELINE_INIT_ARGS, GenericTensor, Pipeline, PipelineException
label_desc: Use image node_id 9 for calling the FillMaskPipeline obj's underlying member method code with example usage: obj.__call__(inputs) and returns: outputs, outputs