MCPcopy Create free account

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

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

↓ 51 callersMethodupdate
Reads in a token and returns booleans that indicate the progress made by it. This function will update the state of this object unlik
neuron_detection/transformers/generation/beam_constraints.py:70
↓ 24 callersMethodupdate
Reads in a token and returns booleans that indicate the progress made by it. This function will update the state of this object unlik
neuron_deactivate/transformers/generation/beam_constraints.py:70
↓ 18 callersMethodsave_pretrained
r""" Save a generation configuration object to the directory `save_directory`, so that it can be re-loaded using the [`~GenerationConf
neuron_detection/transformers/generation/configuration_utils.py:703
↓ 16 callersMethodbuild
(self, input_shape=None)
neuron_detection/transformers/models/mistral/modeling_tf_mistral.py:203
↓ 16 callersMethodbuild
(self, input_shape=None)
neuron_deactivate/transformers/models/mistral/modeling_tf_mistral.py:203
↓ 15 callersMethodcopy
Creates a new instance of this constraint. Args: stateful(`bool`): Whether to not only copy the constraint for new insta
neuron_detection/transformers/generation/beam_constraints.py:114
↓ 12 callersMethod__init__
(self, config)
neuron_deactivate/transformers/models/llama/modeling_llama.py:282
↓ 12 callersMethodfinalize
( self, input_ids: torch.LongTensor, next_scores: torch.FloatTensor, next_toke
neuron_detection/transformers/generation/beam_search.py:111
↓ 12 callersFunctionvalidate_stopping_criteria
(stopping_criteria: StoppingCriteriaList, max_length: int)
neuron_detection/transformers/generation/stopping_criteria.py:521
↓ 11 callersMethodadd
Add a new hypothesis to the list.
neuron_detection/transformers/generation/beam_search.py:954
↓ 11 callersMethodcopy
Creates a new instance of this constraint. Args: stateful(`bool`): Whether to not only copy the constraint for new insta
neuron_deactivate/transformers/generation/beam_constraints.py:114
↓ 11 callersMethodprepare_inputs_for_generation
(self, *args, **kwargs)
neuron_deactivate/transformers/generation/utils.py:516
↓ 10 callersFunction_is_peft_model
(model)
neuron_enhancement/transformers/trainer.py:221
↓ 10 callersMethodput
Function that is called by `.generate()` to push new tokens
neuron_detection/transformers/generation/streamers.py:29
↓ 10 callersMethodsave_pretrained
r""" Save a generation configuration object to the directory `save_directory`, so that it can be re-loaded using the [`~GenerationConf
neuron_deactivate/transformers/generation/configuration_utils.py:741
↓ 9 callersMethod__init__
(self, config)
neuron_detection/transformers/models/llama/modeling_llama.py:214
↓ 9 callersMethod__init__
(self, config)
neuron_detection/transformers/models/mistral/modeling_mistral.py:147
↓ 9 callersMethod__init__
(self, config)
neuron_detection/transformers/models/gemma2/modeling_gemma2.py:154
↓ 9 callersMethod__init__
(self, config: BloomConfig)
layers/transformers/models/modeling_bloom.py:373
↓ 9 callersMethod__init__
(self, config)
layers/transformers/models/modeling_llama.py:213
↓ 9 callersMethod__init__
(self, config)
neuron_deactivate/transformers/models/mistral/modeling_mistral.py:149
↓ 9 callersMethod__init__
(self, config)
neuron_deactivate/transformers/models/gemma2/modeling_gemma2.py:194
↓ 9 callersMethod_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is_encoder_decoder
neuron_deactivate/transformers/generation/utils.py:769
↓ 9 callersMethodadd
Add a new hypothesis to the list.
neuron_deactivate/transformers/generation/beam_search.py:954
↓ 9 callersMethodprepare_inputs_for_generation
(self, *args, **kwargs)
neuron_detection/transformers/generation/utils.py:493
↓ 9 callersMethodto_dict
Serializes this instance to a Python dictionary. Returns: `Dict[str, Any]`: Dictionary of all the attributes that make u
neuron_detection/transformers/generation/configuration_utils.py:1041
↓ 8 callersMethod__init__
(self, config, **kwargs)
neuron_detection/transformers/models/mistral/modeling_tf_mistral.py:190
↓ 8 callersMethod__init__
(self, config)
layers/transformers/models/modeling_qwen2.py:174
↓ 8 callersMethod__init__
(self, config, **kwargs)
neuron_deactivate/transformers/models/mistral/modeling_tf_mistral.py:190
↓ 8 callersMethod_gather_and_numpify
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:4139
↓ 8 callersMethod_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is_encoder_decoder
neuron_detection/transformers/generation/utils.py:716
↓ 8 callersMethod_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is_encoder_decoder
layers/transformers/generation/utils.py:716
↓ 8 callersMethodfrom_pretrained
r""" Instantiate a [`GenerationConfig`] from a generation configuration file. Args: pretrained_model_name (`str` or `os.P
neuron_detection/transformers/generation/configuration_utils.py:781
↓ 8 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
neuron_enhancement/transformers/trainer.py:3043
↓ 8 callersMethodprepare_inputs_for_generation
(self, *args, **kwargs)
layers/transformers/generation/utils.py:493
↓ 8 callersMethodprocess
( self, input_ids: torch.LongTensor, next_scores: torch.FloatTensor, next_toke
neuron_detection/transformers/generation/beam_search.py:99
↓ 7 callersMethodfrom_dict
Instantiates a [`GenerationConfig`] from a Python dictionary of parameters. Args: config_dict (`Dict[str, Any]`):
neuron_detection/transformers/generation/configuration_utils.py:973
↓ 7 callersMethodfrom_dict
Instantiates a [`GenerationConfig`] from a Python dictionary of parameters. Args: config_dict (`Dict[str, Any]`):
neuron_deactivate/transformers/generation/configuration_utils.py:1011
↓ 7 callersMethodlog
Log `logs` on the various objects watching training. Subclass and override this method to inject custom behavior. Args:
neuron_enhancement/transformers/trainer.py:2889
↓ 7 callersMethodput
Function that is called by `.generate()` to push new tokens
neuron_deactivate/transformers/generation/streamers.py:29
↓ 7 callersMethodto_dict
Serializes this instance to a Python dictionary. Returns: `Dict[str, Any]`: Dictionary of all the attributes that make u
neuron_deactivate/transformers/generation/configuration_utils.py:1079
↓ 6 callersMethod_expand_inputs_for_generation
Expands tensors from [batch_size, ...] to [batch_size * expand_size, ...]
neuron_detection/transformers/generation/utils.py:675
↓ 6 callersMethod_expand_inputs_for_generation
Expands tensors from [batch_size, ...] to [batch_size * expand_size, ...]
layers/transformers/generation/utils.py:675
↓ 6 callersMethod_expand_inputs_for_generation
Expands tensors from [batch_size, ...] to [batch_size * expand_size, ...]
neuron_deactivate/transformers/generation/utils.py:728
↓ 6 callersMethod_gather_beams
Gathers the beam slices indexed by beam_indices into new beam array.
neuron_detection/transformers/generation/tf_utils.py:2079
↓ 6 callersMethod_gather_beams
Gathers the beam slices indexed by beam_indices into new beam array.
neuron_deactivate/transformers/generation/tf_utils.py:2079
↓ 6 callersMethodend
Function that is called by `.generate()` to signal the end of generation
neuron_detection/transformers/generation/streamers.py:33
↓ 6 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_mistral.py:170
↓ 6 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/gemma2/modeling_gemma2.py:177
↓ 6 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
layers/transformers/models/modeling_qwen2.py:189
↓ 6 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_mistral.py:168
↓ 6 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/gemma2/modeling_gemma2.py:214
↓ 6 callersFunctionretrive_neuron
(filename)
neuron_deactivate/test_mistral_gsm.py:142
↓ 6 callersFunctionvalidate_stopping_criteria
(stopping_criteria: StoppingCriteriaList, max_length: int)
neuron_deactivate/transformers/generation/stopping_criteria.py:524
↓ 5 callersMethod_save
(self, output_dir: Optional[str] = None, state_dict=None)
neuron_enhancement/transformers/trainer.py:3147
↓ 5 callersFunction_split_model_outputs
Given the (decoder/cross attentions)/(decoder hidden states) for multiple generated tokens, splits it into a tuple where each member correspo
neuron_deactivate/transformers/generation/utils.py:4745
↓ 5 callersMethod_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is_encoder_decoder: bool = False )
neuron_detection/transformers/generation/tf_utils.py:1277
↓ 5 callersMethod_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is_encoder_decoder: bool = False )
neuron_deactivate/transformers/generation/tf_utils.py:1277
↓ 5 callersMethod_update_model_kwargs_for_xla_generation
( self, model_outputs: ModelOutput, model_kwargs: Dict[str, Any], cur_len: int
neuron_detection/transformers/generation/tf_utils.py:1293
↓ 5 callersMethod_update_model_kwargs_for_xla_generation
( self, model_outputs: ModelOutput, model_kwargs: Dict[str, Any], cur_len: int
neuron_deactivate/transformers/generation/tf_utils.py:1293
↓ 5 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
neuron_detection/transformers/models/gemma2/modeling_gemma2.py:126
↓ 5 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
neuron_deactivate/transformers/models/gemma2/modeling_gemma2.py:166
↓ 5 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_detection/transformers/generation/beam_search.py:979
↓ 5 callersMethodnum_examples
Helper to get number of samples in a [`~torch.utils.data.DataLoader`] by accessing its dataset. When dataloader.dataset does not exis
neuron_enhancement/transformers/trainer.py:1185
↓ 5 callersMethodprepare_inputs_for_generation
(self, *args, **kwargs)
neuron_detection/transformers/generation/tf_utils.py:472
↓ 5 callersMethodprepare_inputs_for_generation
(self, *args, **kwargs)
neuron_deactivate/transformers/generation/tf_utils.py:472
↓ 5 callersMethodpush_to_hub
Upload `self.model` and `self.tokenizer` to the 🤗 model hub on the repo `self.args.hub_model_id`. Parameters: commit_mes
neuron_enhancement/transformers/trainer.py:3920
↓ 5 callersMethodreset
Resets the state of this constraint to its initialization. We would call this in cases where the fulfillment of a constraint is abrup
neuron_detection/transformers/generation/beam_constraints.py:95
↓ 5 callersMethodreset
Resets the state of this constraint to its initialization. We would call this in cases where the fulfillment of a constraint is abrup
neuron_deactivate/transformers/generation/beam_constraints.py:95
↓ 5 callersMethodto_json_string
Serializes this instance to a JSON string. Args: use_diff (`bool`, *optional*, defaults to `True`): If s
neuron_detection/transformers/generation/configuration_utils.py:1062
↓ 5 callersMethodto_json_string
Serializes this instance to a JSON string. Args: use_diff (`bool`, *optional*, defaults to `True`): If s
neuron_deactivate/transformers/generation/configuration_utils.py:1100
↓ 5 callersMethodvalidate
Validates the values of the attributes of the [`GenerationConfig`] instance. Raises exceptions in the presence of parameterization th
neuron_detection/transformers/generation/configuration_utils.py:500
↓ 4 callersMethod_convert_to_standard_cache
Standardizes the format of the cache so as to match most implementations, i.e. to tuple(tuple([batch_size, num_heads, ...]))
layers/transformers/models/modeling_bloom.py:505
↓ 4 callersMethod_expand_inputs_for_generation
Expands tensors from [batch_size, ...] to [batch_size * expand_size, ...] or [batch_size, expand_size, ...], depending on `expand_in_
neuron_detection/transformers/generation/tf_utils.py:1134
↓ 4 callersMethod_expand_inputs_for_generation
Expands tensors from [batch_size, ...] to [batch_size * expand_size, ...] or [batch_size, expand_size, ...], depending on `expand_in_
neuron_deactivate/transformers/generation/tf_utils.py:1134
↓ 4 callersFunction_get_fsdp_ckpt_kwargs
()
neuron_enhancement/transformers/trainer.py:233
↓ 4 callersMethod_issue_warnings_after_load
(self, load_result)
neuron_enhancement/transformers/trainer.py:2457
↓ 4 callersMethod_reorder_cache
(self, past_key_values, beam_idx)
neuron_detection/transformers/generation/utils.py:751
↓ 4 callersMethod_reorder_cache
(self, past_key_values, beam_idx)
layers/transformers/generation/utils.py:751
↓ 4 callersMethod_reorder_cache
(self, past_key_values, beam_idx)
neuron_deactivate/transformers/generation/utils.py:806
↓ 4 callersMethodadjust_logits_during_generation
Implement in subclasses of [`PreTrainedModel`] for custom behavior to adjust the logits in the generate method.
neuron_detection/transformers/generation/utils.py:562
↓ 4 callersMethodadjust_logits_during_generation
Implement in subclasses of [`PreTrainedModel`] for custom behavior to adjust the logits in the generate method.
layers/transformers/generation/utils.py:562
↓ 4 callersMethodadvance
When called, returns the token that would take this constraint one step closer to being fulfilled. Return: token_ids(`to
neuron_detection/transformers/generation/beam_constraints.py:49
↓ 4 callersMethodadvance
When called, returns the token that would take this constraint one step closer to being fulfilled. Return: token_ids(`to
neuron_deactivate/transformers/generation/beam_constraints.py:49
↓ 4 callersMethodend
Function that is called by `.generate()` to signal the end of generation
neuron_deactivate/transformers/generation/streamers.py:33
↓ 4 callersMethodfinalize
( self, input_ids: torch.LongTensor, next_scores: torch.FloatTensor, next_toke
neuron_deactivate/transformers/generation/beam_search.py:111
↓ 4 callersMethodfrom_model_config
Instantiates a [`GenerationConfig`] from a [`PretrainedConfig`]. This function is useful to convert legacy [`PretrainedConfig`] objec
neuron_detection/transformers/generation/configuration_utils.py:1121
↓ 4 callersMethodfrom_pretrained
r""" Instantiate a [`GenerationConfig`] from a generation configuration file. Args: pretrained_model_name (`str` or `os.P
neuron_deactivate/transformers/generation/configuration_utils.py:819
↓ 4 callersMethodget_input_embeddings
(self)
neuron_detection/transformers/models/llama/modeling_llama.py:996
↓ 4 callersFunctionintersection
(neuron_target, neuron_delete)
neuron_deactivate/test_mistral_gsm.py:71
↓ 4 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
neuron_enhancement/transformers/trainer.py:3036
↓ 4 callersFunctionpermute
(w, n_heads, dim1=dim, dim2=dim)
neuron_detection/transformers/models/llama/convert_llama_weights_to_hf.py:151
↓ 4 callersFunctionpermute
(w, n_heads, dim1=dim, dim2=dim)
neuron_deactivate/transformers/models/llama/convert_llama_weights_to_hf.py:149
↓ 4 callersMethodprocess
( self, input_ids: torch.LongTensor, next_scores: torch.FloatTensor, next_toke
neuron_deactivate/transformers/generation/beam_search.py:99
↓ 4 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/llama/modeling_llama.py:252
↓ 4 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
layers/transformers/models/modeling_llama.py:246
↓ 4 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/llama/modeling_llama.py:319
↓ 4 callersMethodtrain
Main training entry point. Args: resume_from_checkpoint (`str` or `bool`, *optional*): If a `str`, local
neuron_enhancement/transformers/trainer.py:1525
↓ 4 callersMethodvalidate
Validates the values of the attributes of the [`GenerationConfig`] instance. Raises exceptions in the presence of parameterization th
neuron_deactivate/transformers/generation/configuration_utils.py:527
↓ 3 callersMethod__init__
( self, query_pre_attn_scalar=224, sliding_window=4096, final_logit_softcappin
neuron_detection/transformers/models/gemma2/diff_gemma2.py:70
next →1–100 of 1,603, ranked by callers