MCPcopy Create free account

hub / github.com/cedrickchee/transformers-llama / functions

Functions36,568 in github.com/cedrickchee/transformers-llama

↓ 34 callersFunctiondeps_list
(*pkgs)
setup.py:210
↓ 34 callersMethodgradient_checkpointing_enable
Activates gradient checkpointing for the current model. Note that in other frameworks this feature can be referred to as "activation
src/transformers/modeling_utils.py:1576
↓ 34 callersMethodsequence_ids
Return a list mapping the tokens to the id of their original sentences: - `None` for special tokens added around or between sequ
src/transformers/tokenization_utils_base.py:301
↓ 34 callersMethodshuffle
(self, buffer_size=1000)
examples/research_projects/codeparrot/scripts/codeparrot_training.py:93
↓ 33 callersMethodevaluate
(self, state, dataset)
examples/research_projects/jax-projects/big_bird/bigbird_flax.py:262
↓ 33 callersFunctionload_flax_weights_in_pytorch_model
Load flax checkpoints in a PyTorch model
src/transformers/modeling_flax_pytorch_utils.py:302
↓ 33 callersMethodstep
Performs a single optimization step. Arguments: closure (`Callable`, *optional*): A closure that reevaluates the model a
src/transformers/optimization.py:409
↓ 32 callersFunctionadd_start_docstrings
(*docstr)
src/transformers/utils/doc.py:23
↓ 32 callersMethodidentity
Constructs an identity transformation. Args: shape: The desired shape dtype:
src/transformers/models/esm/openfold_utils/rigid_utils.py:786
↓ 32 callersMethodregister
Register a new configuration for this class. Args: model_type (`str`): The model type like "bert" or "gpt".
src/transformers/models/auto/configuration_auto.py:927
↓ 31 callersMethod__init__
This class computes the losses using the class predictions, mask predictions and the contrastive queries. Oneformer calculates the c
src/transformers/models/oneformer/modeling_oneformer.py:350
↓ 31 callersFunctioncompute_effective_axis_dimension
Args: dimension: fixed_dimension: num_token_to_add: Returns:
src/transformers/onnx/utils.py:38
↓ 31 callersMethodto
Analogous to the to() method of torch Tensors Args: device: A torch device dtype:
src/transformers/models/esm/openfold_utils/rigid_utils.py:684
↓ 30 callersMethodadd
Passes over every char (utf-8 char) on word and recursively adds it to the internal `data` trie representation. The special key `""`
src/transformers/tokenization_utils.py:61
↓ 30 callersMethodassert_almost_equals
(self, a: np.ndarray, b: np.ndarray, tol: float)
tests/models/encoder_decoder/test_modeling_tf_encoder_decoder.py:602
↓ 30 callersMethodcuda
Moves the transformation object to GPU memory Returns: A version of the transformation on GPU
src/transformers/models/esm/openfold_utils/rigid_utils.py:1235
↓ 30 callersMethodfrom_dict
Overrides the `from_dict` method from the base class to make sure `reduce_labels` is updated if image processor is created using from
src/transformers/models/beit/image_processing_beit.py:141
↓ 30 callersMethodfrom_encoder_decoder_configs
r""" Instantiate a [`EncoderDecoderConfig`] (or a derived class) from a pre-trained encoder model configuration and decoder model conf
src/transformers/models/encoder_decoder/configuration_encoder_decoder.py:92
↓ 30 callersMethodis_world_process_zero
Whether or not this process is the global main process (when training in a distributed fashion on several machines, this is only goin
src/transformers/trainer.py:2698
↓ 29 callersMethod_get_padding_truncation_strategies
Find the correct padding/truncation strategy with backward compatibility for old arguments (truncation_strategy and pad_to_max_length
src/transformers/tokenization_utils_base.py:2318
↓ 29 callersFunctionappend_replace_return_docstrings
(model_class, output_type, config_class)
src/transformers/modeling_flax_utils.py:1165
↓ 29 callersMethodget_words_and_boxes
(self)
tests/models/layoutxlm/test_tokenization_layoutxlm.py:65
↓ 29 callersMethodinit_cache
r""" Args: batch_size (`int`): batch_size used for fast auto-regressive decoding. Defines the batch size of the in
src/transformers/models/t5/modeling_flax_t5.py:1036
↓ 29 callersMethodsample
r""" Generates sequences of token ids for models with a language modeling head using **multinomial sampling** and can be used for text
src/transformers/generation/utils.py:2283
↓ 28 callersMethod__init__
(self, feat_size, epsilon=None, **kwargs)
src/transformers/models/mobilebert/modeling_tf_mobilebert.py:145
↓ 28 callersMethodconvert_batch_encode_plus_format_to_encode_plus
(batch_encode_plus_sequences)
tests/test_tokenization_common.py:329
↓ 28 callersMethodget_nodes_and_xpaths
(self)
tests/models/markuplm/test_tokenization_markuplm.py:73
↓ 28 callersMethodget_words_and_boxes
(self)
tests/models/layoutlmv2/test_tokenization_layoutlmv2.py:71
↓ 28 callersFunctioninfer_channel_dimension_format
Infers the channel dimension format of `image`. Args: image (`np.ndarray`): The image to infer the channel dimension of.
src/transformers/image_utils.py:143
↓ 28 callersFunctionis_speech_available
()
src/transformers/utils/import_utils.py:700
↓ 28 callersFunctionloss_fn
(params)
examples/flax/question-answering/run_qa.py:903
↓ 28 callersMethodresize
Resizes `image`. Enforces conversion of input to PIL.Image. Args: image (`PIL.Image.Image` or `np.ndarray` or `torch.Ten
src/transformers/image_utils.py:448
↓ 28 callersMethodsave_pretrained
(self, path: str, filename_prefix: str = None)
src/transformers/models/deberta_v2/tokenization_deberta_v2.py:494
↓ 27 callersMethod__init__
(self, feat_size, eps=None)
src/transformers/models/mobilebert/modeling_mobilebert.py:161
↓ 27 callersMethod_convert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
src/transformers/models/t5/tokenization_t5.py:309
↓ 27 callersFunctionget_full_repo_name
(model_id: str, organization: Optional[str] = None, token: Optional[str] = None)
src/transformers/utils/hub.py:793
↓ 27 callersMethodget_process_log_level
Returns the log level to be used depending on whether this process is the main process of node 0, main process of node non-0, or a no
src/transformers/training_args.py:1772
↓ 27 callersMethodget_tokenizers
(self, **kwargs)
tests/models/layoutlmv3/test_processor_layoutlmv3.py:95
↓ 27 callersMethodhf_compute_loss
CrossEntropyLoss that ignores pad tokens
src/transformers/models/rag/modeling_tf_rag.py:1261
↓ 27 callersFunctionis_timm_available
()
src/transformers/utils/import_utils.py:688
↓ 27 callersMethodtrain
(self, state, tr_dataset, val_dataset)
examples/research_projects/jax-projects/big_bird/bigbird_flax.py:229
↓ 26 callersMethod__init__
(self, config: ClapConfig)
src/transformers/models/clap/modeling_clap.py:1939
↓ 26 callersFunction_add_variant
(weights_name: str, variant: Optional[str] = None)
src/transformers/modeling_utils.py:681
↓ 26 callersMethod_get_uniform_logits
(self, batch_size: int, length: int)
tests/generation/test_logits_process.py:56
↓ 26 callersMethodget_tokenizer
(self, **kwargs)
tests/models/git/test_processor_git.py:45
↓ 26 callersMethodget_tokenizers
(self, **kwargs)
tests/models/markuplm/test_processor_markuplm.py:80
↓ 26 callersMethodget_tokenizers
(self, **kwargs)
tests/models/layoutlmv2/test_processor_layoutlmv2.py:82
↓ 26 callersMethodget_words_and_boxes
(self)
tests/models/layoutlmv3/test_tokenization_layoutlmv3.py:60
↓ 26 callersMethodlinear
(w, b, x)
src/transformers/models/deberta/modeling_deberta.py:643
↓ 26 callersMethodnum_parameters
Get number of (optionally, trainable or non-embeddings) parameters in the module. Args: only_trainable (`bool`, *optiona
src/transformers/modeling_utils.py:899
↓ 26 callersMethodprint_fn
(self)
src/transformers/benchmark/benchmark_utils.py:633
↓ 25 callersMethod__init__
(self, config, layer_id=0)
src/transformers/models/wav2vec2/modeling_wav2vec2.py:1997
↓ 25 callersMethod_prepare_for_class
(self, inputs_dict, model_class, return_labels=False)
tests/models/mobilebert/test_modeling_mobilebert.py:287
↓ 25 callersMethodcheck_config_can_be_init_without_params
(self)
tests/test_configuration_common.py:183
↓ 25 callersMethodcreate_and_test_config_from_and_save_pretrained
(self)
tests/test_configuration_common.py:154
↓ 25 callersMethodcreate_and_test_config_to_json_file
(self)
tests/test_configuration_common.py:144
↓ 25 callersMethodcreate_and_test_config_to_json_string
(self)
tests/test_configuration_common.py:138
↓ 25 callersMethodcreate_and_test_config_with_num_labels
(self)
tests/test_configuration_common.py:174
↓ 25 callersFunctionema
(x)
src/transformers/models/mobilenet_v2/modeling_mobilenet_v2.py:78
↓ 25 callersFunctionis_datasets_available
()
src/transformers/utils/import_utils.py:490
↓ 25 callersMethodnormalize
Normalize an image. image = (image - image_mean) / image_std. Args: image (`np.ndarray`): Image to norma
src/transformers/models/vit/image_processing_vit.py:152
↓ 25 callersMethodpad
(self, images)
examples/research_projects/lxmert/processing_image.py:87
↓ 25 callersMethodrun_task_tests
Run pipeline tests for a specific `task` Args: task (`str`): A task name. This should be a key in the mapping `pi
tests/test_pipeline_mixin.py:113
↓ 25 callersMethodtokenize
Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the gi
src/transformers/models/bert/tokenization_bert.py:527
↓ 24 callersMethod__init__
(self, config, layer_id=0)
src/transformers/models/wav2vec2_conformer/modeling_wav2vec2_conformer.py:1955
↓ 24 callersMethod_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/transformers/models/t5/tokenization_t5.py:301
↓ 24 callersFunction_is_punctuation
Checks whether `chars` is a punctuation character.
src/transformers/models/deberta_v2/tokenization_deberta_v2.py:528
↓ 24 callersMethod_prepare_for_class
(self, inputs_dict, model_class, return_labels=False)
tests/models/luke/test_modeling_luke.py:622
↓ 24 callersMethod_prepare_for_class
(self, inputs_dict, model_class, return_labels=False)
tests/models/conditional_detr/test_modeling_conditional_detr.py:205
↓ 24 callersMethodcreate_model_card
Creates a draft of a model card using the information available to the `Trainer`. Args: language (`str`, *optional*):
src/transformers/trainer.py:3453
↓ 24 callersMethodget_table
( self, tokenizer: TapasTokenizer, length=5, )
tests/models/tapas/test_tokenization_tapas.py:56
↓ 24 callersMethodget_tokenizers
(self, **kwargs)
tests/models/layoutxlm/test_processor_layoutxlm.py:70
↓ 24 callersMethodtranspose_for_scores
(self, x: torch.Tensor)
src/transformers/models/esm/modeling_esm.py:283
↓ 23 callersMethod__init__
(self, config, layer_id=0)
src/transformers/models/wavlm/modeling_wavlm.py:1656
↓ 23 callersMethod__init__
(self, config, seed=None)
src/transformers/models/big_bird/modeling_big_bird.py:1438
↓ 23 callersMethod__init__
(self, config: FlavaPossibleConfigs)
src/transformers/models/flava/modeling_flava.py:595
↓ 23 callersFunction_is_control
Checks whether `chars` is a control character.
src/transformers/models/deberta_v2/tokenization_deberta_v2.py:516
↓ 23 callersFunction_is_whitespace
Checks whether `chars` is a whitespace character.
src/transformers/models/deberta_v2/tokenization_deberta_v2.py:504
↓ 23 callersFunctioncenter_crop
Crops the `image` to the specified `size` using a center crop. Note that if the image is too small to be cropped to the size given, it will b
src/transformers/image_transforms.py:355
↓ 23 callersMethodfrom_pretrained
(cls, *args, **kwargs)
src/transformers/models/speech_encoder_decoder/modeling_speech_encoder_decoder.py:277
↓ 23 callersMethodgenerate
Generate an image from the given prompts. If image_path is provided, the image is used as a starting point for the optimization. If im
examples/research_projects/vqgan-clip/VQGAN_CLIP.py:211
↓ 23 callersFunctionpad
Pads the `image` with the specified (height, width) `padding` and `mode`. Args: image (`np.ndarray`): The image to pad.
src/transformers/image_transforms.py:607
↓ 23 callersMethodprepare_config_and_inputs
(self)
tests/models/wav2vec2/test_modeling_wav2vec2.py:215
↓ 23 callersMethodprepare_tf_dataset
Wraps a HuggingFace [`~datasets.Dataset`] as a `tf.data.Dataset` with collation and batching. This method is designed to create a "re
src/transformers/modeling_tf_utils.py:1297
↓ 22 callersMethod__init__
(self, config)
src/transformers/models/ernie/modeling_ernie.py:381
↓ 22 callersMethod__init__
(self, config)
src/transformers/models/nezha/modeling_nezha.py:454
↓ 22 callersMethod__init__
(self, config: BertConfig, **kwargs)
src/transformers/models/bert/modeling_tf_bert.py:446
↓ 22 callersMethod__init__
(self, config)
src/transformers/models/bert/modeling_bert.py:469
↓ 22 callersMethod__init__
(self, config)
src/transformers/models/bridgetower/modeling_bridgetower.py:1176
↓ 22 callersMethod__init__
(self, config)
src/transformers/models/jukebox/modeling_jukebox.py:789
↓ 22 callersMethod__init__
(self, config)
src/transformers/models/megatron_bert/modeling_megatron_bert.py:422
↓ 22 callersMethod__init__
(self, config)
src/transformers/models/dpt/modeling_dpt.py:982
↓ 22 callersMethod__init__
(self, config, layer_id=0)
src/transformers/models/unispeech_sat/modeling_unispeech_sat.py:1735
↓ 22 callersMethodapply
Args: inputs (`torch.FloatTensor`) The input matrix from which the binarizer computes the binary mask.
examples/research_projects/movement-pruning/emmental/modules/binarizer.py:121
↓ 22 callersMethodcheck_config_arguments_init
(self)
tests/test_configuration_common.py:189
↓ 22 callersMethodcheck_result
(self, file_name, expected_result)
tests/utils/test_add_new_model_like.py:93
↓ 22 callersMethodcheck_results_dict_not_empty
(self, results)
tests/benchmark/test_benchmark.py:30
↓ 22 callersMethodinit_file
(self, file_name, content)
tests/utils/test_add_new_model_like.py:89
↓ 22 callersFunctionrequire_version_core
require_version wrapper which emits a core-specific hint on failure
src/transformers/utils/versions.py:120
↓ 22 callersMethodtokenizer
(self)
tests/models/t5/test_modeling_t5.py:891
← previousnext →201–300 of 36,568, ranked by callers