MCPcopy Create free account

hub / github.com/huggingface/transformers / functions

Functions4,119 in github.com/huggingface/transformers

FunctioncreateFrameworkButtons
docs/source/_static/js/custom.js:200
Methodcreate_and_check_albert_for_token_classification
( self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
tests/test_modeling_albert.py:208
Methodcreate_custom_forward
(module)
src/transformers/modeling_bert.py:418
Methodcreate_from_examples
(cls, texts_or_text_and_labels, labels=None, **kwargs)
src/transformers/data/processors/utils.py:159
Functioncreate_sinusoidal_embeddings
(n_pos, dim, out)
src/transformers/modeling_tf_xlm.py:68
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. XLM-R does not make use of token type
src/transformers/tokenization_xlm_roberta.py:235
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. RoBERTa does not make use of token ty
src/transformers/tokenization_roberta.py:221
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. RoBERTa does not make use of token ty
src/transformers/tokenization_roberta.py:351
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT sequence pair mask has the
src/transformers/tokenization_albert.py:292
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An XLM sequence pair mask has the fol
src/transformers/tokenization_xlm.py:911
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An XLNet sequence pair mask has the f
src/transformers/tokenization_xlnet.py:296
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence pair mask has the fol
src/transformers/tokenization_bert.py:292
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence pair mask has the fol
src/transformers/tokenization_bert.py:643
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. CamemBERT, like RoBERTa, does not mak
src/transformers/tokenization_camembert.py:199
Methodcustom_forward
(*inputs)
src/transformers/modeling_bert.py:419
Functioncustom_tokenizers
Decorator marking a test for a custom tokenizer. Custom tokenizers require additional dependencies, and are skipped by default. Set the
tests/utils.py:60
Functiond
()
docs/source/_static/js/custom.js:246
Methoddecode
( self, token_ids: List[int], skip_special_tokens: bool = False, clean_up_tokenization_spaces: bool =
src/transformers/tokenization_utils_fast.py:436
Methoddecode
( self, token_ids: List[int], skip_special_tokens: bool = False, clean_up_tokenization_spaces: bool =
src/transformers/tokenization_utils.py:872
Functiondecode_summary
Decode the summary and return it in a format suitable for evaluation.
examples/seq2seq/bertabs/run_summarization.py:232
Functiondefault_logdir
Same default as PyTorch
src/transformers/training_args.py:21
Methoddetach
(self)
examples/seq2seq/bertabs/modeling_bertabs.py:586
Methoddevice_idx
(self)
src/transformers/benchmark/benchmark_args.py:70
Methoddivide_chunks
(l, n)
examples/distillation/lm_seqs_dataset.py:70
Methoddo_multi_processing
(self)
src/transformers/benchmark/benchmark_args_utils.py:123
Functiondocstring_decorator
(fn)
src/transformers/file_utils.py:156
Functiondownload_command_factory
(args)
src/transformers/commands/download.py:6
Methoddtype
Get torch.dtype from module, assuming that the whole module has one dtype.
src/transformers/modeling_utils.py:144
Methoddummy_inputs
Dummy inputs to build the network. Returns: tf.Tensor with dummy inputs
src/transformers/modeling_tf_albert.py:1151
Methoddummy_inputs
(self)
src/transformers/modeling_bart.py:154
Methoddummy_inputs
Dummy inputs to build the network. Returns: tf.Tensor with dummy inputs
src/transformers/modeling_tf_mobilebert.py:1237
Methoddummy_inputs
Dummy inputs to do a forward pass in the network. Returns: torch.Tensor with dummy inputs
src/transformers/modeling_utils.py:284
Methoddummy_inputs
(self)
src/transformers/modeling_xlm.py:219
Methoddummy_inputs
Dummy inputs to build the network. Returns: tf.Tensor with dummy inputs
src/transformers/modeling_tf_utils.py:167
Methoddummy_inputs
Dummy inputs to build the network. Returns: tf.Tensor with dummy inputs
src/transformers/modeling_tf_bert.py:1003
Methoddummy_inputs
Dummy inputs to build the network. Returns: tf.Tensor with dummy inputs
src/transformers/modeling_tf_distilbert.py:871
Methoddummy_inputs
Dummy inputs to build the network. Returns: tf.Tensor with dummy inputs
src/transformers/modeling_tf_roberta.py:424
Methoddummy_inputs
(self)
src/transformers/modeling_reformer.py:1421
Methoddummy_inputs
Dummy inputs to build the network. Returns: tf.Tensor with dummy inputs
src/transformers/modeling_tf_xlnet.py:1086
Methoddummy_inputs
(self)
src/transformers/modeling_tf_xlm.py:513
Methoddummy_inputs
Dummy inputs to build the network. Returns: tf.Tensor with dummy inputs
src/transformers/modeling_tf_xlm.py:832
Methoddummy_inputs
(self)
src/transformers/modeling_t5.py:567
Methoddummy_inputs
(self)
src/transformers/modeling_tf_t5.py:770
Methodencode_sents
(self, sents, ordered=False, verbose=False)
src/transformers/tokenization_transfo_xl.py:250
Methodencoder_decoder_forward
()
src/transformers/benchmark/benchmark.py:125
Methodencoder_decoder_forward
()
src/transformers/benchmark/benchmark_tf.py:141
Methodencoder_forward
()
src/transformers/benchmark/benchmark.py:130
Methodencoder_forward
()
src/transformers/benchmark/benchmark_tf.py:145
Methodencodings
Return the list all encoding from the tokenization process Returns: List[EncodingFast] or None if input was tokenized through Python
src/transformers/tokenization_utils_base.py:213
Methodenvironment_info
(self)
src/transformers/benchmark/benchmark_utils.py:736
Methodeos_token
End of sentence token (string). Log an error if used while not having been set.
src/transformers/tokenization_utils_base.py:726
Methodeos_token_id
Id of the end of sentence token in the vocabulary. Log an error if used while not having been set.
src/transformers/tokenization_utils_base.py:821
Methodeval_batch_size
(self)
src/transformers/training_args.py:153
Functionevaluate_retriever
(qa_list, retriever_func, scoring_func, n_ret=10, verbose=False)
examples/longform-qa/eli5_utils.py:576
Methodextra_keys
(self)
src/transformers/convert_marian_to_pytorch.py:432
Methodfast_align_python
(self, tokenizer_r, tokenizer_p, tok_case, pretrained_name)
tests/test_tokenization_fast.py:813
Methodfast_only
(self, tokenizer_r)
tests/test_tokenization_fast.py:727
Functionfetch_test_set
(test_set_url)
src/transformers/convert_marian_to_pytorch.py:226
Functionfilename_to_url
Return the url and etag (which may be ``None``) stored for `filename`. Raise ``EnvironmentError`` if `filename` or its stored metadata do not
src/transformers/file_utils.py:499
Functionfilter_non_english
Filter all the model for non-english language
tests/test_tokenization_fast.py:31
Functionfilter_roberta_detectors
(_: Tokenizer, pretrained_name: str)
tests/test_tokenization_fast.py:36
Functionfind_pretrained_model
Find models that can accept src_lang as input and return tgt_lang as output.
src/transformers/convert_marian_to_pytorch.py:42
Methodfind_tensor_attributes
(module: nn.Module)
src/transformers/modeling_utils.py:135
Methodforward
(self, hidden_states, attention_mask=None, head_mask=None)
templates/adding_a_new_model/modeling_xxx.py:149
Methodforward
( self, input_ids=None, attention_mask=None, token_type_ids=None, posi
templates/adding_a_new_model/modeling_xxx.py:325
Methodforward
( self, input_ids=None, attention_mask=None, token_type_ids=None, posi
templates/adding_a_new_model/modeling_xxx.py:431
Methodforward
( self, input_ids=None, attention_mask=None, token_type_ids=None, posi
templates/adding_a_new_model/modeling_xxx.py:511
Methodforward
( self, input_ids=None, attention_mask=None, token_type_ids=None, posi
templates/adding_a_new_model/modeling_xxx.py:597
Methodforward
( self, input_ids=None, attention_mask=None, token_type_ids=None, posi
templates/adding_a_new_model/modeling_xxx.py:695
Methodforward
Parameters ---------- input_ids: torch.tensor(bs, max_seq_length) The token ids to embed. Outputs
src/transformers/modeling_distilbert.py:77
Methodforward
Parameters ---------- query: torch.tensor(bs, seq_length, dim) key: torch.tensor(bs, seq_length, dim) value:
src/transformers/modeling_distilbert.py:134
Methodforward
(self, input)
src/transformers/modeling_distilbert.py:204
Methodforward
Parameters ---------- x: torch.tensor(bs, seq_length, dim) attn_mask: torch.tensor(bs, seq_length) Outputs
src/transformers/modeling_distilbert.py:224
Methodforward
Parameters ---------- x: torch.tensor(bs, seq_length, dim) Input sequence embedded. attn_mask: torch.tens
src/transformers/modeling_distilbert.py:267
Methodforward
r""" Return: :obj:`tuple(torch.FloatTensor)` comprising various elements depending on the configuration (:class:`~transformers.DistilBertC
src/transformers/modeling_distilbert.py:414
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`, defaults to :obj:`None`): Labels f
src/transformers/modeling_distilbert.py:498
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for computing the
src/transformers/modeling_distilbert.py:586
Methodforward
r""" start_positions (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for posi
src/transformers/modeling_distilbert.py:668
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`, defaults to :obj:`None`): Labels f
src/transformers/modeling_distilbert.py:764
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for computing the
src/transformers/modeling_distilbert.py:847
Methodforward
( self, v, k, q, mask, layer_past=None, attention_mask
src/transformers/modeling_ctrl.py:123
Methodforward
( self, x, mask, layer_past=None, attention_mask=None, head_mask=None, use_cache=False, output_attenti
src/transformers/modeling_ctrl.py:183
Methodforward
r""" Return: :obj:`tuple(torch.FloatTensor)` comprising various elements depending on the configuration (:class:`~transformers.CTRLConfig`
src/transformers/modeling_ctrl.py:332
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`, defaults to :obj:`None`): Labels f
src/transformers/modeling_ctrl.py:503
Methodforward
( self, h, g, attn_mask_h, attn_mask_g, r, seg_mat,
src/transformers/modeling_xlnet.py:319
Methodforward
(self, inp)
src/transformers/modeling_xlnet.py:466
Methodforward
( self, output_h, output_g, attn_mask_h, attn_mask_g, r,
src/transformers/modeling_xlnet.py:484
Methodforward
r""" Return: :obj:`tuple(torch.FloatTensor)` comprising various elements depending on the configuration (:class:`~transformers.XLNetConfig
src/transformers/modeling_xlnet.py:755
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, num_predict)`, `optional`, defaults to :obj:`None`): Labels for m
src/transformers/modeling_xlnet.py:1032
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`) Labels for computing the
src/transformers/modeling_xlnet.py:1157
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for computing the
src/transformers/modeling_xlnet.py:1253
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for computing the
src/transformers/modeling_xlnet.py:1352
Methodforward
r""" start_positions (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for posi
src/transformers/modeling_xlnet.py:1459
Methodforward
r""" start_positions (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for posi
src/transformers/modeling_xlnet.py:1573
Methodforward
Args: x (Tensor): input to the layer of shape `(seq_len, batch, embed_dim)` encoder_padding_mask (ByteTensor): binary
src/transformers/modeling_bart.py:213
Methodforward
Args: input_ids (LongTensor): tokens in the source language of shape `(batch, src_len)` attention_mas
src/transformers/modeling_bart.py:283
Methodforward
( self, x, encoder_hidden_states, encoder_attn_mask=None, layer_state=
src/transformers/modeling_bart.py:362
Methodforward
Includes several features from "Jointly Learning to Align and Translate with Transformer Models" (Garg et al., EMNLP 2019).
src/transformers/modeling_bart.py:458
Methodforward
Input shape: Time(SeqLen) x Batch x Channel
src/transformers/modeling_bart.py:590
Methodforward
(self, x)
src/transformers/modeling_bart.py:743
← previousnext →2,501–2,600 of 4,119, ranked by callers