Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cedrickchee/transformers-llama
/ functions
Functions
36,568 in github.com/cedrickchee/transformers-llama
⨍
Functions
36,568
◇
Types & classes
9,398
↳
Endpoints
539
↓ 3,192 callers
Function
model
r""" # Using torch.hub ! import torch model = torch.hub.load('huggingface/transformers', 'model', 'bert-base-unca
hubconf.py:72
↓ 3,068 callers
Method
from_pretrained
r""" Instantiate a [`ModelCard`] from a pre-trained model model card. Parameters: pretrained_model_name_or_path: either:
src/transformers/modelcard.py:124
↓ 2,962 callers
Method
to
(self, *args, **kwargs)
src/transformers/modeling_utils.py:1803
↓ 2,644 callers
Method
size
Number of byte required for this data type Returns: Integer > 0
src/transformers/onnx/utils.py:28
↓ 1,800 callers
Function
requires_backends
(obj, backends)
src/transformers/utils/import_utils.py:1035
↓ 1,773 callers
Method
info
(self, msg)
tests/trainer/test_trainer_utils.py:481
↓ 1,519 callers
Method
eval
(**kwargs)
tests/models/auto/test_modeling_flax_auto.py:63
↓ 1,505 callers
Method
split
Will look for the words added to the trie within `text`. Output is the original string splitted along the boundaries of the words fou
src/transformers/tokenization_utils.py:90
↓ 1,377 callers
Function
ids_tensor
Creates a random int32 tensor of the shape within the vocab size.
tests/generation/test_flax_utils.py:41
↓ 1,351 callers
Method
pop
(self, *args, **kwargs)
src/transformers/utils/generic.py:277
↓ 1,286 callers
Function
is_torch_available
()
src/transformers/utils/import_utils.py:286
↓ 1,280 callers
Method
replace
(original_file: str, line_to_copy_below: str, lines_to_copy: List[str])
src/transformers/commands/add_new_model.py:204
↓ 1,146 callers
Function
shape_list
(*args, **kwargs)
src/transformers/utils/dummy_tf_objects.py:201
↓ 1,071 callers
Method
cat
Concatenates transformations along a new dimension. Args: ts: A list of T objects dim:
src/transformers/models/esm/openfold_utils/rigid_utils.py:1104
↓ 970 callers
Method
get
(self, key, default)
src/transformers/models/auto/auto_factory.py:626
↓ 927 callers
Method
keys
(self)
src/transformers/feature_extraction_utils.py:102
↓ 853 callers
Method
unsqueeze
Analogous to torch.unsqueeze. The dimension is relative to the shared dimensions of the rotation/translation. Args: dim:
src/transformers/models/esm/openfold_utils/rigid_utils.py:1087
↓ 844 callers
Method
encode
Transforms the `input_audio` to a discrete representation made out of `music_tokens`. Args: input_audio (`torch.Tensor`)
src/transformers/models/jukebox/modeling_jukebox.py:710
↓ 811 callers
Method
convert_to_tensor
(self, symbols)
src/transformers/models/transfo_xl/tokenization_transfo_xl.py:477
↓ 804 callers
Method
items
(self)
src/transformers/feature_extraction_utils.py:110
↓ 780 callers
Function
tokenizer
r""" # Using torch.hub ! import torch tokenizer = torch.hub.load('huggingface/transformers', 'tokenizer', 'bert-base-uncased'
hubconf.py:58
↓ 748 callers
Method
save_pretrained
Save a model card object to the directory or file `save_directory_or_file`.
src/transformers/modelcard.py:112
↓ 747 callers
Method
items
(self)
src/transformers/models/auto/auto_factory.py:643
↓ 743 callers
Method
to
(self, device)
src/transformers/models/detr/modeling_detr.py:2315
↓ 706 callers
Method
post_init
r""" Safety checker that arguments are correct - also replaces some NoneType arguments with their default values.
src/transformers/utils/quantization_config.py:68
↓ 545 callers
Method
write
(self, msg)
scripts/benchmark/trainer-benchmark.py:139
↓ 512 callers
Method
generate
r""" Generates sequences of token ids for models with a language modeling head. <Tip warning={true}> Most generation-contro
src/transformers/generation/utils.py:1111
↓ 512 callers
Function
get_initializer
Creates a `tf.initializers.TruncatedNormal` with the given range. Args: initializer_range (*float*, defaults to 0.02): Standard devi
src/transformers/modeling_tf_utils.py:3274
↓ 508 callers
Method
normal_
(self, data)
src/transformers/models/graphormer/modeling_graphormer.py:705
↓ 487 callers
Function
is_tf_available
()
src/transformers/utils/import_utils.py:414
↓ 478 callers
Method
from_pretrained
(cls, pretrained_model_name_or_path: str, **kwargs)
examples/research_projects/lxmert/utils.py:177
↓ 463 callers
Method
decode
This method forwards all its arguments to BertTokenizerFast's [`~PreTrainedTokenizer.decode`]. Please refer to the docstring of this
src/transformers/models/git/processing_git.py:104
↓ 448 callers
Method
load
Loads the dictionary from a text file with the format: ``` <symbol0> <count0> <symbol1> <count1> ... ```
src/transformers/models/biogpt/convert_biogpt_original_pytorch_checkpoint_to_pytorch.py:78
↓ 428 callers
Method
update
(self, *args, **kwargs)
src/transformers/utils/generic.py:280
↓ 373 callers
Method
mean
(self)
src/transformers/models/esm/modeling_esmfold.py:1270
↓ 364 callers
Method
expand_dims
Expands 2-dimensional `image` to 3 dimensions. Args: image (`PIL.Image.Image` or `np.ndarray` or `torch.Tensor`):
src/transformers/image_utils.py:382
↓ 361 callers
Function
is_vision_available
()
src/transformers/utils/import_utils.py:592
↓ 341 callers
Method
keys
(self)
src/transformers/models/auto/auto_factory.py:618
↓ 340 callers
Method
batch_decode
This method forwards all its arguments to BertTokenizerFast's [`~PreTrainedTokenizer.batch_decode`]. Please refer to the docstring of
src/transformers/models/git/processing_git.py:97
↓ 337 callers
Method
encode_plus
( self, table: "pd.DataFrame", query: Optional[TextInput] = None, answer: Opti
src/transformers/models/tapex/tokenization_tapex.py:899
↓ 333 callers
Function
prune_linear_layer
Prune a linear layer to keep only entries in index. Used to remove heads. Args: layer (`torch.nn.Linear`): The layer to prune.
src/transformers/pytorch_utils.py:60
↓ 314 callers
Method
classifier
(self, x: tf.Tensor)
src/transformers/models/resnet/modeling_tf_resnet.py:452
↓ 307 callers
Method
detach
Returns a copy of the Rotation whose underlying Tensor has been detached from its torch graph. Returns: A copy of the Ro
src/transformers/models/esm/openfold_utils/rigid_utils.py:710
↓ 283 callers
Method
encoder
(self)
src/transformers/models/whisper/modeling_tf_whisper.py:1123
↓ 274 callers
Method
batch_encode_plus
<Tip warning={true}> This method is deprecated, `__call__` should be used instead. </Tip>
src/transformers/models/tapex/tokenization_tapex.py:680
↓ 262 callers
Method
open
(*args, **kwargs)
tests/pipelines/test_pipelines_image_to_text.py:30
↓ 250 callers
Method
convert_tokens_to_ids
Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the vocabulary. Args:
src/transformers/tokenization_utils.py:560
↓ 250 callers
Method
run_common_tests
(self)
tests/test_configuration_common.py:209
↓ 246 callers
Method
float
(self, *args)
src/transformers/modeling_utils.py:1823
↓ 246 callers
Function
floats_tensor
Creates a random float32 tensor
tests/test_modeling_common.py:2691
↓ 244 callers
Method
to_tuple
Convert self to a tuple containing all the attributes/keys that are not `None`.
src/transformers/utils/generic.py:302
↓ 230 callers
Method
pad
Pad a single encoded input or a batch of encoded inputs up to predefined length or to the max sequence length in the batch. Padding s
src/transformers/models/luke/tokenization_luke.py:1389
↓ 223 callers
Method
train
Main training entry point. Args: resume_from_checkpoint (`str` or `bool`, *optional*): If a `str`, local
src/transformers/trainer.py:1549
↓ 218 callers
Method
tokenize
Tokenize the provided input and eventually returns corresponding tokens id: - **text_input**: String to tokenize - **return_ids**: Bo
src/transformers/commands/serving.py:179
↓ 207 callers
Function
pipeline
Utility factory method to build a [`Pipeline`]. Pipelines are made of: - A [tokenizer](tokenizer) in charge of mapping raw textual
src/transformers/pipelines/__init__.py:492
↓ 206 callers
Function
is_tokenizers_available
()
src/transformers/utils/import_utils.py:588
↓ 197 callers
Function
nested_simplify
Simplifies an object by rounding float numbers, and downcasting tensors/numpy arrays to get simple equality test within tests.
src/transformers/testing_utils.py:1609
↓ 195 callers
Method
get_vocab
(self)
src/transformers/models/t5/tokenization_t5.py:182
↓ 194 callers
Function
is_flax_available
()
src/transformers/utils/import_utils.py:430
↓ 194 callers
Method
output
(result: Union[str, int])
src/transformers/models/whisper/english_normalizer.py:222
↓ 193 callers
Method
log
Log `logs` on the various objects watching training. Subclass and override this method to inject custom behavior. Args:
src/transformers/trainer.py:2535
↓ 184 callers
Method
attention
(self, hidden_state: torch.Tensor, attention_mask: torch.Tensor)
src/transformers/models/bridgetower/modeling_bridgetower.py:182
↓ 179 callers
Function
get_size_dict
Converts the old size parameter in the config into the new dict expected in the config. This is to ensure backwards compatibility with the ol
src/transformers/image_processing_utils.py:502
↓ 175 callers
Function
flatten_dict
Flatten a nested dict into a single level dict.
src/transformers/utils/generic.py:408
↓ 175 callers
Method
save_pretrained
(self, save_directory)
src/transformers/models/rag/retrieval_rag.py:437
↓ 174 callers
Method
decoder
(self)
src/transformers/models/whisper/modeling_tf_whisper.py:1120
↓ 171 callers
Function
create_custom_forward
(module)
templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py:547
↓ 166 callers
Function
random_attention_mask
(shape, rng=None)
tests/generation/test_flax_utils.py:59
↓ 162 callers
Function
get_values
(model_mapping)
src/transformers/models/auto/auto_factory.py:545
↓ 154 callers
Method
apply
Applies the transformation to a coordinate tensor. Args: pts: A [*, 3] coordinate tensor. Returns: T
src/transformers/models/esm/openfold_utils/rigid_utils.py:938
↓ 154 callers
Method
copy
Creates a new instance of this constraint. Args: stateful(`bool`): Whether to not only copy the constraint for new insta
src/transformers/generation/beam_constraints.py:114
↓ 151 callers
Method
convert_ids_to_tokens
(self, ids: int, skip_special_tokens: bool = False)
src/transformers/tokenization_utils.py:876
↓ 151 callers
Method
values
(self)
src/transformers/feature_extraction_utils.py:106
↓ 150 callers
Method
compile
This is a thin wrapper that sets the model's loss output head as the loss if the user does not specify a loss function themselves.
src/transformers/modeling_tf_utils.py:1396
↓ 150 callers
Method
save
Save the provided data object with the representation for the current [`~pipelines.PipelineDataFormat`]. Args: data (`di
src/transformers/pipelines/base.py:471
↓ 145 callers
Method
read
(self, n=-1)
src/transformers/commands/lfs.py:142
↓ 134 callers
Method
backward
(self, grad_output)
src/transformers/models/sew_d/modeling_sew_d.py:548
↓ 126 callers
Function
get_tf_activation
(activation_string)
src/transformers/activations_tf.py:130
↓ 119 callers
Method
time
(self)
utils/notification_service.py:146
↓ 119 callers
Method
to_dict
Serializes this instance to a Python dictionary.
src/transformers/modelcard.py:238
↓ 118 callers
Method
detach
Need to document this
examples/research_projects/bertabs/modeling_bertabs.py:573
↓ 118 callers
Function
is_sentencepiece_available
()
src/transformers/utils/import_utils.py:566
↓ 118 callers
Method
prepare_config_and_inputs_for_common
(self)
tests/models/t5/test_modeling_t5.py:500
↓ 115 callers
Method
model
(self)
src/transformers/data/test_generation_utils.py:38
↓ 114 callers
Method
get_input_embeddings
(self)
src/transformers/models/t5/modeling_t5.py:925
↓ 114 callers
Method
get_output_embeddings
Returns the model's output embeddings. Returns: `nn.Module`: A torch module mapping hidden states to vocabulary.
src/transformers/modeling_utils.py:1193
↓ 114 callers
Function
get_regression_trainer
(a=0, b=0, double_output=False, train_len=64, eval_len=64, pretrained=True, **kwargs)
tests/trainer/test_trainer.py:312
↓ 113 callers
Method
copy
(self)
src/transformers/models/oneformer/convert_to_hf_oneformer.py:87
↓ 110 callers
Function
set_seed
Helper function for reproducible behavior to set the seed in `random`, `numpy`, `torch` and/or `tf` (if installed). Args: seed (`int
src/transformers/trainer_utils.py:83
↓ 109 callers
Function
prepare_image_inputs
This function prepares a list of PIL images, or a list of numpy arrays if one specifies numpify=True, or a list of PyTorch tensors if one specifie
tests/test_image_processing_common.py:57
↓ 108 callers
Method
to_json_string
Serializes this instance to a JSON string.
src/transformers/modelcard.py:243
↓ 98 callers
Function
filter
Filter dataset with heuristics. Config, test and has_no_keywords files are removed with a given probability.
examples/research_projects/codeparrot/scripts/preprocessing.py:129
↓ 98 callers
Method
push_to_hub
Upload *self.model* and *self.tokenizer* to the 🤗 model hub on the repo *self.args.hub_model_id*. Parameters: commit_mes
src/transformers/trainer.py:3551
↓ 95 callers
Method
from_dict
Constructs a `ModelCard` from a Python dictionary of parameters.
src/transformers/modelcard.py:220
↓ 94 callers
Method
tokenize
Basic Tokenization of a piece of text. Split on "white spaces" only, for sub-word tokenization, see WordPieceTokenizer. Args
src/transformers/models/clip/tokenization_clip.py:139
↓ 93 callers
Method
as_tensor
(value)
src/transformers/feature_extraction_utils.py:144
↓ 93 callers
Method
get_auto_remove_tmp_dir
Args: tmp_dir (`string`, *optional*): if `None`: - a unique temporary path will be created
src/transformers/testing_utils.py:1193
↓ 92 callers
Method
hf_compute_loss
(self, labels: tf.Tensor, logits: tf.Tensor)
src/transformers/models/bert/modeling_tf_bert.py:122
↓ 91 callers
Method
embed_tokens
Embeds the upper level music tokens and upsamples them to provide as audio conditioning.
src/transformers/models/jukebox/modeling_jukebox.py:2007
↓ 90 callers
Method
init
( self, batch_size: int, max_length: int, num_beams: int, device: torc
examples/research_projects/onnx/summarization/bart_onnx/generation_onnx.py:361
next →
1–100 of 36,568, ranked by callers