Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/huggingface/transformers
/ functions
Functions
4,119 in github.com/huggingface/transformers
⨍
Functions
4,119
◇
Types & classes
939
↳
Endpoints
4
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/tokenization_gpt2.py:232
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/tokenization_transfo_xl.py:307
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/tokenization_ctrl.py:215
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/tokenization_xlm.py:839
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/tokenization_t5.py:175
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/tokenization_xlnet.py:226
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/tokenization_bert.py:222
Method
_convert_token_to_id
(self, token)
src/transformers/tokenization_marian.py:96
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/tokenization_camembert.py:230
Method
_embedding
Applies embedding based on inputs tensor.
src/transformers/modeling_tf_roberta.py:88
Method
_encode_plus
(self, *args, **kwargs)
src/transformers/tokenization_gpt2.py:369
Method
_encode_plus
( self, text: Union[TextInput, PreTokenizedInput], text_pair: Optional[Union[TextInput
src/transformers/tokenization_utils_fast.py:380
Method
_encode_plus
( self, text: Union[TextInput, PreTokenizedInput, EncodedInput], text_pair: Optional[U
src/transformers/tokenization_utils.py:402
Method
_forward
Forwards a training example and accumulates the gradients.
src/transformers/trainer_tf.py:451
Method
_get_embs
(m)
tests/test_modeling_bart.py:520
Function
_get_shape
(t)
src/transformers/modeling_bart.py:801
Method
_hook_rss_memory_post_forward
(module, *args, **kwargs)
src/transformers/modeling_utils.py:97
Method
_hook_rss_memory_pre_forward
(module, *args, **kwargs)
src/transformers/modeling_utils.py:85
Method
_inference_memory
( self, model_name: str, batch_size: int, sequence_length: int )
src/transformers/benchmark/benchmark.py:69
Method
_inference_memory
( self, model_name: str, batch_size: int, sequence_length: int )
src/transformers/benchmark/benchmark_utils.py:613
Method
_inference_memory
( self, model_name: str, batch_size: int, sequence_length: int )
src/transformers/benchmark/benchmark_tf.py:100
Method
_inference_speed
(self, model_name: str, batch_size: int, sequence_length: int)
src/transformers/benchmark/benchmark.py:65
Method
_inference_speed
(self, model_name: str, batch_size: int, sequence_length: int)
src/transformers/benchmark/benchmark_utils.py:605
Method
_inference_speed
(self, model_name: str, batch_size: int, sequence_length: int)
src/transformers/benchmark/benchmark_tf.py:88
Method
_init_weights
Initialize the weights
templates/adding_a_new_model/modeling_xxx.py:186
Method
_init_weights
Initialize the weights.
src/transformers/modeling_distilbert.py:329
Method
_init_weights
Initialize the weights.
src/transformers/modeling_ctrl.py:219
Method
_init_weights
Initialize the weights.
src/transformers/modeling_xlnet.py:528
Method
_init_weights
Initialize the weights.
src/transformers/modeling_xlm.py:228
Method
_init_weights
Initialize the weights.
src/transformers/modeling_transfo_xl.py:472
Method
_init_weights
Initialize the weights
src/transformers/modeling_retribert.py:51
Method
_init_weights
Initialize the weights
src/transformers/modeling_reformer.py:1430
Method
_init_weights
Initialize the weights
src/transformers/modeling_bert.py:551
Method
_init_weights
Initialize the weights.
src/transformers/modeling_gpt2.py:269
Method
_init_weights
Initialize the weights.
src/transformers/modeling_albert.py:372
Method
_init_weights
Initialize the weights
src/transformers/modeling_mobilebert.py:650
Method
_init_weights
Initialize the weights.
src/transformers/modeling_openai.py:266
Method
_init_weights
Initialize the weights
examples/movement-pruning/emmental/modeling_bert_masked.py:396
Method
_missing_
(cls, value)
src/transformers/tokenization_utils_base.py:79
Function
_mp_fn
(index)
examples/multiple-choice/run_multiple_choice.py:223
Function
_mp_fn
(index)
examples/token-classification/run_ner.py:297
Function
_mp_fn
(index)
examples/adversarial/run_hans.py:225
Function
_mp_fn
(index)
examples/text-classification/run_glue.py:240
Function
_mp_fn
(index)
examples/language-modeling/run_language_modeling.py:275
Method
_prepare_local
(self, var_device, var_dtype, apply_state)
src/transformers/optimization_tf.py:132
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
templates/adding_a_new_model/modeling_xxx.py:317
Method
_prune_heads
(self, heads_to_prune)
templates/adding_a_new_model/modeling_tf_xxx.py:99
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_tf_electra.py:228
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_distilbert.py:404
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer}
src/transformers/modeling_ctrl.py:323
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_tf_albert.py:533
Method
_prune_heads
(self, heads)
src/transformers/modeling_tf_transfo_xl.py:487
Method
_prune_heads
(self, heads_to_prune)
src/transformers/modeling_xlnet.py:658
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer}
src/transformers/modeling_tf_openai.py:236
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_tf_mobilebert.py:650
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_xlm.py:391
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_tf_bert.py:520
Method
_prune_heads
(self, heads)
src/transformers/modeling_transfo_xl.py:713
Method
_prune_heads
(self, heads_to_prune)
src/transformers/modeling_tf_distilbert.py:435
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_reformer.py:1528
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_bert.py:660
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer}
src/transformers/modeling_tf_gpt2.py:246
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer}
src/transformers/modeling_gpt2.py:367
Method
_prune_heads
(self, heads_to_prune)
src/transformers/modeling_tf_xlnet.py:411
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} ALBERT has a different a
src/transformers/modeling_albert.py:471
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_mobilebert.py:744
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_tf_xlm.py:323
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer}
src/transformers/modeling_openai.py:353
Method
_prune_heads
(self, heads_to_prune)
src/transformers/modeling_tf_t5.py:550
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
src/transformers/modeling_electra.py:259
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer}
src/transformers/modeling_tf_ctrl.py:226
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
examples/movement-pruning/emmental/modeling_bert_masked.py:494
Method
_read
(self, n=-1)
src/transformers/hf_api.py:222
Method
_recursive_map
(struct, batch_dim=0)
examples/seq2seq/bertabs/modeling_bertabs.py:613
Method
_reorder_cache
(past, beam_idx)
src/transformers/modeling_bart.py:1048
Method
_reorder_cache
(self, past, beam_idx)
src/transformers/modeling_encoder_decoder.py:313
Method
_reorder_cache
(self, past, beam_idx)
src/transformers/modeling_t5.py:1173
Method
_reorder_cache
(self, past, beam_idx)
src/transformers/modeling_tf_t5.py:1182
Method
_resize_cutoffs
(self, new_num_tokens, new_emb_size, new_embedding_shapes, layer)
src/transformers/modeling_transfo_xl.py:1027
Method
_resize_token_embeddings
(self, new_num_tokens)
templates/adding_a_new_model/modeling_tf_xxx.py:96
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_tf_electra.py:225
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_tf_albert.py:530
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_tf_transfo_xl.py:476
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_tf_mobilebert.py:647
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_tf_xlnet.py:408
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_albert.py:465
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_tf_xlm.py:320
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_tf_t5.py:547
Method
_resize_token_embeddings
(self, new_num_tokens)
src/transformers/modeling_tf_ctrl.py:223
Method
_resource_apply_dense
(self, grad, var, apply_state=None)
src/transformers/optimization_tf.py:164
Method
_resource_apply_sparse
(self, grad, var, indices, apply_state=None)
src/transformers/optimization_tf.py:170
Function
_resumable_file_manager
()
src/transformers/file_utils.py:732
Method
_setup_devices
(self)
src/transformers/training_args.py:164
Method
_setup_devices
(self)
src/transformers/benchmark/benchmark_args.py:51
Method
_setup_strategy
(self)
src/transformers/training_args_tf.py:27
Method
_setup_strategy
(self)
src/transformers/benchmark/benchmark_args_tf.py:63
Method
_setup_tpu
(self)
src/transformers/benchmark/benchmark_args_tf.py:50
Method
_step
Applies gradients and resets accumulation.
src/transformers/trainer_tf.py:411
Method
_step
(self, batch)
examples/seq2seq/distillation.py:193
Method
_step
(self, batch)
examples/seq2seq/distillation.py:320
← previous
next →
2,101–2,200 of 4,119, ranked by callers