MCPcopy Create free account

hub / github.com/XiangLi1999/PrefixTuning / functions

Functions3,725 in github.com/XiangLi1999/PrefixTuning

↓ 9 callersFunctionremove_prefix
(text: str, prefix: str)
transformers/src/transformers/convert_marian_to_pytorch.py:105
↓ 9 callersMethodrun
(self)
transformers/src/transformers/commands/run.py:82
↓ 9 callersFunctionsimple_accuracy
(preds, labels)
transformers/src/transformers/data/metrics/__init__.py:33
↓ 9 callersMethodstride_pool
Perform pooling by stride slicing the tensor along the given axis.
transformers/src/transformers/modeling_funnel.py:320
↓ 9 callersMethodstride_pool
Perform pooling by stride slicing the tensor along the given axis.
transformers/src/transformers/modeling_tf_funnel.py:308
↓ 9 callersMethodto_dict
Serializes this instance to a Python dictionary.
transformers/src/transformers/modelcard.py:203
↓ 9 callersMethodtransform
Scikit / Keras interface to transformers' pipelines. This method will forward to __call__().
transformers/src/transformers/pipelines.py:558
↓ 8 callersMethod__init__
(self, d_model, d_inner, dropout, pre_lnorm=False, layer_norm_epsilon=1e-5, init_std=0.02, **kwargs)
transformers/src/transformers/modeling_tf_transfo_xl.py:60
↓ 8 callersMethodcheck_model_type
Check if the model class is in supported by the pipeline. Args: supported_models (:obj:`List[str]` or :obj:`dict`):
transformers/src/transformers/pipelines.py:607
↓ 8 callersMethoddevice_placement
Context Manager allowing tensor allocation on the user-specified device in framework agnostic way. Returns: Context mana
transformers/src/transformers/pipelines.py:571
↓ 8 callersMethodinvert_attention_mask
Invert an attention mask (e.g., switches 0. and 1.). Args: encoder_attention_mask (:obj:`torch.Tensor`): An attention ma
transformers/src/transformers/modeling_utils.py:179
↓ 8 callersFunctionis_apex_available
()
transformers/src/transformers/file_utils.py:185
↓ 8 callersFunctionis_optuna_available
()
transformers/src/transformers/integrations.py:75
↓ 8 callersFunctionis_ray_available
()
transformers/src/transformers/integrations.py:79
↓ 8 callersFunctionset_tensor_by_indices_to_value
(tensor, indices, value)
transformers/src/transformers/generation_tf_utils.py:1028
↓ 7 callersMethod__init__
(self, nf, nx)
transformers/src/transformers/modeling_utils.py:1084
↓ 7 callersMethod__init__
( self, embed_dim, num_heads, dropout=0.0, bias=True, encoder_
transformers/src/transformers/modeling_fsmt.py:725
↓ 7 callersMethod__init__
(self, n_state, config)
transformers/src/transformers/modeling_gpt2_adapter.py:248
↓ 7 callersFunction_configure_library_root_logger
()
transformers/src/transformers/utils/logging.py:72
↓ 7 callersMethod_look_adjacent
Used to implement attention between consecutive chunks. Args: vectors: array of shape [batch_size, num_attention_heads, n_chunks,
transformers/src/transformers/modeling_reformer.py:274
↓ 7 callersMethodensure_tensor_on_device
Ensure PyTorch tensors are on the specified device. Args: inputs (keyword arguments that should be :obj:`torch.Tensor`):
transformers/src/transformers/pipelines.py:595
↓ 7 callersMethodget_dataless_input
(self, attribute_type=2, sample_size=10, sample_from_gpt=False, input_ids_prompt=None)
transformers/src/transformers/trainer_prefix.py:828
↓ 7 callersFunctionis_py3nvml_available
()
transformers/src/transformers/file_utils.py:181
↓ 7 callersFunctionis_remote_url
(url_or_filename)
transformers/src/transformers/file_utils.py:588
↓ 7 callersFunctionprune_conv1d_layer
Prune a Conv1D layer to keep only entries in index. A Conv1D work as a Linear layer (see e.g. BERT) but the weights are transposed. Used
transformers/src/transformers/modeling_utils.py:1549
↓ 7 callersMethodsave_model
Will save the model, so you can reload it using :obj:`from_pretrained()`. Will only save from the world_master process (unless in TP
transformers/src/transformers/trainer.py:1208
↓ 6 callersFunctionBody
(*x, **y)
transformers/src/transformers/commands/serving.py:22
↓ 6 callersMethod__init__
(self, n_state, config, **kwargs)
transformers/src/transformers/modeling_tf_openai.py:153
↓ 6 callersMethod__init__
(self, config)
transformers/src/transformers/modeling_flaubert.py:139
↓ 6 callersMethod__init__
(self, d_model, d_inner, dropout, pre_lnorm=False, layer_norm_epsilon=1e-5)
transformers/src/transformers/modeling_transfo_xl.py:192
↓ 6 callersMethod__init__
(self, n_state, config, **kwargs)
transformers/src/transformers/modeling_tf_gpt2.py:165
↓ 6 callersMethod__init__
(self, n_state, config)
transformers/src/transformers/modeling_gpt2.py:258
↓ 6 callersMethod__init__
(self, config, *inputs, **kwargs)
transformers/src/transformers/modeling_tf_ctrl.py:547
↓ 6 callersMethod_compute_logit
(self, hidden, weight, bias, proj)
transformers/src/transformers/modeling_transfo_xl_utilities.py:72
↓ 6 callersMethod_init_weight
(self, weight)
transformers/src/transformers/modeling_transfo_xl.py:467
↓ 6 callersMethod_report_to_hp_search
( self, trial: Union["optuna.Trial", Dict[str, Any]], epoch: int, metrics: Dict[str, float] )
transformers/src/transformers/trainer_prefix.py:743
↓ 6 callersMethod_split_hidden_size_dim
splits hidden_size dim into attn_head_size and num_attn_heads
transformers/src/transformers/modeling_reformer.py:297
↓ 6 callersMethodbold
(cls, s)
transformers/src/transformers/commands/user.py:57
↓ 6 callersFunctiondistributed_concat
(tensor: "torch.Tensor", num_total_examples: Optional[int] = None)
transformers/src/transformers/trainer_utils.py:183
↓ 6 callersMethodevaluate
Run evaluation and returns metrics. The calling script will be responsible for providing a method to compute metrics, as they are
transformers/src/transformers/trainer_prefix.py:2728
↓ 6 callersMethodevaluate
Run evaluation and returns metrics. The calling script will be responsible for providing a method to compute metrics, as they are
transformers/src/transformers/trainer.py:1305
↓ 6 callersMethodfrom_config
r""" Instantiates one of the base model classes of the library from a configuration. Note: Loading a model from its confi
transformers/src/transformers/modeling_auto.py:525
↓ 6 callersMethodget_input_embeddings
(self)
transformers/src/transformers/modeling_transfo_xl.py:781
↓ 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
transformers/src/transformers/file_utils.py:593
↓ 6 callersFunctionnested_numpify
Numpify `tensors` (even if it's a nested list/tuple of tensors).
transformers/src/transformers/trainer_utils.py:158
↓ 6 callersFunctionnested_xla_mesh_reduce
(tensors, name)
transformers/src/transformers/trainer_utils.py:172
↓ 6 callersMethodregister_subcommand
(parser: ArgumentParser)
transformers/src/transformers/commands/run.py:51
↓ 6 callersMethodtrain
Main training entry point. Args: model_path (:obj:`str`, `optional`): Local path to the model if the mod
transformers/src/transformers/trainer_prefix.py:1543
↓ 5 callersMethod__init__
(self, n_state, config)
transformers/src/transformers/modeling_openai.py:234
↓ 5 callersMethod_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:414
↓ 5 callersMethod_parse_and_tokenize
Parse arguments and tokenize
transformers/src/transformers/pipelines.py:624
↓ 5 callersMethod_tensorize_batch
( self, examples: List[Union[List[int], torch.Tensor, Dict[str, torch.Tensor]]] )
transformers/src/transformers/data/data_collator.py:860
↓ 5 callersMethodadd_tokens
Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to it with indices start
transformers/src/transformers/tokenization_utils_base.py:740
↓ 5 callersMethodget_config_dict
From a ``pretrained_model_name_or_path``, resolve to a dictionary of parameters, to be used for instantiating a :class:`~transformers
transformers/src/transformers/configuration_utils.py:319
↓ 5 callersMethodget_encoder
(self)
transformers/src/transformers/modeling_t5.py:934
↓ 5 callersMethodget_token
Get token or None if not existent.
transformers/src/transformers/hf_api.py:244
↓ 5 callersMethodis_local_process_zero
Whether or not this process is the local (e.g., on one machine if training in a distributed fashion on several machines) main process
transformers/src/transformers/trainer_prefix.py:2600
↓ 5 callersFunctionlmap
(f, x)
transformers/src/transformers/convert_marian_to_pytorch.py:416
↓ 5 callersFunctionlmap
list(map(f, x))
seq2seq/utils.py:67
↓ 5 callersMethodmoses_pipeline
(self, text, lang)
transformers/src/transformers/tokenization_xlm.py:667
↓ 5 callersMethodnum_examples
Helper to get number of samples in a :class:`~torch.utils.data.DataLoader` by accessing its dataset.
transformers/src/transformers/trainer_prefix.py:700
↓ 5 callersMethodnum_examples
Helper to get number of samples in a :class:`~torch.utils.data.DataLoader` by accessing its dataset.
transformers/src/transformers/trainer.py:552
↓ 5 callersMethodnum_examples
Helper to get number of samples in a :class:`~torch.utils.data.DataLoader` by accessing its dataset.
gpt2/trainer_prefix.py:590
↓ 5 callersMethodnum_special_tokens_to_add
Just EOS
transformers/src/transformers/tokenization_marian.py:196
↓ 5 callersMethodnum_special_tokens_to_add
(self, pair: bool = False)
transformers/src/transformers/tokenization_utils_base.py:1738
↓ 5 callersMethodpositional_embedding
(pos_seq, inv_freq, bsz=None)
transformers/src/transformers/modeling_xlnet.py:1016
↓ 5 callersMethodpositional_embedding
(pos_seq, inv_freq, bsz=None)
transformers/src/transformers/modeling_tf_xlnet.py:504
↓ 5 callersMethodquestion_encoder
(self)
transformers/src/transformers/modeling_rag.py:1033
↓ 5 callersMethodred
(cls, s)
transformers/src/transformers/commands/user.py:61
↓ 5 callersMethodsave_model
Will save the model, so you can reload it using :obj:`from_pretrained()`. Will only save from the world_master process (unless in TP
transformers/src/transformers/trainer_prefix.py:2632
↓ 5 callersMethodshape
projection
transformers/src/transformers/modeling_t5.py:340
↓ 5 callersMethodtrain
Main training entry point. Args: model_path (:obj:`str`, `optional`): Local path to the model if the mod
transformers/src/transformers/trainer.py:621
↓ 4 callersMethod__init__
(self, config: DPRConfig)
transformers/src/transformers/modeling_dpr.py:584
↓ 4 callersMethod_get_padding_truncation_strategies
Find the correct padding/truncation strategy with backward compatibility for old arguments (truncation_strategy and pad_to_max_length
transformers/src/transformers/tokenization_utils_base.py:1741
↓ 4 callersMethod_init_bias
(self, bias)
transformers/src/transformers/modeling_transfo_xl.py:473
↓ 4 callersMethod_remove_unused_columns
(self, dataset: "datasets.Dataset", description: Optional[str] = None)
transformers/src/transformers/trainer_prefix.py:429
↓ 4 callersMethod_remove_unused_columns
(self, dataset: "datasets.Dataset", description: Optional[str] = None)
transformers/src/transformers/trainer.py:309
↓ 4 callersMethod_remove_unused_columns
(self, dataset: "datasets.Dataset", description: Optional[str] = None)
gpt2/trainer_prefix.py:361
↓ 4 callersMethod_rotate_checkpoints
(self, use_mtime=False)
transformers/src/transformers/trainer_prefix.py:2713
↓ 4 callersMethod_tensorize_batch
(self, examples: List[torch.Tensor])
transformers/src/transformers/data/data_collator.py:1434
↓ 4 callersMethod_tie_or_clone_weights
Tie or clone module weights depending of whether we are using TorchScript or not
transformers/src/transformers/modeling_utils.py:548
↓ 4 callersMethodbatch_decode
(self, *args, **kwargs)
transformers/src/transformers/tokenization_rag.py:61
↓ 4 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
transformers/src/transformers/tokenization_t5.py:191
↓ 4 callersFunctionconvert_tf_checkpoint_to_pytorch
(tf_checkpoint_path, config_file, pytorch_dump_path)
transformers/src/transformers/convert_funnel_original_tf_checkpoint_to_pytorch.py:29
↓ 4 callersMethodcount_file
(self, path, verbose=False, add_eos=False)
transformers/src/transformers/tokenization_transfo_xl.py:226
↓ 4 callersMethoddevice
:obj:`torch.device`: The device on which the module is (assuming that all the module parameters are on the same device).
transformers/src/transformers/modeling_utils.py:143
↓ 4 callersMethodfor_model
(cls, model_type: str, *args, **kwargs)
transformers/src/transformers/configuration_auto.py:225
↓ 4 callersFunctiongelu
Gaussian Error Linear Unit. Original Implementation of the gelu activation function in Google Bert repo when initially created. For inform
transformers/src/transformers/activations_tf.py:6
↓ 4 callersFunctionget_activation
(activation_string)
transformers/src/transformers/activations.py:58
↓ 4 callersMethodget_input_embeddings
(self)
transformers/src/transformers/modeling_mobilebert.py:827
↓ 4 callersMethodgroup_sub_entities
Group together the adjacent tokens with the same entity predicted. Args: entities (:obj:`dict`): The entities predicted
transformers/src/transformers/pipelines.py:1430
↓ 4 callersFunctioninvert_mask
Turns 1->0, 0->1, False->True, True-> False
transformers/src/transformers/modeling_bart.py:133
↓ 4 callersFunctionis_psutil_available
()
transformers/src/transformers/file_utils.py:177
↓ 4 callersMethodis_world_master
Whether or not this process is the global main process (when training in a distributed fashion on several machines, this is only goin
transformers/src/transformers/trainer.py:1186
↓ 4 callersFunctionnested_concat
Concat the `new_tensors` to `tensors` on `dim`. Works for tensors or nested list/tuples of tensors.
transformers/src/transformers/trainer_utils.py:145
↓ 4 callersFunctionnormalize_answer
Lower text and remove punctuation, articles and extra whitespace.
transformers/src/transformers/data/metrics/squad_metrics.py:25
↓ 4 callersMethodpool_tensor
Apply 1D pooling to a tensor of size [B x T (x H)].
transformers/src/transformers/modeling_funnel.py:349
↓ 4 callersMethodpool_tensor
Apply 1D pooling to a tensor of size [B x T (x H)].
transformers/src/transformers/modeling_tf_funnel.py:335
↓ 4 callersMethodpostprocess_next_token_scores
( self, scores, input_ids, no_repeat_ngram_size, bad_words_ids,
transformers/src/transformers/generation_utils.py:71
↓ 4 callersMethodprint_results
(self, result_dict, type_label)
transformers/src/transformers/benchmark/benchmark_utils.py:806
← previousnext →101–200 of 3,725, ranked by callers