MCPcopy Create free account

hub / github.com/huggingface/transformers / functions

Functions4,119 in github.com/huggingface/transformers

↓ 2 callersFunctionconvert_examples_to_features
Loads a data file into a list of `InputBatch`s.
examples/contrib/run_swag.py:118
↓ 2 callersFunctionconvert_gpt2_checkpoint_to_pytorch
(gpt2_checkpoint_path, gpt2_config_file, pytorch_dump_folder_path)
src/transformers/convert_gpt2_original_tf_checkpoint_to_pytorch.py:29
↓ 2 callersFunctionconvert_hf_name_to_opus_name
Relies on the assumption that there are no language codes like pt_br in models that are not in GROUP_TO_OPUS_NAME.
src/transformers/convert_marian_to_pytorch.py:142
↓ 2 callersFunctionconvert_openai_checkpoint_to_pytorch
(openai_checkpoint_folder_path, openai_config_file, pytorch_dump_folder_path)
src/transformers/convert_openai_original_tf_checkpoint_to_pytorch.py:29
↓ 2 callersFunctionconvert_tf_checkpoint_to_pytorch
(tf_checkpoint_path, bert_config_file, pytorch_dump_path)
src/transformers/convert_bert_original_tf_checkpoint_to_pytorch.py:29
↓ 2 callersFunctionconvert_tf_weight_name_to_pt_weight_name
Convert a TF 2.0 model variable name in a pytorch model weight name. Conventions for TF2.0 scopes -> PyTorch attribute names conversions:
src/transformers/modeling_tf_pytorch_utils.py:29
↓ 2 callersFunctionconvert_transfo_xl_checkpoint_to_pytorch
( tf_checkpoint_path, transfo_xl_config_file, pytorch_dump_folder_path, transfo_xl_dataset_file )
src/transformers/convert_transfo_xl_original_tf_checkpoint_to_pytorch.py:47
↓ 2 callersFunctionconvert_xlm_checkpoint_to_pytorch
(xlm_checkpoint_path, pytorch_dump_folder_path)
src/transformers/convert_xlm_original_pytorch_checkpoint_to_pytorch.py:32
↓ 2 callersFunctionconvert_xlnet_checkpoint_to_pytorch
( tf_checkpoint_path, bert_config_file, pytorch_dump_folder_path, finetuning_task=None )
src/transformers/convert_xlnet_original_tf_checkpoint_to_pytorch.py:51
↓ 2 callersMethodcopy_to_student
(self, d_layers_to_copy, e_layers_to_copy, hparams, student, teacher)
examples/seq2seq/distillation.py:100
↓ 2 callersMethodcreate_and_check_bert_model_as_decoder
( self, config, input_ids, token_type_ids, input_mask, sequenc
tests/test_modeling_bert.py:176
↓ 2 callersMethodcreate_and_check_mobilebert_model_as_decoder
( self, config, input_ids, token_type_ids, input_mask, sequenc
tests/test_modeling_mobilebert.py:178
↓ 2 callersFunctioncreate_module
(args)
examples/seq2seq/distillation.py:382
↓ 2 callersFunctioncreate_optimizer
Creates an optimizer with learning rate schedule.
src/transformers/optimization_tf.py:61
↓ 2 callersFunctioncreate_position_ids_from_input_ids
Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding symbols are ignored. This is modified f
src/transformers/modeling_roberta.py:673
↓ 2 callersMethodcreate_position_ids_from_inputs_embeds
We are provided embeddings directly. We cannot infer which are padded so just generate sequential position ids. :param torch.Tensor
src/transformers/modeling_roberta.py:71
↓ 2 callersMethoddelete_obj
Call HF API to delete a file stored by user
src/transformers/hf_api.py:183
↓ 2 callersMethoddelete_token
Delete token. Do not fail if token does not exist.
src/transformers/hf_api.py:254
↓ 2 callersFunctiondistill_main
(args)
examples/seq2seq/distillation.py:438
↓ 2 callersMethodembed_answers
(self, a_ids, a_mask, checkpoint_batch_size=-1)
examples/longform-qa/eli5_utils.py:162
↓ 2 callersMethodembed_questions
(self, q_ids, q_mask, checkpoint_batch_size=-1)
examples/longform-qa/eli5_utils.py:158
↓ 2 callersMethodembed_sentences_checkpointed
( self, input_ids, attention_mask, sent_encoder, checkpoint_batch_size=-1, )
src/transformers/modeling_retribert.py:93
↓ 2 callersMethodembed_sentences_checkpointed
(self, input_ids, attention_mask, checkpoint_batch_size=-1)
examples/longform-qa/eli5_utils.py:124
↓ 2 callersMethodencode_file
(self, path, ordered=False, verbose=False, add_eos=True, add_double_eos=False)
src/transformers/tokenization_transfo_xl.py:233
↓ 2 callersFunctionensure_valid_input
Ensure input are presented in the correct order, without any None Args: model: The model used to forward the input data token
src/transformers/convert_graph_to_onnx.py:42
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="")
templates/adding_a_new_example_script/run_xxx.py:221
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="")
examples/contrib/run_swag.py:407
↓ 2 callersFunctionevaluate
(args, model, tokenizer, criterion, prefix="")
examples/contrib/mm-imdb/run_mmimdb.py:233
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="")
examples/distillation/run_squad_w_distillation.py:308
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="")
examples/movement-pruning/masked_run_glue.py:412
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="")
examples/movement-pruning/masked_run_squad.py:436
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="")
examples/text-classification/run_xnli.py:236
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="", patience=0)
examples/bert-loses-patience/run_glue_with_pabee.py:255
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="")
examples/question-answering/run_squad.py:268
↓ 2 callersFunctionf
(e,t,o)
docs/source/_static/js/custom.js:246
↓ 2 callersMethodfast_only
(self, tokenizer_r)
tests/test_tokenization_fast.py:96
↓ 2 callersMethodfor_model
(cls, model_type: str, *args, **kwargs)
src/transformers/configuration_auto.py:122
↓ 2 callersMethodforward
( self, input_ids, attention_mask=None, decoder_input_ids=None, encode
src/transformers/modeling_bart.py:822
↓ 2 callersMethodfrom_batch
(self, translation_batch)
examples/seq2seq/bertabs/modeling_bertabs.py:934
↓ 2 callersMethodfrom_config
r""" Instantiates one of the base model classes of the library from a configuration. Note: Loading a model from its confi
src/transformers/modeling_auto.py:367
↓ 2 callersMethodfrom_encoder_decoder_configs
r""" Instantiate a :class:`~transformers.EncoderDecoderConfig` (or a derived class) from a pre-trained encoder model configuration and decoder
src/transformers/configuration_encoder_decoder.py:79
↓ 2 callersFunctiongelu
Gaussian Error Linear Unit. Original Implementation of the gelu activation function in Google Bert repo when initially created. For infor
src/transformers/modeling_tf_xlm.py:74
↓ 2 callersFunctiongenerate_summaries_or_translations
( examples: list, out_file: str, model_name: str, batch_size: int = 8, device: str = DEFAU
examples/seq2seq/run_eval.py:25
↓ 2 callersFunctionget_bag_of_words_indices
(bag_of_words_ids_or_paths: List[str], tokenizer)
examples/text-generation/pplm/run_pplm.py:289
↓ 2 callersMethodget_batch
(self, i, bptt=None)
src/transformers/tokenization_transfo_xl.py:518
↓ 2 callersMethodget_config_dict
From a `pretrained_model_name_or_path`, resolve to a dictionary of parameters, to be used for instantiating a Config using `from_dict
src/transformers/configuration_utils.py:204
↓ 2 callersFunctionget_cpu_memory
measures current cpu memory usage of a given `process_id` Args: - `process_id`: (`int`)
src/transformers/benchmark/benchmark_utils.py:206
↓ 2 callersMethodget_encoder
(self)
src/transformers/modeling_t5.py:877
↓ 2 callersFunctionget_final_text
Project the tokenized prediction back to the original text.
templates/adding_a_new_example_script/utils_xxx.py:879
↓ 2 callersFunctionget_final_text
Project the tokenized prediction back to the original text.
src/transformers/data/metrics/squad_metrics.py:242
↓ 2 callersFunctionget_framework
Select framework (TensorFlow/PyTorch) to use. If both frameworks are installed and no specific model is provided, defaults to using PyTorch.
src/transformers/pipelines.py:70
↓ 2 callersFunctionget_git_info
()
examples/seq2seq/utils.py:214
↓ 2 callersMethodget_input_embeddings
Returns the model's input embeddings. Returns: :obj:`nn.Module`: A torch module mapping vocabulary to hi
src/transformers/modeling_utils.py:309
↓ 2 callersMethodget_input_embeddings
(self)
src/transformers/modeling_mobilebert.py:738
↓ 2 callersFunctionget_layers_to_copy
(n_to_get, tot)
examples/seq2seq/distillation.py:421
↓ 2 callersFunctionget_mmimdb_labels
()
examples/contrib/mm-imdb/utils_mmimdb.py:107
↓ 2 callersMethodget_output_embeddings
Returns the model's output embeddings. Returns: :obj:`nn.Module`: A torch module mapping hidden states t
src/transformers/modeling_utils.py:337
↓ 2 callersFunctionget_raw_scores
Computes the exact and f1 scores from the examples and the model predictions
src/transformers/data/metrics/squad_metrics.py:70
↓ 2 callersMethodget_rust_tokenizer
(self, **kwargs)
tests/test_tokenization_common.py:104
↓ 2 callersMethodget_special_tokens_mask
Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding special tokens using the
src/transformers/tokenization_xlm.py:880
↓ 2 callersMethodget_tokenizer
(self, **kwargs)
tests/test_tokenization_roberta.py:67
↓ 2 callersMethodhandle_args
(args: Sequence[Any])
src/transformers/pipelines.py:115
↓ 2 callersFunctionhans_convert_examples_to_features
Loads a data file into a list of ``InputFeatures`` Args: examples: List of ``InputExamples`` containing the examples. tokeni
examples/adversarial/utils_hans.py:276
↓ 2 callersMethodinit_decoder_state
Init decoder state
examples/seq2seq/bertabs/modeling_bertabs.py:247
↓ 2 callersMethodinit_mems
(self, bsz)
src/transformers/modeling_tf_transfo_xl.py:490
↓ 2 callersMethodinit_mems
(self, bsz)
src/transformers/modeling_transfo_xl.py:717
↓ 2 callersFunctioninit_student
(student, teacher)
examples/seq2seq/initialization_utils.py:6
↓ 2 callersFunctionis_apex_available
()
src/transformers/file_utils.py:151
↓ 2 callersFunctionis_sklearn_available
()
src/transformers/data/metrics/__init__.py:26
↓ 2 callersMethodis_valid_mbart
Is the configuration aligned with the MBART paper.
src/transformers/configuration_bart.py:138
↓ 2 callersMethodlength_penalty
(self)
examples/seq2seq/bertabs/modeling_bertabs.py:704
↓ 2 callersFunctionlist_field
(default=None, metadata=None)
tests/test_hf_argparser.py:11
↓ 2 callersMethodlist_objs
Call HF API to list all stored files for user (or one of their organizations).
src/transformers/hf_api.py:172
↓ 2 callersFunctionload_and_cache_examples
(args, tokenizer, evaluate=False, output_examples=False)
templates/adding_a_new_example_script/run_xxx.py:318
↓ 2 callersFunctionload_and_cache_examples
(args, tokenizer, evaluate=False, output_examples=False)
examples/contrib/run_swag.py:224
↓ 2 callersFunctionload_and_cache_examples
(args, tokenizer, evaluate=False, output_examples=False)
examples/distillation/run_squad_w_distillation.py:427
↓ 2 callersFunctionload_and_cache_examples
(args, task, tokenizer, evaluate=False)
examples/movement-pruning/masked_run_glue.py:503
↓ 2 callersFunctionload_and_cache_examples
(args, tokenizer, evaluate=False, output_examples=False)
examples/movement-pruning/masked_run_squad.py:583
↓ 2 callersFunctionload_and_cache_examples
(args, task, tokenizer, evaluate=False)
examples/text-classification/run_xnli.py:304
↓ 2 callersFunctionload_and_cache_examples
(args, task, tokenizer, evaluate=False)
examples/bert-loses-patience/run_glue_with_pabee.py:346
↓ 2 callersFunctionload_and_cache_examples
(args, tokenizer, evaluate=False, output_examples=False)
examples/question-answering/run_squad.py:403
↓ 2 callersFunctionload_examples
(args, tokenizer, evaluate=False)
examples/contrib/mm-imdb/run_mmimdb.py:303
↓ 2 callersFunctionload_pytorch_checkpoint_in_tf2_model
Load pytorch checkpoints in a TF 2.0 model
src/transformers/modeling_tf_pytorch_utils.py:73
↓ 2 callersFunctionload_pytorch_weights_in_tf2_model
Load pytorch state_dict in a TF 2.0 model.
src/transformers/modeling_tf_pytorch_utils.py:107
↓ 2 callersFunctionload_spm
(path: str)
src/transformers/tokenization_marian.py:227
↓ 2 callersFunctionload_vocab
Loads a vocabulary file into a dictionary.
src/transformers/tokenization_bert.py:100
↓ 2 callersFunctionload_yaml
(path)
src/transformers/convert_marian_to_pytorch.py:525
↓ 2 callersFunctionmain
(args, model=None)
examples/seq2seq/finetune.py:292
↓ 2 callersFunctionmain
()
examples/multiple-choice/run_multiple_choice.py:86
↓ 2 callersFunctionmain
()
examples/token-classification/run_ner.py:92
↓ 2 callersFunctionmain
()
examples/adversarial/run_hans.py:95
↓ 2 callersFunctionmain
()
examples/text-classification/run_glue.py:64
↓ 2 callersFunctionmain
()
examples/language-modeling/run_language_modeling.py:128
↓ 2 callersFunctionmeasure_peak_memory_cpu
measures peak cpu memory consumption of a given `function` running the function for at least interval seconds and at most 20
src/transformers/benchmark/benchmark_utils.py:183
↓ 2 callersMethodmoses_pipeline
(self, text, lang)
src/transformers/tokenization_xlm.py:672
↓ 2 callersMethodmoses_tokenize
(self, text, lang)
src/transformers/tokenization_xlm.py:664
↓ 2 callersMethodnum_examples
Helper to get num of examples from a DataLoader, by accessing its Dataset.
src/transformers/trainer.py:337
↓ 2 callersMethodnum_special_tokens_to_add
(self, pair: bool = False)
src/transformers/tokenization_utils_base.py:1430
↓ 2 callersFunctionp
(e)
docs/source/_static/js/custom.js:246
↓ 2 callersMethodparse_json_file
Alternative helper method that does not use `argparse` at all, instead loading a json file and populating the dataclass types.
src/transformers/hf_argparser.py:148
← previousnext →401–500 of 4,119, ranked by callers