MCPcopy Create free account

hub / github.com/DAMO-NLP-SG/multilingual_analysis / functions

Functions1,603 in github.com/DAMO-NLP-SG/multilingual_analysis

↓ 2 callersMethodgenerate
r""" Generates sequences of token ids for models with a language modeling head. <Tip warning={true}> Most generation-contro
neuron_detection/transformers/generation/utils.py:1115
↓ 2 callersMethodgenerate
r""" Generates sequences of token ids for models with a language modeling head. <Tip warning={true}> Most generation-contro
neuron_deactivate/transformers/generation/utils.py:1302
↓ 2 callersMethodget_vocab
Returns vocab as a dict
neuron_detection/transformers/models/llama/tokenization_llama.py:228
↓ 2 callersMethodget_vocab
Returns vocab as a dict
neuron_deactivate/transformers/models/llama/tokenization_llama.py:228
↓ 2 callersMethodinit_hf_repo
Initializes a git repo in `self.args.hub_model_id`.
neuron_enhancement/transformers/trainer.py:3765
↓ 2 callersMethodinit_state
(self)
neuron_detection/transformers/generation/beam_constraints.py:370
↓ 2 callersMethodinit_state
(self)
neuron_deactivate/transformers/generation/beam_constraints.py:370
↓ 2 callersMethodis_done
If there are enough hypotheses and that none of the hypotheses being generated can become better than the worst one in the heap, then
neuron_deactivate/transformers/generation/beam_search.py:979
↓ 2 callersMethodon_finalized_text
Prints the new text to stdout. If the stream is ending, also prints a newline.
neuron_detection/transformers/generation/streamers.py:130
↓ 2 callersMethodon_finalized_text
Prints the new text to stdout. If the stream is ending, also prints a newline.
neuron_deactivate/transformers/generation/streamers.py:130
↓ 2 callersFunctionpermute
(w, n_heads=n_heads, dim1=dim, dim2=dim)
neuron_detection/transformers/models/mistral/convert_mistral_weights_to_hf.py:122
↓ 2 callersFunctionpermute
(w, n_heads=n_heads, dim1=dim, dim2=dim)
neuron_deactivate/transformers/models/mistral/convert_mistral_weights_to_hf.py:122
↓ 2 callersMethodprediction_step
Perform an evaluation step on `model` using `inputs`. Subclass and override to inject custom behavior. Args: mo
neuron_enhancement/transformers/trainer.py:3642
↓ 2 callersMethodpropagate_args_to_deepspeed
Sets values in the deepspeed plugin based on the Trainer args
neuron_enhancement/transformers/trainer.py:4257
↓ 2 callersMethodremaining
Returns the number of remaining steps of `advance()` in order to complete this constraint.
neuron_detection/transformers/generation/beam_constraints.py:105
↓ 2 callersMethodremaining
Returns the number of remaining steps of `advance()` in order to complete this constraint.
neuron_deactivate/transformers/generation/beam_constraints.py:105
↓ 2 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
neuron_detection/transformers/models/mistral/modeling_tf_mistral.py:219
↓ 2 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
neuron_deactivate/transformers/models/mistral/modeling_tf_mistral.py:219
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
neuron_detection/transformers/models/llama/modeling_llama.py:179
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
neuron_detection/transformers/models/mistral/modeling_tf_mistral.py:152
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
neuron_detection/transformers/models/mistral/modeling_mistral.py:111
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
neuron_detection/transformers/models/gemma2/modeling_gemma2.py:119
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
layers/transformers/models/modeling_qwen2.py:136
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
layers/transformers/models/modeling_llama.py:178
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
neuron_deactivate/transformers/models/llama/modeling_llama.py:247
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
neuron_deactivate/transformers/models/mistral/modeling_tf_mistral.py:152
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
neuron_deactivate/transformers/models/mistral/modeling_mistral.py:113
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
neuron_deactivate/transformers/models/gemma2/modeling_gemma2.py:159
↓ 2 callersMethodsample
r""" Generates sequences of token ids for models with a language modeling head using **multinomial sampling** and can be used for text
neuron_detection/transformers/generation/utils.py:2382
↓ 1 callersFunctionPrompting
(model, prompt, candidate_premature_layers)
neuron_detection/neuron_detection.py:32
↓ 1 callersFunctionPrompting
(model, prompt, candidate_premature_layers)
layers/test_layer.py:42
↓ 1 callersMethod__init__
( self, epsilon: float, filter_value: float = -float("Inf"), min_tokens_to_keep: int = 1, device: str
neuron_detection/transformers/generation/logits_process.py:817
↓ 1 callersMethod__init__
(self, tokenizer: "AutoTokenizer", skip_prompt: bool = False, **decode_kwargs)
neuron_detection/transformers/generation/streamers.py:72
↓ 1 callersMethod__init__
( self, epsilon: float, filter_value: float = -float("Inf"), min_tokens_to_keep: int = 1, device: str
neuron_deactivate/transformers/generation/logits_process.py:817
↓ 1 callersMethod__init__
(self, tokenizer: "AutoTokenizer", skip_prompt: bool = False, **decode_kwargs)
neuron_deactivate/transformers/generation/streamers.py:72
↓ 1 callersMethod_activate_neftune
r""" Activates the neftune as presented in this code: https://github.com/neelsjain/NEFTune and paper: https://arxiv.org/abs/2310.05914
neuron_enhancement/transformers/trainer.py:657
↓ 1 callersMethod_adapt_logits_for_beam_search
This function can be overwritten in the specific modeling_flax_<model-name>.py classes to allow for custom beam search behavior. Note
neuron_detection/transformers/generation/flax_utils.py:219
↓ 1 callersMethod_adapt_logits_for_beam_search
This function can be overwritten in the specific modeling_flax_<model-name>.py classes to allow for custom beam search behavior. Note
neuron_deactivate/transformers/generation/flax_utils.py:219
↓ 1 callersMethod_apply_eos_token_mask
(self, scores: tf.Tensor)
neuron_detection/transformers/generation/tf_logits_process.py:223
↓ 1 callersMethod_apply_eos_token_mask
(self, scores: tf.Tensor)
neuron_deactivate/transformers/generation/tf_logits_process.py:223
↓ 1 callersMethod_beam_search
This beam search function is heavily inspired by Flax's official example: https://github.com/google/flax/blob/main/examples/wmt/decod
neuron_detection/transformers/generation/flax_utils.py:748
↓ 1 callersMethod_beam_search
This beam search function is heavily inspired by Flax's official example: https://github.com/google/flax/blob/main/examples/wmt/decod
neuron_deactivate/transformers/generation/flax_utils.py:748
↓ 1 callersFunction_calc_banned_ngram_tokens
Copied from fairseq for no_repeat_ngram in beam_search
neuron_detection/transformers/generation/logits_process.py:901
↓ 1 callersFunction_calc_banned_ngram_tokens
Copied from fairseq for no_repeat_ngram in beam_search
neuron_deactivate/transformers/generation/logits_process.py:901
↓ 1 callersMethod_calc_row_banned_bad_tokens
(self, row_input_ids: tf.Tensor)
neuron_detection/transformers/generation/tf_logits_process.py:327
↓ 1 callersMethod_calc_row_banned_bad_tokens
(self, row_input_ids: tf.Tensor)
neuron_deactivate/transformers/generation/tf_logits_process.py:327
↓ 1 callersMethod_compute_pval
(self, x, loc=0, scale=1)
neuron_detection/transformers/generation/watermarking.py:186
↓ 1 callersMethod_compute_pval
(self, x, loc=0, scale=1)
neuron_deactivate/transformers/generation/watermarking.py:186
↓ 1 callersMethod_compute_z_score
(self, green_token_count: np.array, total_num_tokens: np.array)
neuron_detection/transformers/generation/watermarking.py:179
↓ 1 callersMethod_compute_z_score
(self, green_token_count: np.array, total_num_tokens: np.array)
neuron_deactivate/transformers/generation/watermarking.py:179
↓ 1 callersMethod_concatenate_to_cache
This function takes projected key, value states from a single input token and concatenates the states to cached states from previous
neuron_detection/transformers/models/llama/modeling_flax_llama.py:234
↓ 1 callersMethod_concatenate_to_cache
This function takes projected key, value states from a single input token and concatenates the states to cached states from previous
neuron_detection/transformers/models/mistral/modeling_flax_mistral.py:254
↓ 1 callersMethod_concatenate_to_cache
This function takes projected key, value states from a single input token and concatenates the states to cached states from previous
neuron_deactivate/transformers/models/llama/modeling_flax_llama.py:234
↓ 1 callersMethod_concatenate_to_cache
This function takes projected key, value states from a single input token and concatenates the states to cached states from previous
neuron_deactivate/transformers/models/mistral/modeling_flax_mistral.py:254
↓ 1 callersMethod_convert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
neuron_detection/transformers/models/llama/tokenization_llama.py:277
↓ 1 callersMethod_convert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
neuron_deactivate/transformers/models/llama/tokenization_llama.py:276
↓ 1 callersMethod_create_score_penalties
(self, input_ids: tf.Tensor, logits: tf.Tensor)
neuron_detection/transformers/generation/tf_logits_process.py:254
↓ 1 callersMethod_create_score_penalties
(self, input_ids: tf.Tensor, logits: tf.Tensor)
neuron_deactivate/transformers/generation/tf_logits_process.py:254
↓ 1 callersFunction_crop_past_key_values
Crops the past key values up to a certain maximum length.
neuron_detection/transformers/generation/candidate_generator.py:353
↓ 1 callersFunction_crop_past_key_values
Crops the past key values up to a certain maximum length.
neuron_deactivate/transformers/generation/candidate_generator.py:370
↓ 1 callersMethod_deactivate_neftune
Deactivates the neftune method. Make sure to call `_activate_neftune` first.
neuron_enhancement/transformers/trainer.py:676
↓ 1 callersMethod_dict_from_json_file
(cls, json_file: Union[str, os.PathLike])
neuron_detection/transformers/generation/configuration_utils.py:967
↓ 1 callersMethod_dict_from_json_file
(cls, json_file: Union[str, os.PathLike])
neuron_deactivate/transformers/generation/configuration_utils.py:1005
↓ 1 callersMethod_dynamic_frequency_update
dynamic RoPE layers should recompute `inv_freq` in the following situations: 1 - growing beyond the cached sequence length (allow sca
neuron_deactivate/transformers/models/llama/modeling_llama.py:180
↓ 1 callersFunction_expand_mask
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
neuron_detection/transformers/models/mistral/modeling_tf_mistral.py:84
↓ 1 callersFunction_expand_mask
Expands attention_mask from `[batch_size, src_length]` to `[batch_size, 1, tgt_length, src_length]`.
layers/transformers/models/modeling_bloom.py:76
↓ 1 callersFunction_expand_mask
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
neuron_deactivate/transformers/models/mistral/modeling_tf_mistral.py:84
↓ 1 callersMethod_flash_attention_forward
Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token first unpad the input, th
neuron_detection/transformers/models/llama/modeling_llama.py:560
↓ 1 callersMethod_flash_attention_forward
Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token first unpad the input, th
neuron_detection/transformers/models/gemma2/modeling_gemma2.py:456
↓ 1 callersMethod_flash_attention_forward
Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token first unpad the input, th
neuron_detection/transformers/models/gemma2/diff_gemma2.py:198
↓ 1 callersMethod_flash_attention_forward
Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token first unpad the input, th
layers/transformers/models/modeling_qwen2.py:480
↓ 1 callersMethod_flash_attention_forward
Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token first unpad the input, th
layers/transformers/models/modeling_llama.py:505
↓ 1 callersMethod_get_decoder_start_token_id
(self, decoder_start_token_id: int = None, bos_token_id: int = None)
neuron_detection/transformers/generation/utils.py:658
↓ 1 callersMethod_get_decoder_start_token_id
(self, decoder_start_token_id: int = None, bos_token_id: int = None)
neuron_detection/transformers/generation/flax_utils.py:186
↓ 1 callersMethod_get_decoder_start_token_id
(self, decoder_start_token_id: int = None, bos_token_id: int = None)
neuron_detection/transformers/generation/tf_utils.py:1115
↓ 1 callersMethod_get_decoder_start_token_id
(self, decoder_start_token_id: int = None, bos_token_id: int = None)
layers/transformers/generation/utils.py:658
↓ 1 callersMethod_get_decoder_start_token_id
(self, decoder_start_token_id: int = None, bos_token_id: int = None)
neuron_deactivate/transformers/generation/utils.py:711
↓ 1 callersMethod_get_decoder_start_token_id
(self, decoder_start_token_id: int = None, bos_token_id: int = None)
neuron_deactivate/transformers/generation/flax_utils.py:186
↓ 1 callersMethod_get_decoder_start_token_id
(self, decoder_start_token_id: int = None, bos_token_id: int = None)
neuron_deactivate/transformers/generation/tf_utils.py:1115
↓ 1 callersMethod_get_generation_mode
Returns the generation mode triggered by a [`GenerationConfig`] instance.
neuron_deactivate/transformers/generation/utils.py:850
↓ 1 callersMethod_get_logits_processor
This class returns a [`LogitsProcessorList`] list object that contains all relevant [`LogitsProcessor`] instances used to modify the
neuron_detection/transformers/generation/utils.py:795
↓ 1 callersMethod_get_logits_processor
This class returns a [`FlaxLogitsProcessorList`] list object that contains all relevant [`FlaxLogitsProcessor`] instances used to mod
neuron_detection/transformers/generation/flax_utils.py:492
↓ 1 callersMethod_get_logits_processor
This class returns a [`TFLogitsProcessorList`] list object that contains all relevant [`TFLogitsProcessor`] instances used to modify
neuron_detection/transformers/generation/tf_utils.py:1450
↓ 1 callersMethod_get_logits_processor
This class returns a [`LogitsProcessorList`] list object that contains all relevant [`LogitsProcessor`] instances used to modify the
layers/transformers/generation/utils.py:795
↓ 1 callersMethod_get_logits_processor
This class returns a [`LogitsProcessorList`] list object that contains all relevant [`LogitsProcessor`] instances used to modify the
neuron_deactivate/transformers/generation/utils.py:890
↓ 1 callersMethod_get_logits_processor
This class returns a [`FlaxLogitsProcessorList`] list object that contains all relevant [`FlaxLogitsProcessor`] instances used to mod
neuron_deactivate/transformers/generation/flax_utils.py:492
↓ 1 callersMethod_get_logits_processor
This class returns a [`TFLogitsProcessorList`] list object that contains all relevant [`TFLogitsProcessor`] instances used to modify
neuron_deactivate/transformers/generation/tf_utils.py:1450
↓ 1 callersMethod_get_logits_warper
This class returns a [`FlaxLogitsProcessorList`] list object that contains all relevant [`FlaxLogitsWarper`] instances used for multi
neuron_detection/transformers/generation/flax_utils.py:476
↓ 1 callersMethod_get_logits_warper
This class returns a [`FlaxLogitsProcessorList`] list object that contains all relevant [`FlaxLogitsWarper`] instances used for multi
neuron_deactivate/transformers/generation/flax_utils.py:476
↓ 1 callersMethod_get_stopping_criteria
( self, generation_config: GenerationConfig, stopping_criteria: Optional[StoppingCriteriaList] )
neuron_detection/transformers/generation/utils.py:912
↓ 1 callersMethod_get_stopping_criteria
( self, generation_config: GenerationConfig, stopping_criteria: Optional[StoppingCriteriaList] )
layers/transformers/generation/utils.py:912
↓ 1 callersMethod_get_stopping_criteria
( self, generation_config: GenerationConfig, stopping_criteria: Optional[StoppingCriteriaList] )
neuron_deactivate/transformers/generation/utils.py:1021
↓ 1 callersMethod_get_train_sampler
(self)
neuron_enhancement/transformers/trainer.py:796
↓ 1 callersFunction_get_unpad_data
(attention_mask)
neuron_detection/transformers/models/llama/modeling_llama.py:63
↓ 1 callersFunction_get_unpad_data
(attention_mask)
neuron_detection/transformers/models/gemma2/modeling_gemma2.py:62
↓ 1 callersFunction_get_unpad_data
(attention_mask)
neuron_detection/transformers/models/gemma2/diff_gemma2.py:52
↓ 1 callersFunction_get_unpad_data
(attention_mask)
layers/transformers/models/modeling_qwen2.py:68
↓ 1 callersFunction_get_unpad_data
(attention_mask)
layers/transformers/models/modeling_llama.py:62
↓ 1 callersMethod_greedy_search
( self, input_ids: None, max_length: Optional[int] = None, pad_token_id: Optio
neuron_detection/transformers/generation/flax_utils.py:565
↓ 1 callersMethod_greedy_search
( self, input_ids: None, max_length: Optional[int] = None, pad_token_id: Optio
neuron_deactivate/transformers/generation/flax_utils.py:565
← previousnext →201–300 of 1,603, ranked by callers