MCPcopy Create free account

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

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

↓ 1 callersMethod_hp_search_setup
HP search setup code
neuron_enhancement/transformers/trainer.py:1215
↓ 1 callersMethod_init_rope
(self)
neuron_detection/transformers/models/llama/modeling_llama.py:300
↓ 1 callersMethod_init_rope
(self)
layers/transformers/models/modeling_llama.py:294
↓ 1 callersMethod_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
neuron_detection/transformers/generation/streamers.py:134
↓ 1 callersMethod_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
neuron_deactivate/transformers/generation/streamers.py:134
↓ 1 callersMethod_load_best_model
(self)
neuron_enhancement/transformers/trainer.py:2354
↓ 1 callersMethod_load_optimizer_and_scheduler
If optimizer and scheduler states exist, load them.
neuron_enhancement/transformers/trainer.py:2727
↓ 1 callersFunction_make_causal_mask
Make causal mask used for bi-directional self-attention, supporting both static and dynamic shapes.
neuron_detection/transformers/models/mistral/modeling_tf_mistral.py:57
↓ 1 callersFunction_make_causal_mask
Make causal mask used for self-attention.
layers/transformers/models/modeling_bloom.py:57
↓ 1 callersFunction_make_causal_mask
Make causal mask used for bi-directional self-attention, supporting both static and dynamic shapes.
neuron_deactivate/transformers/models/mistral/modeling_tf_mistral.py:57
↓ 1 callersMethod_merge_criteria_processor_list
( self, default_list: FlaxLogitsProcessorList, custom_list: FlaxLogitsProcessorList,
neuron_detection/transformers/generation/flax_utils.py:544
↓ 1 callersMethod_merge_criteria_processor_list
( self, default_list: TFLogitsProcessorList, custom_list: TFLogitsProcessorList, )
neuron_detection/transformers/generation/tf_utils.py:1505
↓ 1 callersMethod_merge_criteria_processor_list
( self, default_list: FlaxLogitsProcessorList, custom_list: FlaxLogitsProcessorList,
neuron_deactivate/transformers/generation/flax_utils.py:544
↓ 1 callersMethod_merge_criteria_processor_list
( self, default_list: TFLogitsProcessorList, custom_list: TFLogitsProcessorList, )
neuron_deactivate/transformers/generation/tf_utils.py:1505
↓ 1 callersMethod_merge_heads
(self, hidden_states)
neuron_detection/transformers/models/llama/modeling_flax_llama.py:229
↓ 1 callersMethod_merge_heads
(self, hidden_states)
neuron_detection/transformers/models/mistral/modeling_flax_mistral.py:249
↓ 1 callersMethod_merge_heads
Merge heads together over the last dimension Args: x (`torch.tensor`, *required*): [batch_size * num_heads, seq_length,
layers/transformers/models/modeling_bloom.py:255
↓ 1 callersMethod_merge_heads
(self, hidden_states)
neuron_deactivate/transformers/models/llama/modeling_flax_llama.py:229
↓ 1 callersMethod_merge_heads
(self, hidden_states)
neuron_deactivate/transformers/models/mistral/modeling_flax_mistral.py:249
↓ 1 callersMethod_nested_gather
Gather value of `tensors` (tensor or list/tuple of nested tensors) and convert them to numpy before concatenating them to `gathered`
neuron_enhancement/transformers/trainer.py:3623
↓ 1 callersMethod_norm
(self, x)
neuron_detection/transformers/models/gemma2/modeling_gemma2.py:80
↓ 1 callersMethod_norm
(self, x)
neuron_deactivate/transformers/models/gemma2/modeling_gemma2.py:117
↓ 1 callersFunction_prepare_4d_causal_attention_mask_with_cache_position
Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape `(batch_size, key_value_length)`,
neuron_deactivate/transformers/models/llama/modeling_llama.py:59
↓ 1 callersFunction_prepare_attention_mask
Expands or crops the model's mask for decoding purposes, to the defined length
neuron_detection/transformers/generation/candidate_generator.py:404
↓ 1 callersFunction_prepare_attention_mask
Expands or crops the model's mask for decoding purposes, to the defined length
neuron_deactivate/transformers/generation/candidate_generator.py:408
↓ 1 callersMethod_prepare_attention_mask_for_generation
( self, inputs: torch.Tensor, pad_token_id: Optional[int], eos_token_id: Optio
neuron_detection/transformers/generation/utils.py:596
↓ 1 callersMethod_prepare_attention_mask_for_generation
( self, inputs: tf.Tensor, pad_token_id: Optional[int], eos_token_id: Optional
neuron_detection/transformers/generation/tf_utils.py:1030
↓ 1 callersMethod_prepare_attention_mask_for_generation
( self, inputs: torch.Tensor, pad_token_id: Optional[int], eos_token_id: Optio
layers/transformers/generation/utils.py:596
↓ 1 callersMethod_prepare_attention_mask_for_generation
( self, inputs: torch.Tensor, pad_token_id: Optional[int], eos_token_id: Optio
neuron_deactivate/transformers/generation/utils.py:613
↓ 1 callersMethod_prepare_attention_mask_for_generation
( self, inputs: tf.Tensor, pad_token_id: Optional[int], eos_token_id: Optional
neuron_deactivate/transformers/generation/tf_utils.py:1030
↓ 1 callersMethod_prepare_attn_mask
( self, attention_mask: torch.Tensor, input_shape: Tuple[int, int], past_key_values_length: int )
layers/transformers/models/modeling_bloom.py:646
↓ 1 callersMethod_prepare_bias_variables
(self, scores: torch.FloatTensor)
neuron_detection/transformers/generation/logits_process.py:1149
↓ 1 callersMethod_prepare_bias_variables
(self, scores: torch.FloatTensor)
neuron_deactivate/transformers/generation/logits_process.py:1149
↓ 1 callersMethod_prepare_decoder_attention_mask
(self, attention_mask, input_shape, inputs_embeds, past_key_values_length)
neuron_detection/transformers/models/mistral/modeling_tf_mistral.py:508
↓ 1 callersMethod_prepare_decoder_attention_mask
(self, attention_mask, input_shape, inputs_embeds, past_key_values_length)
neuron_deactivate/transformers/models/mistral/modeling_tf_mistral.py:508
↓ 1 callersMethod_prepare_decoder_input_ids_for_generation
( self, batch_size: int, decoder_start_token_id: int = None, bos_token_id: int
neuron_detection/transformers/generation/utils.py:642
↓ 1 callersMethod_prepare_decoder_input_ids_for_generation
( self, batch_size: int, decoder_start_token_id: int = None, bos_token_id: int
neuron_detection/transformers/generation/flax_utils.py:171
↓ 1 callersMethod_prepare_decoder_input_ids_for_generation
Prepares `decoder_input_ids` for generation with encoder-decoder models
neuron_detection/transformers/generation/tf_utils.py:1076
↓ 1 callersMethod_prepare_decoder_input_ids_for_generation
( self, batch_size: int, decoder_start_token_id: int = None, bos_token_id: int
layers/transformers/generation/utils.py:642
↓ 1 callersMethod_prepare_decoder_input_ids_for_generation
Prepares `decoder_input_ids` for generation with encoder-decoder models
neuron_deactivate/transformers/generation/utils.py:666
↓ 1 callersMethod_prepare_decoder_input_ids_for_generation
( self, batch_size: int, decoder_start_token_id: int = None, bos_token_id: int
neuron_deactivate/transformers/generation/flax_utils.py:171
↓ 1 callersMethod_prepare_decoder_input_ids_for_generation
Prepares `decoder_input_ids` for generation with encoder-decoder models
neuron_deactivate/transformers/generation/tf_utils.py:1076
↓ 1 callersMethod_prepare_encoder_decoder_kwargs_for_generation
(self, input_ids, params, model_kwargs)
neuron_detection/transformers/generation/flax_utils.py:162
↓ 1 callersMethod_prepare_encoder_decoder_kwargs_for_generation
( self, inputs_tensor: tf.Tensor, model_kwargs, model_input_name: Optional[str] = None )
neuron_detection/transformers/generation/tf_utils.py:1046
↓ 1 callersMethod_prepare_encoder_decoder_kwargs_for_generation
( self, inputs_tensor: torch.Tensor, model_kwargs, model_input_name: Optional[str] = None )
layers/transformers/generation/utils.py:614
↓ 1 callersMethod_prepare_encoder_decoder_kwargs_for_generation
(self, input_ids, params, model_kwargs)
neuron_deactivate/transformers/generation/flax_utils.py:162
↓ 1 callersMethod_prepare_encoder_decoder_kwargs_for_generation
( self, inputs_tensor: tf.Tensor, model_kwargs, model_input_name: Optional[str] = None )
neuron_deactivate/transformers/generation/tf_utils.py:1046
↓ 1 callersMethod_prepare_model_inputs
This function extracts the model-specific `inputs` for generation.
neuron_detection/transformers/generation/tf_utils.py:1172
↓ 1 callersMethod_prepare_model_inputs
This function extracts the model-specific `inputs` for generation.
layers/transformers/generation/utils.py:498
↓ 1 callersMethod_prepare_model_inputs
This function extracts the model-specific `inputs` for generation.
neuron_deactivate/transformers/generation/tf_utils.py:1172
↓ 1 callersFunction_prepare_token_type_ids
Expands or crops the model's token_type_ids for decoding purposes, to the defined length
neuron_detection/transformers/generation/candidate_generator.py:421
↓ 1 callersFunction_prepare_token_type_ids
Expands or crops the model's token_type_ids for decoding purposes, to the defined length
neuron_deactivate/transformers/generation/candidate_generator.py:425
↓ 1 callersMethod_push_from_checkpoint
(self, checkpoint_folder)
neuron_enhancement/transformers/trainer.py:3856
↓ 1 callersFunction_ranking_fast
Reranks the top_k candidates based on a degeneration penalty (cosine similarity with previous tokens), as described in the paper "A Contrasti
neuron_detection/transformers/generation/utils.py:4057
↓ 1 callersFunction_ranking_fast
Reranks the top_k candidates based on a degeneration penalty (cosine similarity with previous tokens), as described in the paper "A Contrasti
neuron_detection/transformers/generation/tf_utils.py:3111
↓ 1 callersFunction_ranking_fast
Reranks the top_k candidates based on a degeneration penalty (cosine similarity with previous tokens), as described in the paper "A Contrasti
layers/transformers/generation/utils.py:4051
↓ 1 callersFunction_ranking_fast
Reranks the top_k candidates based on a degeneration penalty (cosine similarity with previous tokens), as described in the paper "A Contrasti
neuron_deactivate/transformers/generation/utils.py:4806
↓ 1 callersFunction_ranking_fast
Reranks the top_k candidates based on a degeneration penalty (cosine similarity with previous tokens), as described in the paper "A Contrasti
neuron_deactivate/transformers/generation/tf_utils.py:3111
↓ 1 callersMethod_report_to_hp_search
(self, trial: Union["optuna.Trial", Dict[str, Any]], step: int, metrics: Dict[str, float])
neuron_enhancement/transformers/trainer.py:1264
↓ 1 callersMethod_rope_scaling_validation
Validate the `rope_scaling` configuration.
neuron_detection/transformers/models/llama/configuration_llama.py:174
↓ 1 callersMethod_rotate_checkpoints
(self, use_mtime=False, output_dir=None)
neuron_enhancement/transformers/trainer.py:3221
↓ 1 callersMethod_sample
( self, input_ids: None, max_length: Optional[int] = None, pad_token_id: Optio
neuron_detection/transformers/generation/flax_utils.py:651
↓ 1 callersMethod_sample
( self, input_ids: None, max_length: Optional[int] = None, pad_token_id: Optio
neuron_deactivate/transformers/generation/flax_utils.py:651
↓ 1 callersMethod_save_checkpoint
(self, model, trial, metrics=None)
neuron_enhancement/transformers/trainer.py:2562
↓ 1 callersMethod_save_optimizer_and_scheduler
(self, output_dir)
neuron_enhancement/transformers/trainer.py:2675
↓ 1 callersMethod_save_rng_state
(self, output_dir)
neuron_enhancement/transformers/trainer.py:2643
↓ 1 callersMethod_save_tpu
(self, output_dir: Optional[str] = None)
neuron_enhancement/transformers/trainer.py:3106
↓ 1 callersMethod_score_ngrams_in_passage
(self, input_ids: torch.LongTensor)
neuron_detection/transformers/generation/watermarking.py:149
↓ 1 callersMethod_score_ngrams_in_passage
(self, input_ids: torch.LongTensor)
neuron_deactivate/transformers/generation/watermarking.py:149
↓ 1 callersMethod_score_rejection_sampling
Generate greenlist based on current candidate next token. Reject and move on if necessary. Runs for a fixed number of steps only for
neuron_detection/transformers/generation/logits_process.py:2443
↓ 1 callersMethod_score_rejection_sampling
Generate greenlist based on current candidate next token. Reject and move on if necessary. Runs for a fixed number of steps only for
neuron_deactivate/transformers/generation/logits_process.py:2443
↓ 1 callersMethod_split_heads
Split the last dimension into (num_heads, head_dim) without making any copies, results share same memory storage as `fused_qkv`
layers/transformers/models/modeling_bloom.py:239
↓ 1 callersMethod_stop_string_create_embedding_vec
This function precomputes everything needed for the run-time checks in StopStringCriteria, and packs them into an embedding tensor that can be
neuron_detection/transformers/generation/stopping_criteria.py:368
↓ 1 callersMethod_stop_string_create_embedding_vec
This function precomputes everything needed for the run-time checks in StopStringCriteria, and packs them into an embedding tensor that can be
neuron_deactivate/transformers/generation/stopping_criteria.py:370
↓ 1 callersMethod_stop_string_get_matching_positions
This function preprocesses stop strings and the tokenizer vocabulary to determine where tokens can validly appear in the stop strings. For eac
neuron_detection/transformers/generation/stopping_criteria.py:327
↓ 1 callersMethod_stop_string_get_matching_positions
This function preprocesses stop strings and the tokenizer vocabulary to determine where tokens can validly appear in the stop strings. For eac
neuron_deactivate/transformers/generation/stopping_criteria.py:329
↓ 1 callersMethod_tune_save_checkpoint
(self, checkpoint_dir: str)
neuron_enhancement/transformers/trainer.py:1288
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
neuron_detection/transformers/models/llama/modeling_llama.py:619
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
neuron_detection/transformers/models/gemma2/modeling_gemma2.py:532
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
neuron_detection/transformers/models/gemma2/diff_gemma2.py:270
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
layers/transformers/models/modeling_qwen2.py:585
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
layers/transformers/models/modeling_llama.py:564
↓ 1 callersMethod_update_causal_mask
(self, attention_mask, input_tensor)
neuron_detection/transformers/models/llama/modeling_llama.py:1139
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
neuron_detection/transformers/models/mistral/modeling_mistral.py:928
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
neuron_detection/transformers/models/gemma2/modeling_gemma2.py:1030
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
neuron_detection/transformers/models/gemma2/diff_gemma2.py:563
↓ 1 callersMethod_update_causal_mask
(self, attention_mask, input_tensor)
layers/transformers/models/modeling_llama.py:1057
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
neuron_deactivate/transformers/models/llama/modeling_llama.py:1134
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
neuron_deactivate/transformers/models/mistral/modeling_mistral.py:931
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
neuron_deactivate/transformers/models/gemma2/modeling_gemma2.py:966
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
neuron_deactivate/transformers/models/gemma2/diff_gemma2.py:434
↓ 1 callersMethod_validate_arguments
(self)
neuron_detection/transformers/generation/logits_process.py:1173
↓ 1 callersMethod_validate_arguments
(self)
neuron_detection/transformers/generation/logits_process.py:1268
↓ 1 callersMethod_validate_arguments
(self)
neuron_deactivate/transformers/generation/logits_process.py:1173
↓ 1 callersMethod_validate_arguments
(self)
neuron_deactivate/transformers/generation/logits_process.py:1268
↓ 1 callersMethod_validate_generated_length
Performs validation related to the resulting generated length
neuron_deactivate/transformers/generation/utils.py:1255
↓ 1 callersMethod_validate_model_class
Confirms that the model class is compatible with generation. If not, raises an exception that points to the right class to use.
neuron_detection/transformers/generation/utils.py:1065
↓ 1 callersMethod_validate_model_class
Confirms that the model class is compatible with generation. If not, raises an exception that points to the right class to use.
neuron_detection/transformers/generation/flax_utils.py:226
↓ 1 callersMethod_validate_model_class
Confirms that the model class is compatible with generation. If not, raises an exception that points to the right class to use.
neuron_detection/transformers/generation/tf_utils.py:597
↓ 1 callersMethod_validate_model_class
Confirms that the model class is compatible with generation. If not, raises an exception that points to the right class to use.
layers/transformers/generation/utils.py:1065
← previousnext →301–400 of 1,603, ranked by callers