MCPcopy Create free account

hub / github.com/huggingface/transformers / functions

Functions4,119 in github.com/huggingface/transformers

↓ 8 callersMethodapply
Args: inputs (`torch.FloatTensor`) The input matrix from which the binarizer computes the binary mask.
examples/movement-pruning/emmental/modules/binarizer.py:121
↓ 8 callersMethodbuild_inputs_with_special_tokens
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and adding special tokens
templates/adding_a_new_model/tokenization_xxx.py:157
↓ 8 callersMethodget_extended_attention_mask
Makes broadcastable attention mask and causal mask so that future and maked tokens are ignored. Arguments: attention_mask: torch.
src/transformers/modeling_utils.py:187
↓ 8 callersMethodget_train_examples
See base class.
examples/adversarial/utils_hans.py:249
↓ 8 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_roberta.py:68
↓ 8 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_t5.py:56
↓ 8 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_electra.py:67
↓ 8 callersMethodprint_fn
(self)
src/transformers/benchmark/benchmark_utils.py:585
↓ 8 callersFunctionset_seed
(seed: int)
src/transformers/trainer.py:63
↓ 7 callersMethod__init__
Conv1D layer as defined by Radford et al. for OpenAI GPT (and also used in GPT-2) Basically works like a Linear layer but the weights are
src/transformers/modeling_utils.py:1767
↓ 7 callersMethod__init__
(self, config)
src/transformers/modeling_longformer.py:520
↓ 7 callersMethod_get_config_and_data
(self)
tests/test_modeling_bart.py:344
↓ 7 callersMethodcheck_loss_output
(self, result)
tests/test_modeling_mobilebert.py:156
↓ 7 callersMethodcheck_results_dict_not_empty
(self, results)
tests/test_benchmark_tf.py:18
↓ 7 callersMethodevaluate
Run evaluation and return metrics. The calling script will be responsible for providing a method to compute metrics, as they are
src/transformers/trainer.py:686
↓ 7 callersMethodget_dev_examples
See base class.
examples/adversarial/utils_hans.py:253
↓ 7 callersMethodget_input_embeddings
(self)
templates/adding_a_new_model/modeling_xxx.py:311
↓ 7 callersFunctionis_py3nvml_available
()
src/transformers/file_utils.py:147
↓ 7 callersFunctionlmap
list(map(f, x))
examples/seq2seq/utils.py:58
↓ 7 callersMethodnum_special_tokens_to_add
Just EOS
src/transformers/tokenization_marian.py:206
↓ 7 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_tf_distilbert.py:65
↓ 7 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_albert.py:69
↓ 7 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_distilbert.py:86
↓ 7 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_tf_xlnet.py:72
↓ 7 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_longformer.py:79
↓ 7 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_xlm.py:73
↓ 7 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_xlnet.py:98
↓ 7 callersMethodprepare_config_and_inputs_bert
(self)
tests/test_modeling_encoder_decoder.py:38
↓ 7 callersMethodprune_heads
(self, heads)
src/transformers/modeling_gpt2.py:129
↓ 7 callersMethodresize_token_embeddings
Resize input token embeddings matrix of the model if new_num_tokens != config.vocab_size. Take care of tying weights embeddings afterwards if
src/transformers/modeling_utils.py:375
↓ 7 callersMethodsave_model
Saving best-practices: if you use default names for the model, you can reload it using from_pretrained(). Will only save fro
src/transformers/trainer.py:612
↓ 7 callersMethodset_seed
(self)
tests/test_modeling_xlnet.py:156
↓ 7 callersMethodto_dict
Serializes this instance to a Python dictionary.
src/transformers/modelcard.py:202
↓ 7 callersMethodtokenize
Basic Tokenization of a piece of text. Split on "white spaces" only, for sub-word tokenization, see WordPieceTokenizer. Args:
src/transformers/tokenization_bert.py:374
↓ 6 callersMethod__init__
(self, config, **kwargs)
templates/adding_a_new_model/modeling_tf_xxx.py:71
↓ 6 callersMethod__init__
(self, n_state, config, **kwargs)
src/transformers/modeling_tf_openai.py:167
↓ 6 callersMethod__init__
(self, d_model, d_inner, dropout, pre_lnorm=False, layer_norm_epsilon=1e-5)
src/transformers/modeling_transfo_xl.py:190
↓ 6 callersMethod__init__
(self, n_state, config, **kwargs)
src/transformers/modeling_tf_gpt2.py:170
↓ 6 callersMethod__init__
(self, n_state, config)
src/transformers/modeling_gpt2.py:213
↓ 6 callersMethod__init__
(self, config, *inputs, **kwargs)
src/transformers/modeling_tf_flaubert.py:115
↓ 6 callersMethod__init__
(self)
examples/seq2seq/bertabs/modeling_bertabs.py:123
↓ 6 callersMethod_assert_generated_batch_equal_expected
(self, **tokenizer_kwargs)
tests/test_modeling_marian.py:96
↓ 6 callersMethod_tie_or_clone_weights
Tie or clone module weights depending of whether we are using TorchScript or not
src/transformers/modeling_utils.py:357
↓ 6 callersMethodargparsersEqual
Small helper to check pseudo-equality of parsed arguments on `ArgumentParser` instances.
tests/test_hf_argparser.py:63
↓ 6 callersMethodbatch_decode
(self, sequences: List[List[int]], **kwargs)
src/transformers/tokenization_utils_base.py:2033
↓ 6 callersMethodcheck_loss_output
(self, result)
tests/test_modeling_electra.py:113
↓ 6 callersMethoddevice_placement
Context Manager allowing tensor allocation on the user-specified device in framework agnostic way. example: # Explicitly
src/transformers/pipelines.py:431
↓ 6 callersFunctionfreeze_params
(model: nn.Module)
examples/seq2seq/utils.py:239
↓ 6 callersMethodfrom_dict
Constructs a `ModelCard` from a Python dictionary of parameters.
src/transformers/modelcard.py:184
↓ 6 callersMethodfrom_pretrained
r""" Instantiates one of the base model classes of the library from a pre-trained model configuration. The `from_pretrained()` method
src/transformers/modeling_tf_auto.py:339
↓ 6 callersFunctionget_activation
(activation_string)
src/transformers/activations.py:52
↓ 6 callersMethodget_labels
See base class.
examples/multiple-choice/utils_multiple_choice.py:417
↓ 6 callersMethodget_token
Get token or None if not existent.
src/transformers/hf_api.py:243
↓ 6 callersMethodget_vocab
(self)
src/transformers/tokenization_t5.py:143
↓ 6 callersFunctionhf_bucket_url
Resolve a model identifier, and a file name, to a HF-hosted url on either S3 or Cloudfront (a Content Delivery Network, or CDN). Cloudfr
src/transformers/file_utils.py:451
↓ 6 callersFunctionis_remote_url
(url_or_filename)
src/transformers/file_utils.py:446
↓ 6 callersFunctionis_wandb_available
()
src/transformers/trainer_utils.py:20
↓ 6 callersMethodpredict
Run prediction and return predictions and potential metrics. Depending on the dataset and your use case, your test dataset may conta
src/transformers/trainer.py:715
↓ 6 callersMethodprepare_config_and_inputs
(self)
templates/adding_a_new_model/tests/test_modeling_tf_xxx.py:100
↓ 6 callersMethodprepare_config_and_inputs
(self)
templates/adding_a_new_model/tests/test_modeling_xxx.py:96
↓ 6 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_tf_albert.py:88
↓ 6 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_tf_electra.py:63
↓ 6 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_gpt2.py:90
↓ 6 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_tf_gpt2.py:67
↓ 6 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_tf_xlm.py:73
↓ 6 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_tf_roberta.py:67
↓ 6 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_flaubert.py:71
↓ 5 callersMethod__init__
(self, config)
templates/adding_a_new_model/modeling_xxx.py:143
↓ 5 callersMethod__init__
(self, n_state, config)
src/transformers/modeling_openai.py:220
↓ 5 callersMethod__init__
(self, config, *inputs, **kwargs)
src/transformers/modeling_tf_ctrl.py:489
↓ 5 callersMethod_check_no_pad_token_padding
(self, tokenizer, sequences)
tests/test_tokenization_common.py:1331
↓ 5 callersMethod_create_examples
Creates examples for the training, dev and test sets.
src/transformers/data/processors/glue.py:419
↓ 5 callersMethod_get_input_ids_and_mask
(self)
tests/test_modeling_reformer.py:700
↓ 5 callersFunction_long_tensor
(tok_lst)
tests/test_modeling_bart.py:549
↓ 5 callersMethod_parse_and_tokenize
Parse arguments and tokenize
src/transformers/pipelines.py:460
↓ 5 callersMethodanalyze_directory
Runs through the specific directory, looking for the files identified with `identifier`. Executes the doctests in those files
tests/test_doc_samples.py:35
↓ 5 callersMethodcheck_loss_output
(self, result)
tests/test_modeling_albert.py:105
↓ 5 callersMethodcheck_loss_output
(self, result)
tests/test_modeling_distilbert.py:116
↓ 5 callersMethodcheck_loss_output
(self, result)
tests/test_modeling_longformer.py:115
↓ 5 callersFunctionconvert_examples_to_features
Loads a data file into a list of `InputFeatures` `cls_token_at_end` define the location of the CLS token: - False (Default, BERT/
examples/token-classification/utils_ner.py:262
↓ 5 callersMethodensure_tensor_on_device
Ensure PyTorch tensors are on the specified device. :param inputs: :return:
src/transformers/pipelines.py:452
↓ 5 callersMethodfrom_encoder_decoder_pretrained
r""" Instantiates an encoder and a decoder from one or two base classes of the library from pre-trained model checkpoints. The model is set
src/transformers/modeling_encoder_decoder.py:91
↓ 5 callersMethodget_clean_sequence
(self, tokenizer, with_prefix_space=False, max_length=20)
tests/test_tokenization_common.py:74
↓ 5 callersMethodget_input_embeddings
(self)
src/transformers/modeling_transfo_xl.py:699
↓ 5 callersMethodinvert_attention_mask
type: torch.Tensor -> torch.Tensor
src/transformers/modeling_utils.py:161
↓ 5 callersMethodload_dataset
Load datasets. Called after prepare data.
examples/token-classification/run_pl_ner.py:77
↓ 5 callersMethodnum_parameters
Get number of (optionally, trainable) parameters in the module.
src/transformers/modeling_utils.py:77
↓ 5 callersMethodprepare_config_and_inputs
(self)
tests/test_modeling_tf_t5.py:54
↓ 5 callersMethodprepare_config_and_inputs_for_decoder
(self)
tests/test_modeling_bert.py:127
↓ 5 callersMethodpresign
Call HF API to get a presigned url to upload `filename` to S3.
src/transformers/hf_api.py:136
↓ 5 callersMethodred
(cls, s)
src/transformers/commands/user.py:61
↓ 5 callersFunctionremove_prefix
(text: str, prefix: str)
src/transformers/convert_marian_to_pytorch.py:18
↓ 5 callersFunctionsquad_convert_examples_to_features
Converts a list of examples into a list of features that can be directly given as input to a model. It is model-dependant and takes advantage
src/transformers/data/processors/squad.py:273
↓ 5 callersMethodtokenize
Tokenizes a piece of text.
src/transformers/tokenization_bert_japanese.py:192
↓ 5 callersFunctionunwrap_and_save_reload_schedule
(scheduler, num_steps=10)
tests/test_optimization.py:47
↓ 5 callersFunctionunwrap_schedule
(scheduler, num_steps=10)
tests/test_optimization.py:39
↓ 4 callersFunctionLayerNorm
(normalized_shape, eps=1e-5, elementwise_affine=True)
src/transformers/modeling_bart.py:779
↓ 4 callersMethod__init__
(self, config)
src/transformers/modeling_flaubert.py:118
↓ 4 callersFunction_assert_tensors_equal
If tensors not close, or a and b arent both tensors, raise a nice Assertion error.
tests/test_modeling_bart.py:534
↓ 4 callersMethod_feature_file
(self, mode)
examples/lightning_base.py:156
← previousnext →101–200 of 4,119, ranked by callers