id
int64
0
328k
repository_name
stringlengths
7
58
file_path
stringlengths
9
302
class_name
stringlengths
5
256
human_written_code
stringlengths
16
2.16M
class_skeleton
stringlengths
18
1.49M
total_program_units
int64
1
1.76k
total_doc_str
int64
0
771
AvgCountLine
float64
0
7.89k
AvgCountLineBlank
float64
0
297
AvgCountLineCode
float64
0
7.89k
AvgCountLineComment
float64
0
7.89k
AvgCyclomatic
float64
0
130
CommentToCodeRatio
float64
0
168
CountClassBase
float64
0
40
CountClassCoupled
float64
0
583
CountClassCoupledModified
float64
0
575
CountClassDerived
float64
0
5.35k
CountDeclInstanceMethod
float64
0
529
CountDeclInstanceVariable
float64
0
296
CountDeclMethod
float64
0
599
CountDeclMethodAll
float64
0
1.12k
CountLine
float64
1
40.4k
CountLineBlank
float64
0
8.16k
CountLineCode
float64
1
25.7k
CountLineCodeDecl
float64
1
8.15k
CountLineCodeExe
float64
0
24.2k
CountLineComment
float64
0
16.5k
CountStmt
float64
1
9.71k
CountStmtDecl
float64
1
8.15k
CountStmtExe
float64
0
9.69k
MaxCyclomatic
float64
0
759
MaxInheritanceTree
float64
0
16
MaxNesting
float64
0
34
SumCyclomatic
float64
0
2.9k
400
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/ggml.py
transformers.integrations.ggml.GGUFLlamaConverter
from .. import AddedToken from ..convert_slow_tokenizer import GemmaConverter, GPT2Converter, LlamaConverter, Qwen2Converter, T5Converter from tokenizers import Tokenizer, decoders, normalizers, pre_tokenizers, processors import numpy as np from tokenizers.models import BPE, Unigram class GGUFLlamaConverter(LlamaConve...
class GGUFLlamaConverter(LlamaConverter): def __init__(self, tokenizer_dict): pass def vocab(self, proto): pass def merges(self, proto): pass def tokenizer(self, proto): pass def decoder(self, replacement, add_prefix_space): pass def converted(self)...
7
0
19
4
14
1
4
0.08
1
4
1
0
6
4
6
23
119
26
86
28
79
7
69
28
62
12
3
2
24
401
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/ggml.py
transformers.integrations.ggml.GGUFPhi3Converter
from tokenizers import Tokenizer, decoders, normalizers, pre_tokenizers, processors from ..convert_slow_tokenizer import GemmaConverter, GPT2Converter, LlamaConverter, Qwen2Converter, T5Converter from tokenizers.models import BPE, Unigram from .. import AddedToken class GGUFPhi3Converter(LlamaConverter): def __in...
class GGUFPhi3Converter(LlamaConverter): def __init__(self, tokenizer_dict): pass def vocab(self, proto): pass def merges(self, proto): pass def tokenizer(self, proto): pass def decoder(self, replacement, add_prefix_space): pass def converted(self) ...
7
0
11
1
10
0
2
0.02
1
4
1
0
6
3
6
23
73
12
60
18
53
1
33
18
26
5
3
1
12
402
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/ggml.py
transformers.integrations.ggml.GGUFQwen2Converter
from tokenizers import Tokenizer, decoders, normalizers, pre_tokenizers, processors from ..convert_slow_tokenizer import GemmaConverter, GPT2Converter, LlamaConverter, Qwen2Converter, T5Converter from .. import AddedToken class GGUFQwen2Converter(Qwen2Converter): def __init__(self, tokenizer_dict): self.o...
class GGUFQwen2Converter(Qwen2Converter): def __init__(self, tokenizer_dict): pass def converted(self) -> Tokenizer: pass
3
0
8
1
8
0
1
0
1
3
1
0
2
2
2
5
18
2
16
8
13
0
10
8
7
1
2
0
2
403
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/ggml.py
transformers.integrations.ggml.GGUFT5Converter
from tokenizers.models import BPE, Unigram from ..convert_slow_tokenizer import GemmaConverter, GPT2Converter, LlamaConverter, Qwen2Converter, T5Converter from tokenizers import Tokenizer, decoders, normalizers, pre_tokenizers, processors class GGUFT5Converter(T5Converter): def __init__(self, tokenizer_dict): ...
class GGUFT5Converter(T5Converter): def __init__(self, tokenizer_dict): pass def vocab(self, proto): pass def normalizer(self, proto): pass def post_processor(self): pass def converted(self) -> Tokenizer: pass
6
0
11
1
10
1
2
0.06
1
4
1
0
5
4
5
18
61
10
49
18
43
3
37
18
31
5
3
2
11
404
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/ggml.py
transformers.integrations.ggml.GGUFTokenizerSkeleton
from ..utils.logging import tqdm class GGUFTokenizerSkeleton: def __init__(self, dict_): for k, v in dict_.items(): setattr(self, k, v) if not hasattr(self, 'merges'): if not hasattr(self, 'tokens') or not hasattr(self, 'scores'): raise ValueError('tokens an...
class GGUFTokenizerSkeleton: def __init__(self, dict_): pass
2
0
40
5
34
1
11
0.03
0
4
0
0
1
4
1
1
41
5
35
15
33
1
32
15
30
11
0
4
11
405
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/higgs.py
transformers.integrations.higgs.HiggsLinear
from typing import Optional class HiggsLinear(torch.nn.Module): def __init__(self, in_features: int, out_features: int, num_bits: int, bias=True, dtype: Optional[torch.dtype]=None, device: Optional[torch.device]=None, group_size: int=256, hadamard_size: int=1024): super().__init__() self.in_featur...
class HiggsLinear(torch.nn.Module): def __init__(self, in_features: int, out_features: int, num_bits: int, bias=True, dtype: Optional[torch.dtype]=None, device: Optional[torch.device]=None, group_size: int=256, hadamard_size: int=1024): pass def forward(self, x): pass
3
0
29
3
26
1
2
0.02
1
3
0
0
2
12
2
12
59
7
52
25
39
1
24
15
21
2
1
1
4
406
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.AzureMLCallback
from ..trainer_callback import ProgressCallback, TrainerCallback class AzureMLCallback(TrainerCallback): """ A [`TrainerCallback`] that sends the logs to [AzureML](https://pypi.org/project/azureml-sdk/). """ def __init__(self, azureml_run=None): if not is_azureml_available(): raise...
class AzureMLCallback(TrainerCallback): ''' A [`TrainerCallback`] that sends the logs to [AzureML](https://pypi.org/project/azureml-sdk/). ''' def __init__(self, azureml_run=None): pass def on_init_end(self, args, state, control, **kwargs): pass def on_log(self, args, state, ...
4
1
5
0
4
0
3
0.21
1
3
0
0
3
1
3
18
21
4
14
7
9
3
14
7
9
4
1
3
8
407
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.ClearMLCallback
import os from ..utils import ENV_VARS_TRUE_VALUES, is_torch_xla_available from ..trainer_callback import ProgressCallback, TrainerCallback from dataclasses import asdict, fields class ClearMLCallback(TrainerCallback): """ A [`TrainerCallback`] that sends the logs to [ClearML](https://clear.ml/). Environm...
class ClearMLCallback(TrainerCallback): ''' A [`TrainerCallback`] that sends the logs to [ClearML](https://clear.ml/). Environment: - **CLEARML_PROJECT** (`str`, *optional*, defaults to `HuggingFace Transformers`): ClearML project name. - **CLEARML_TASK** (`str`, *optional*, defaults to `Tr...
8
1
31
1
29
0
5
0.05
1
7
0
0
7
5
7
22
251
16
223
42
214
12
114
41
105
16
1
4
38
408
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.CodeCarbonCallback
from ..trainer_callback import ProgressCallback, TrainerCallback class CodeCarbonCallback(TrainerCallback): """ A [`TrainerCallback`] that tracks the CO2 emission of training. """ def __init__(self): if not is_codecarbon_available(): raise RuntimeError('CodeCarbonCallback requires ...
class CodeCarbonCallback(TrainerCallback): ''' A [`TrainerCallback`] that tracks the CO2 emission of training. ''' def __init__(self): pass def on_init_end(self, args, state, control, **kwargs): pass def on_train_begin(self, args, state, control, model=None, **kwargs): ...
5
1
6
1
5
1
2
0.23
1
1
0
0
4
2
4
19
32
6
22
8
16
5
17
8
11
3
1
1
9
409
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.CometCallback
import os from ..trainer_callback import ProgressCallback, TrainerCallback class CometCallback(TrainerCallback): """ A [`TrainerCallback`] that sends the logs to [Comet ML](https://www.comet.com/site/). """ def __init__(self): if _is_comet_installed is False or _is_comet_recent_enough is False...
class CometCallback(TrainerCallback): ''' A [`TrainerCallback`] that sends the logs to [Comet ML](https://www.comet.com/site/). ''' def __init__(self): pass def setup(self, args, state, model): ''' Setup the optional Comet integration. Environment: - **COME...
7
2
22
3
15
5
5
0.38
1
1
0
0
6
3
6
21
142
21
88
23
80
33
71
23
63
14
1
3
30
410
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.DVCLiveCallback
from typing import TYPE_CHECKING, Any, Literal, Optional, Union import os from ..utils import ENV_VARS_TRUE_VALUES, is_torch_xla_available from ..trainer_callback import ProgressCallback, TrainerCallback class DVCLiveCallback(TrainerCallback): """ A [`TrainerCallback`] that sends the logs to [DVCLive](https://...
class DVCLiveCallback(TrainerCallback): ''' A [`TrainerCallback`] that sends the logs to [DVCLive](https://www.dvc.org/doc/dvclive). Use the environment variables below in `setup` to configure the integration. To customize this callback beyond those environment variables, see [here](https://dvc.org/doc...
7
2
14
1
11
2
4
0.31
1
5
0
0
6
3
6
21
103
14
68
25
51
21
50
20
38
7
1
3
23
411
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.DagsHubCallback
from pathlib import Path import os from ..utils import ENV_VARS_TRUE_VALUES, is_torch_xla_available class DagsHubCallback(MLflowCallback): """ A [`TrainerCallback`] that logs to [DagsHub](https://dagshub.com/). Extends [`MLflowCallback`] """ def __init__(self): super().__init__() if no...
class DagsHubCallback(MLflowCallback): ''' A [`TrainerCallback`] that logs to [DagsHub](https://dagshub.com/). Extends [`MLflowCallback`] ''' def __init__(self): pass def setup(self, *args, **kwargs): ''' Setup the DagsHub's Logging integration. Environment: ...
4
2
13
2
9
2
2
0.32
1
5
0
0
3
6
3
25
47
10
28
11
23
9
21
11
16
3
2
2
7
412
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.FlyteCallback
from ..utils import PushToHubMixin, flatten_dict, is_datasets_available, is_pandas_available, is_torch_available, logging import os from ..trainer_callback import ProgressCallback, TrainerCallback class FlyteCallback(TrainerCallback): """A [`TrainerCallback`] that sends the logs to [Flyte](https://flyte.org/). ...
class FlyteCallback(TrainerCallback): '''A [`TrainerCallback`] that sends the logs to [Flyte](https://flyte.org/). NOTE: This callback only works within a Flyte task. Args: save_log_history (`bool`, *optional*, defaults to `True`): When set to True, the training logs are saved as a Flyt...
4
1
11
2
9
0
2
0.68
1
3
0
0
3
3
3
18
61
14
28
14
20
19
25
14
17
3
1
1
7
413
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.MLflowCallback
import json import packaging.version from ..utils import PushToHubMixin, flatten_dict, is_datasets_available, is_pandas_available, is_torch_available, logging import re from ..trainer_callback import ProgressCallback, TrainerCallback import os from ..utils import ENV_VARS_TRUE_VALUES, is_torch_xla_available class MLfl...
class MLflowCallback(TrainerCallback): ''' A [`TrainerCallback`] that sends the logs to [MLflow](https://www.mlflow.org/). Can be disabled by setting environment variable `DISABLE_MLFLOW_INTEGRATION = TRUE`. ''' def __init__(self): pass def setup(self, args, state, model): '''...
8
2
23
1
17
6
5
0.36
1
9
0
1
7
13
7
22
176
14
119
33
110
43
87
33
78
15
1
3
33
414
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.NeptuneCallback
from .. import __version__ as version from ..trainer_callback import ProgressCallback, TrainerCallback import os import tempfile from typing import TYPE_CHECKING, Any, Literal, Optional, Union import shutil import numpy as np class NeptuneCallback(TrainerCallback): """TrainerCallback that sends the logs to [Neptun...
class NeptuneCallback(TrainerCallback): '''TrainerCallback that sends the logs to [Neptune](https://app.neptune.ai). Args: api_token (`str`, *optional*): Neptune API token obtained upon registration. You can leave this argument out if you have saved your token to the `NEPTUNE_API_TOKEN` env...
25
1
10
1
9
0
3
0.13
1
10
1
0
20
14
21
36
271
49
196
77
151
26
163
61
132
6
1
4
56
415
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.NeptuneMissingConfiguration
class NeptuneMissingConfiguration(Exception): def __init__(self): super().__init__('\n ------ Unsupported ---- We were not able to create new runs. You provided a custom Neptune run to\n `NeptuneCallback` with the `run` argument. For the integration to work fully, provide your `api_token` and...
class NeptuneMissingConfiguration(Exception): def __init__(self): pass
2
0
8
0
8
0
1
0
1
1
0
0
1
0
1
11
9
0
9
2
7
0
3
2
1
1
3
0
1
416
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.TensorBoardCallback
import os from ..trainer_callback import ProgressCallback, TrainerCallback class TensorBoardCallback(TrainerCallback): """ A [`TrainerCallback`] that sends the logs to [TensorBoard](https://www.tensorflow.org/tensorboard). Args: tb_writer (`SummaryWriter`, *optional*): The writer to us...
class TensorBoardCallback(TrainerCallback): ''' A [`TrainerCallback`] that sends the logs to [TensorBoard](https://www.tensorflow.org/tensorboard). Args: tb_writer (`SummaryWriter`, *optional*): The writer to use. Will instantiate one if not set. ''' def __init__(self, tb_write...
6
1
15
2
13
0
5
0.11
1
7
0
0
5
2
5
20
86
14
66
16
58
7
55
16
47
8
1
3
24
417
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.WandbCallback
import importlib.util import importlib.metadata from ..trainer_callback import ProgressCallback, TrainerCallback from .. import PreTrainedModel, TrainingArguments import os from ..utils import ENV_VARS_TRUE_VALUES, is_torch_xla_available import tempfile from .. import modelcard import copy import numbers from pathlib i...
class WandbCallback(TrainerCallback): ''' A [`TrainerCallback`] that logs metrics, media, model checkpoints to [Weight and Biases](https://www.wandb.com/). ''' def __init__(self): pass def setup(self, args, state, model, **kwargs): ''' Setup the optional Weights & Biases (...
8
2
33
3
26
4
7
0.18
1
8
2
0
7
3
7
22
244
28
183
43
172
33
121
39
110
19
1
6
46
418
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/integration_utils.py
transformers.integrations.integration_utils.WandbLogModel
from typing import TYPE_CHECKING, Any, Literal, Optional, Union import os from ..utils import ENV_VARS_TRUE_VALUES, is_torch_xla_available from enum import Enum class WandbLogModel(str, Enum): """Enum of possible log model values in W&B.""" CHECKPOINT = 'checkpoint' END = 'end' FALSE = 'false' @pr...
class WandbLogModel(str, Enum): '''Enum of possible log model values in W&B.''' @property def is_enabled(self) -> bool: '''Check if the value corresponds to a state where the `WANDB_LOG_MODEL` setting is enabled.''' pass @classmethod def _missing_(cls, value: Any) -> 'WandbLogModel'...
5
2
9
0
8
1
2
0.09
2
5
0
0
1
0
2
117
27
3
22
8
17
2
15
6
12
3
4
1
4
419
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/mistral.py
transformers.integrations.mistral.MistralConverter
from transformers.convert_slow_tokenizer import bytes_to_unicode from tokenizers import Regex, Tokenizer, decoders, pre_tokenizers, processors from tokenizers.models import BPE class MistralConverter: """ A general tiktoken converter. """ def __init__(self, vocab=None, pattern="(?i:'s|'t|'re|'ve|'m|'l...
class MistralConverter: ''' A general tiktoken converter. ''' def __init__(self, vocab=None, pattern="(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+", add_prefix_space=False, additional_special_tokens=None, *args, **...
6
1
12
1
12
0
2
0.05
0
4
0
0
4
4
4
4
68
8
57
28
43
3
43
20
37
6
0
4
11
420
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/integrations/peft.py
transformers.integrations.peft.PeftAdapterMixin
import re from typing import Any, Optional, Union import warnings import importlib from packaging import version from ..utils import check_peft_version, find_adapter_config_file, is_accelerate_available, is_peft_available, is_torch_available, logging import inspect class PeftAdapterMixin: """ A class containin...
class PeftAdapterMixin: ''' A class containing all functions for loading and using adapters weights that are supported in PEFT library. For more details about adapters and injecting them on a transformer-based model, check out the documentation of PEFT library: https://huggingface.co/docs/peft/index ...
11
10
51
8
26
16
7
0.68
0
12
0
0
10
0
10
10
544
97
266
70
223
181
173
49
151
27
0
4
74
421
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/kernels/falcon_mamba/selective_scan_with_ln_interface.py
transformers.kernels.falcon_mamba.selective_scan_with_ln_interface.MambaInnerFn
from einops import rearrange, repeat from torch.cuda.amp import custom_bwd, custom_fwd import torch import torch.nn.functional as F import selective_scan_cuda class MambaInnerFn(torch.autograd.Function): @staticmethod @custom_fwd def forward(ctx, xz, conv1d_weight, conv1d_bias, x_proj_weight, delta_proj_w...
class MambaInnerFn(torch.autograd.Function): @staticmethod @custom_fwd def forward(ctx, xz, conv1d_weight, conv1d_bias, x_proj_weight, delta_proj_weight, out_proj_weight, out_proj_bias, A, B=None, C=None, D=None, delta_bias=None, B_proj_bias=None, C_proj_bias=None, delta_softplus=True, checkpoint_lvl=1, b...
7
1
128
2
119
13
18
0.11
1
0
0
0
0
0
2
32
262
4
242
70
213
26
128
28
125
19
5
2
36
422
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/kernels/falcon_mamba/selective_scan_with_ln_interface.py
transformers.kernels.falcon_mamba.selective_scan_with_ln_interface.SelectiveScanFn
import torch.nn.functional as F import torch from einops import rearrange, repeat import selective_scan_cuda class SelectiveScanFn(torch.autograd.Function): @staticmethod def forward(ctx, u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False, return_last_state=False): if u.stride(-1...
class SelectiveScanFn(torch.autograd.Function): @staticmethod def forward(ctx, u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False, return_last_state=False): pass @staticmethod def backward(ctx, dout, *args): pass
5
0
38
0
36
3
10
0.07
1
0
0
0
0
0
2
32
79
1
75
15
68
5
43
11
40
12
5
1
20
423
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/loss/loss_deformable_detr.py
transformers.loss.loss_deformable_detr.DeformableDetrHungarianMatcher
import torch.nn as nn from ..image_transforms import center_to_corners_format import torch from .loss_for_object_detection import HungarianMatcher, ImageLoss, _set_aux_loss, generalized_box_iou, sigmoid_focal_loss class DeformableDetrHungarianMatcher(HungarianMatcher): @torch.no_grad() def forward(self, outpu...
class DeformableDetrHungarianMatcher(HungarianMatcher): @torch.no_grad() def forward(self, outputs, targets): ''' Differences: - out_prob = outputs["logits"].flatten(0, 1).sigmoid() instead of softmax - class_cost uses alpha and gamma ''' pass
3
1
36
7
18
13
1
0.65
1
1
0
0
1
0
1
13
38
7
20
18
17
13
19
17
17
1
2
0
1
424
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/loss/loss_deformable_detr.py
transformers.loss.loss_deformable_detr.DeformableDetrImageLoss
import torch.nn as nn import torch from .loss_for_object_detection import HungarianMatcher, ImageLoss, _set_aux_loss, generalized_box_iou, sigmoid_focal_loss class DeformableDetrImageLoss(ImageLoss): def __init__(self, matcher, num_classes, focal_alpha, losses): nn.Module.__init__(self) self.match...
class DeformableDetrImageLoss(ImageLoss): def __init__(self, matcher, num_classes, focal_alpha, losses): pass def loss_labels(self, outputs, targets, indices, num_boxes): ''' Classification loss (Binary focal loss) targets dicts must contain the key "class_labels" containing a tensor ...
3
1
19
2
15
2
2
0.16
1
2
0
0
2
4
2
21
41
5
31
14
28
5
21
14
18
2
2
1
3
425
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/loss/loss_for_object_detection.py
transformers.loss.loss_for_object_detection.HungarianMatcher
import torch.nn as nn import torch from ..utils import is_accelerate_available, is_scipy_available, is_vision_available, requires_backends class HungarianMatcher(nn.Module): """ This class computes an assignment between the targets and the predictions of the network. For efficiency reasons, the targets do...
class HungarianMatcher(nn.Module): ''' This class computes an assignment between the targets and the predictions of the network. For efficiency reasons, the targets don't include the no_object. Because of this, in general, there are more predictions than targets. In this case, we do a 1-to-1 matching o...
4
2
29
5
11
14
2
1.71
1
4
0
1
2
3
2
12
76
13
24
18
20
41
23
17
20
2
1
1
3
426
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/loss/loss_for_object_detection.py
transformers.loss.loss_for_object_detection.ImageLoss
import torch.nn as nn import torch from ..utils import is_accelerate_available, is_scipy_available, is_vision_available, requires_backends class ImageLoss(nn.Module): """ This class computes the losses for DetrForObjectDetection/DetrForSegmentation. The process happens in two steps: 1) we compute hungarian...
null
11
6
18
2
12
4
2
0.52
1
7
0
1
9
4
9
19
197
30
110
53
99
57
95
52
85
8
1
4
20
427
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/loss/loss_for_object_detection.py
transformers.loss.loss_for_object_detection.NestedTensor
from torch import Tensor from typing import Optional class NestedTensor: def __init__(self, tensors, mask: Optional[Tensor]): self.tensors = tensors self.mask = mask def to(self, device): cast_tensor = self.tensors.to(device) mask = self.mask if mask is not None: ...
class NestedTensor: def __init__(self, tensors, mask: Optional[Tensor]): pass def to(self, device): pass def decompose(self): pass def __repr__(self): pass
5
0
4
0
4
0
1
0
0
2
0
0
4
2
4
4
19
3
16
10
11
0
15
10
10
2
0
1
5
428
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/loss/loss_rt_detr.py
transformers.loss.loss_rt_detr.RTDetrHungarianMatcher
import torch.nn as nn import torch from ..utils import is_scipy_available, is_vision_available, requires_backends import torch.nn.functional as F from .loss_for_object_detection import box_iou, dice_loss, generalized_box_iou, nested_tensor_from_tensor_list, sigmoid_focal_loss class RTDetrHungarianMatcher(nn.Module): ...
class RTDetrHungarianMatcher(nn.Module): '''This class computes an assignment between the targets and the predictions of the network For efficiency reasons, the targets don't include the no_object. Because of this, in general, there are more predictions than targets. In this case, we do a 1-to-1 matching o...
4
2
33
5
16
13
2
0.97
1
3
0
0
2
6
2
12
79
14
34
23
30
33
32
22
29
2
1
1
4
429
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/loss/loss_rt_detr.py
transformers.loss.loss_rt_detr.RTDetrLoss
import torch import torch.nn as nn import torch.nn.functional as F from .loss_for_object_detection import box_iou, dice_loss, generalized_box_iou, nested_tensor_from_tensor_list, sigmoid_focal_loss class RTDetrLoss(nn.Module): """ This class computes the losses for RTDetr. The process happens in two steps: 1) ...
class RTDetrLoss(nn.Module): ''' This class computes the losses for RTDetr. The process happens in two steps: 1) we compute hungarian assignment between ground truth boxes and the outputs of the model 2) we supervise each pair of matched ground-truth / prediction (supervise class and box). Args: ...
16
6
21
2
16
3
2
0.28
1
7
1
0
12
7
13
23
306
43
205
92
189
58
168
90
154
11
1
4
32
430
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modelcard.py
transformers.modelcard.ModelCard
import os import json import warnings from .utils import MODEL_CARD_NAME, cached_file, is_datasets_available, is_offline_mode, is_tokenizers_available, is_torch_available, logging import copy class ModelCard: """ Structured Model Card class. Store model card as well as methods for loading/downloading/saving mo...
class ModelCard: ''' Structured Model Card class. Store model card as well as methods for loading/downloading/saving model cards. Please read the following paper for details and explanation on the sections: "Model Cards for Model Reporting" by Margaret Mitchell, Simone Wu, Andrew Zaldivar, Parker Barne...
14
8
15
2
9
5
2
0.6
0
4
0
0
7
9
10
10
171
29
89
41
75
53
74
35
63
9
0
3
21
431
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modelcard.py
transformers.modelcard.TrainingSummary
from .utils import MODEL_CARD_NAME, cached_file, is_datasets_available, is_offline_mode, is_tokenizers_available, is_torch_available, logging from huggingface_hub import model_info from huggingface_hub.utils import HFValidationError from . import __version__ from dataclasses import dataclass import yaml import os from ...
@dataclass class TrainingSummary: def __post_init__(self): pass def create_model_index(self, metric_mapping): pass def create_metadata(self): pass def to_model_card(self): pass @classmethod def from_trainer(cls, trainer, language=None, license=None, tags=None,...
8
0
53
7
44
4
11
0.08
0
7
0
0
4
0
6
6
343
46
282
82
243
23
183
54
172
17
0
4
65
432
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_attn_mask_utils.py
transformers.modeling_attn_mask_utils.AttentionMaskConverter
import torch from dataclasses import dataclass from .utils.import_utils import is_torchdynamo_compiling from typing import Optional, Union @dataclass class AttentionMaskConverter: """ A utility attention mask class that allows one to: - Create a causal 4d mask - Create a causal 4d mask with sli...
@dataclass class AttentionMaskConverter: ''' A utility attention mask class that allows one to: - Create a causal 4d mask - Create a causal 4d mask with slided window - Convert a 2d attention mask (batch_size, query_length) to a 4d attention mask (batch_size, 1, query_length, k...
13
7
33
4
17
12
4
0.84
0
7
0
0
3
0
7
7
277
42
128
60
88
107
69
28
61
7
0
3
25
433
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_flash_attention_utils.py
transformers.modeling_flash_attention_utils.FlashAttentionKwargs
import torch.nn.functional as F import torch from typing import Optional, TypedDict class FlashAttentionKwargs(TypedDict, total=False): """ Keyword arguments for Flash Attention with Compile. Attributes: cu_seq_lens_q (`torch.LongTensor`, *optional*) Gets cumulative sequence length for...
class FlashAttentionKwargs(TypedDict, total=False): ''' Keyword arguments for Flash Attention with Compile. Attributes: cu_seq_lens_q (`torch.LongTensor`, *optional*) Gets cumulative sequence length for query state. cu_seq_lens_k (`torch.LongTensor`, *optional*) Gets...
1
1
0
0
0
0
0
2.4
2
0
0
23
0
0
0
0
19
2
5
1
4
12
5
1
4
0
1
0
0
434
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.BloomTensorProcessor
import numpy as np class BloomTensorProcessor(TensorProcessor): def __init__(self, config=None): super().__init__(config=config) def process(self, weights, name, **kwargs): if 'attn_qkv' in name: num_heads = self.config['n_head'] n_embed = self.config['hidden_size'] ...
class BloomTensorProcessor(TensorProcessor): def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass def _reverse_reshape_weights(self, weights: np.ndarray, n_head: int, n_embed: int): pass def _reverse_reshape_bias(self, weights: np.ndarray, n...
5
0
8
1
6
1
2
0.15
1
3
1
0
4
0
4
6
37
7
26
11
21
4
25
11
20
3
1
2
6
435
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.GGUFTensor
import numpy as np from typing import NamedTuple, Optional class GGUFTensor(NamedTuple): weights: np.ndarray name: str metadata: dict
class GGUFTensor(NamedTuple): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
4
0
4
1
3
0
4
1
3
0
1
0
0
436
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.GPT2TensorProcessor
import numpy as np class GPT2TensorProcessor(TensorProcessor): def __init__(self, config=None): super().__init__(config=config) def process(self, weights, name, **kwargs): if 'attn_qkv.weight' in name or 'ffn_down.weight' in name or 'ffn_up.weight' in name or ('attn_output.weight' in name): ...
class GPT2TensorProcessor(TensorProcessor): def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass
3
0
11
1
8
3
2
0.35
1
2
1
0
2
0
2
4
24
2
17
4
14
6
12
4
9
3
1
1
4
437
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.Gemma2TensorProcessor
class Gemma2TensorProcessor(TensorProcessor): def __init__(self, config=None): super().__init__(config=config) def process(self, weights, name, **kwargs): if 'norm.weight' in name: weights = weights - 1 return GGUFTensor(weights, name, {})
class Gemma2TensorProcessor(TensorProcessor): def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass
3
0
3
0
3
0
2
0.29
1
2
1
0
2
0
2
4
10
1
7
3
4
2
7
3
4
2
1
1
3
438
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.LlamaTensorProcessor
from typing import NamedTuple, Optional import numpy as np class LlamaTensorProcessor(TensorProcessor): def __init__(self, config=None): super().__init__(config=config) def process(self, weights, name, **kwargs): if '.attn_k.' in name or '.attn_q.' in name: num_heads = self.config...
class LlamaTensorProcessor(TensorProcessor): def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass def _reverse_permute_weights(self, weights: np.ndarray, n_head: int, num_kv_heads: Optional[int]=None) -> np.ndarray: pass
4
0
8
1
7
1
3
0.09
1
3
1
0
3
0
3
5
28
4
22
10
16
2
19
8
15
5
1
2
8
439
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.MambaTensorProcessor
import numpy as np class MambaTensorProcessor(TensorProcessor): def __init__(self, config=None): super().__init__(config=config) def process(self, weights, name, **kwargs): if 'ssm_conv1d.weight' in name: weights = np.expand_dims(weights, axis=1) if 'ssm_a' in name: ...
class MambaTensorProcessor(TensorProcessor): def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass
3
0
6
0
4
2
2
0.44
1
2
1
0
2
0
2
4
14
1
9
3
6
4
9
3
6
3
1
1
4
440
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.NemotronTensorProcessor
class NemotronTensorProcessor(TensorProcessor): def __init__(self, config=None): super().__init__(config=config) def process(self, weights, name, **kwargs): if 'norm.weight' in name: weights = weights - 1 return GGUFTensor(weights, name, {})
class NemotronTensorProcessor(TensorProcessor): def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass
3
0
3
0
3
0
2
0.14
1
2
1
0
2
0
2
4
9
1
7
3
4
1
7
3
4
2
1
1
3
441
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.Qwen2MoeTensorProcessor
import numpy as np class Qwen2MoeTensorProcessor(TensorProcessor): def __init__(self, config=None): super().__init__(config=config) def process(self, weights, name, **kwargs): if '_exp' in name: tensor_key_mapping = kwargs.get('tensor_key_mapping') parsed_parameters = ...
class Qwen2MoeTensorProcessor(TensorProcessor): def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass def _split_moe_expert_tensor(self, weights: np.ndarray, parsed_parameters: dict[str, dict], name: str, tensor_key_mapping: dict): pass
4
0
8
0
7
1
2
0.18
1
5
1
0
3
0
3
5
28
2
22
12
16
4
20
10
16
4
1
2
7
442
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.T5TensorProcessor
class T5TensorProcessor(TensorProcessor): def __init__(self, config=None): super().__init__(config=config) def process(self, weights, name, **kwargs): bid = None for chunk in name.split('.'): if chunk.isdigit(): bid = int(chunk) break ...
class T5TensorProcessor(TensorProcessor): def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass
3
0
5
0
5
0
2
0
1
3
1
0
2
0
2
4
11
1
10
5
7
0
10
5
7
3
1
2
4
443
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_gguf_pytorch_utils.py
transformers.modeling_gguf_pytorch_utils.TensorProcessor
class TensorProcessor: def __init__(self, config=None): self.config = config or {} def process(self, weights, name, **kwargs): return GGUFTensor(weights, name, {})
class TensorProcessor: def __init__(self, config=None): pass def process(self, weights, name, **kwargs): pass
3
0
2
0
2
0
1
0
0
1
1
8
2
1
2
2
6
1
5
4
2
0
5
4
2
1
0
0
2
444
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BackboneOutput
import torch from typing import Optional from dataclasses import dataclass from .utils import ModelOutput @dataclass class BackboneOutput(ModelOutput): """ Base class for outputs of backbones. Args: feature_maps (`tuple(torch.FloatTensor)` of shape `(batch_size, num_channels, height, width)`): ...
@dataclass class BackboneOutput(ModelOutput): ''' Base class for outputs of backbones. Args: feature_maps (`tuple(torch.FloatTensor)` of shape `(batch_size, num_channels, height, width)`): Feature maps of the stages. hidden_states (`tuple(torch.FloatTensor)`, *optional*, returned...
2
1
0
0
0
0
0
4
1
0
0
0
0
0
0
0
24
4
4
4
3
16
4
4
3
0
1
0
0
445
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutput
from .utils import ModelOutput from typing import Optional import torch from dataclasses import dataclass @dataclass class BaseModelOutput(ModelOutput): """ Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_si...
@dataclass class BaseModelOutput(ModelOutput): ''' Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states at the output of the last layer o...
2
1
0
0
0
0
0
3.75
1
0
0
2
0
0
0
0
23
4
4
4
3
15
4
4
3
0
1
0
0
446
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutputWithCrossAttentions
from dataclasses import dataclass from .utils import ModelOutput import torch from typing import Optional @dataclass class BaseModelOutputWithCrossAttentions(ModelOutput): """ Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (`torch.FloatTensor` ...
@dataclass class BaseModelOutputWithCrossAttentions(ModelOutput): ''' Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states at the output ...
2
1
0
0
0
0
0
4
1
0
0
6
0
0
0
0
30
5
5
5
4
20
5
5
4
0
1
0
0
447
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutputWithNoAttention
from .utils import ModelOutput from dataclasses import dataclass from typing import Optional import torch @dataclass class BaseModelOutputWithNoAttention(ModelOutput): """ Base class for model's outputs, with potential hidden states. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_si...
@dataclass class BaseModelOutputWithNoAttention(ModelOutput): ''' Base class for model's outputs, with potential hidden states. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`): Sequence of hidden-states at the output of the last layer of...
2
1
0
0
0
0
0
3.33
1
0
0
0
0
0
0
0
16
3
3
3
2
10
3
3
2
0
1
0
0
448
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutputWithPast
from typing import Optional from .cache_utils import Cache, EncoderDecoderCache from .utils import ModelOutput import torch from dataclasses import dataclass @dataclass class BaseModelOutputWithPast(ModelOutput): """ Base class for model's outputs that may also contain a past key/values (to speed up sequential...
@dataclass class BaseModelOutputWithPast(ModelOutput): ''' Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding). Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-sta...
2
1
0
0
0
0
0
5
1
0
0
0
0
0
0
0
36
6
5
5
4
25
5
5
4
0
1
0
0
449
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions
from dataclasses import dataclass from .cache_utils import Cache, EncoderDecoderCache from .utils import ModelOutput from typing import Optional import torch @dataclass class BaseModelOutputWithPastAndCrossAttentions(ModelOutput): """ Base class for model's outputs that may also contain a past key/values (to s...
@dataclass class BaseModelOutputWithPastAndCrossAttentions(ModelOutput): ''' Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding). Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequ...
2
1
0
0
0
0
0
5
1
0
0
0
0
0
0
0
43
7
6
6
5
30
6
6
5
0
1
0
0
450
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutputWithPooling
from typing import Optional from dataclasses import dataclass import torch from .utils import ModelOutput @dataclass class BaseModelOutputWithPooling(ModelOutput): """ Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (`torch.FloatTensor...
@dataclass class BaseModelOutputWithPooling(ModelOutput): ''' Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states at the outpu...
2
1
0
0
0
0
0
4
1
0
0
3
0
0
0
0
29
4
5
5
4
20
5
5
4
0
1
0
0
451
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions
from .cache_utils import Cache, EncoderDecoderCache from typing import Optional from dataclasses import dataclass import torch from .utils import ModelOutput @dataclass class BaseModelOutputWithPoolingAndCrossAttentions(ModelOutput): """ Base class for model's outputs that also contains a pooling of the last h...
@dataclass class BaseModelOutputWithPoolingAndCrossAttentions(ModelOutput): ''' Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-s...
2
1
0
0
0
0
0
4.71
1
0
0
0
0
0
0
0
46
6
7
7
6
33
7
7
6
0
1
0
0
452
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention
from dataclasses import dataclass from .utils import ModelOutput from typing import Optional import torch @dataclass class BaseModelOutputWithPoolingAndNoAttention(ModelOutput): """ Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (`tor...
@dataclass class BaseModelOutputWithPoolingAndNoAttention(ModelOutput): ''' Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`): Sequence of hidden-states...
2
1
0
0
0
0
0
3
1
0
0
0
0
0
0
0
19
3
4
4
3
12
4
4
3
0
1
0
0
453
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.BaseModelOutputWithPoolingAndProjection
from .utils import ModelOutput from typing import Optional from dataclasses import dataclass import torch @dataclass class BaseModelOutputWithPoolingAndProjection(ModelOutput): """ Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (`torc...
@dataclass class BaseModelOutputWithPoolingAndProjection(ModelOutput): ''' Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states...
2
1
0
0
0
0
0
3.83
1
0
0
0
0
0
0
0
34
5
6
6
5
23
6
6
5
0
1
0
0
454
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.CausalLMOutput
from typing import Optional from dataclasses import dataclass from .utils import ModelOutput import torch @dataclass class CausalLMOutput(ModelOutput): """ Base class for causal language model (or autoregressive) outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `...
@dataclass class CausalLMOutput(ModelOutput): ''' Base class for causal language model (or autoregressive) outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Language modeling loss (for next-token prediction). logits (`torch...
2
1
0
0
0
0
0
3.4
1
0
0
0
0
0
0
0
26
4
5
5
4
17
5
5
4
0
1
0
0
455
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.CausalLMOutputWithCrossAttentions
from .utils import ModelOutput from .cache_utils import Cache, EncoderDecoderCache from dataclasses import dataclass import torch from typing import Optional @dataclass class CausalLMOutputWithCrossAttentions(ModelOutput): """ Base class for causal language model (or autoregressive) outputs. Args: ...
@dataclass class CausalLMOutputWithCrossAttentions(ModelOutput): ''' Base class for causal language model (or autoregressive) outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Language modeling loss (for next-token prediction). ...
2
1
0
0
0
0
0
4
1
0
0
0
0
0
0
0
41
6
7
7
6
28
7
7
6
0
1
0
0
456
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.CausalLMOutputWithPast
from .utils import ModelOutput import torch from typing import Optional from .cache_utils import Cache, EncoderDecoderCache from dataclasses import dataclass @dataclass class CausalLMOutputWithPast(ModelOutput): """ Base class for causal language model (or autoregressive) outputs. Args: loss (`tor...
@dataclass class CausalLMOutputWithPast(ModelOutput): ''' Base class for causal language model (or autoregressive) outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Language modeling loss (for next-token prediction). logits...
2
1
0
0
0
0
0
3.67
1
0
0
0
0
0
0
0
33
5
6
6
5
22
6
6
5
0
1
0
0
457
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.DepthEstimatorOutput
import torch from typing import Optional from dataclasses import dataclass from .utils import ModelOutput @dataclass class DepthEstimatorOutput(ModelOutput): """ Base class for outputs of depth estimation models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` i...
@dataclass class DepthEstimatorOutput(ModelOutput): ''' Base class for outputs of depth estimation models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Classification (or regression if config.num_labels==1) loss. predicted_dept...
2
1
0
0
0
0
0
3.4
1
0
0
0
0
0
0
0
27
5
5
5
4
17
5
5
4
0
1
0
0
458
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.ImageClassifierOutput
import torch from .utils import ModelOutput from typing import Optional from dataclasses import dataclass @dataclass class ImageClassifierOutput(ModelOutput): """ Base class for outputs of image classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labe...
@dataclass class ImageClassifierOutput(ModelOutput): ''' Base class for outputs of image classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Classification (or regression if config.num_labels==1) loss. logits (`...
2
1
0
0
0
0
0
3.4
1
0
0
2
0
0
0
0
25
3
5
5
4
17
5
5
4
0
1
0
0
459
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.ImageClassifierOutputWithNoAttention
from typing import Optional from dataclasses import dataclass import torch from .utils import ModelOutput @dataclass class ImageClassifierOutputWithNoAttention(ModelOutput): """ Base class for outputs of image classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, retu...
@dataclass class ImageClassifierOutputWithNoAttention(ModelOutput): ''' Base class for outputs of image classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Classification (or regression if config.num_labels==1) loss. ...
2
1
0
0
0
0
0
3
1
0
0
0
0
0
0
0
18
2
4
4
3
12
4
4
3
0
1
0
0
460
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.ImageSuperResolutionOutput
from dataclasses import dataclass import torch from .utils import ModelOutput from typing import Optional @dataclass class ImageSuperResolutionOutput(ModelOutput): """ Base class for outputs of image super resolution models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned whe...
@dataclass class ImageSuperResolutionOutput(ModelOutput): ''' Base class for outputs of image super resolution models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Reconstruction loss. reconstruction (`torch.FloatTensor` of sha...
2
1
0
0
0
0
0
3.4
1
0
0
0
0
0
0
0
25
3
5
5
4
17
5
5
4
0
1
0
0
461
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.MaskedImageModelingOutput
import torch import warnings from dataclasses import dataclass from typing import Optional from .utils import ModelOutput @dataclass class MaskedImageModelingOutput(ModelOutput): """ Base class for outputs of masked image completion / in-painting models. Args: loss (`torch.FloatTensor` of shape `(...
@dataclass class MaskedImageModelingOutput(ModelOutput): ''' Base class for outputs of masked image completion / in-painting models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `bool_masked_pos` is provided): Reconstruction loss. reconstruction (`to...
4
1
7
0
7
0
1
1.38
1
1
0
0
1
0
1
1
34
3
13
7
10
18
8
6
6
1
1
0
1
462
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.MaskedLMOutput
from .utils import ModelOutput from dataclasses import dataclass from typing import Optional import torch @dataclass class MaskedLMOutput(ModelOutput): """ Base class for masked language models outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided...
@dataclass class MaskedLMOutput(ModelOutput): ''' Base class for masked language models outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Masked language modeling (MLM) loss. logits (`torch.FloatTensor` of shape `(batch_siz...
2
1
0
0
0
0
0
3.4
1
0
0
0
0
0
0
0
26
4
5
5
4
17
5
5
4
0
1
0
0
463
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.MoECausalLMOutputWithPast
from .utils import ModelOutput from dataclasses import dataclass import torch from typing import Optional from .cache_utils import Cache, EncoderDecoderCache @dataclass class MoECausalLMOutputWithPast(ModelOutput): """ Base class for causal language model (or autoregressive) outputs as well as Mixture of Exper...
@dataclass class MoECausalLMOutputWithPast(ModelOutput): ''' Base class for causal language model (or autoregressive) outputs as well as Mixture of Expert's router hidden states terms, to train a MoE model. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is pr...
2
1
0
0
0
0
0
3.44
1
0
0
0
0
0
0
0
46
6
9
9
8
31
9
9
8
0
1
0
0
464
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.MoEModelOutput
from dataclasses import dataclass import torch from .utils import ModelOutput from typing import Optional @dataclass class MoEModelOutput(ModelOutput): """ Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_siz...
@dataclass class MoEModelOutput(ModelOutput): ''' Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states at the output of the last layer of...
2
1
0
0
0
0
0
3.8
1
0
0
0
0
0
0
0
29
5
5
5
4
19
5
5
4
0
1
0
0
465
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.MoEModelOutputWithPastAndCrossAttentions
import torch from typing import Optional from .cache_utils import Cache, EncoderDecoderCache from .utils import ModelOutput from dataclasses import dataclass @dataclass class MoEModelOutputWithPastAndCrossAttentions(ModelOutput): """ Base class for model's outputs that may also contain a past key/values (to sp...
@dataclass class MoEModelOutputWithPastAndCrossAttentions(ModelOutput): ''' Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding) as well as Mixture of Expert's router hidden states terms, to train a MoE model. Args: last_hidden_state (`torch.Fl...
2
1
0
0
0
0
0
5
1
0
0
0
0
0
0
0
50
8
7
7
6
35
7
7
6
0
1
0
0
466
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.MoeCausalLMOutputWithPast
from dataclasses import dataclass from typing import Optional import torch from .cache_utils import Cache, EncoderDecoderCache from .utils import ModelOutput @dataclass class MoeCausalLMOutputWithPast(ModelOutput): """ Base class for causal language model (or autoregressive) with mixture of experts outputs. ...
@dataclass class MoeCausalLMOutputWithPast(ModelOutput): ''' Base class for causal language model (or autoregressive) with mixture of experts outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Language modeling loss (for next-token ...
2
1
0
0
0
0
0
3.5
1
0
0
0
0
0
0
0
46
10
8
8
7
28
8
8
7
0
1
0
0
467
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.MoeModelOutputWithPast
from typing import Optional from dataclasses import dataclass from .cache_utils import Cache, EncoderDecoderCache from .utils import ModelOutput import torch @dataclass class MoeModelOutputWithPast(ModelOutput): """ Base class for model's outputs, with potential hidden states and attentions. Args: ...
@dataclass class MoeModelOutputWithPast(ModelOutput): ''' Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states at the output of the last ...
2
1
0
0
0
0
0
4.5
1
0
0
0
0
0
0
0
39
6
6
6
5
27
6
6
5
0
1
0
0
468
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.MultipleChoiceModelOutput
from dataclasses import dataclass import torch from typing import Optional from .utils import ModelOutput @dataclass class MultipleChoiceModelOutput(ModelOutput): """ Base class for outputs of multiple choice models. Args: loss (`torch.FloatTensor` of shape *(1,)*, *optional*, returned when `label...
@dataclass class MultipleChoiceModelOutput(ModelOutput): ''' Base class for outputs of multiple choice models. Args: loss (`torch.FloatTensor` of shape *(1,)*, *optional*, returned when `labels` is provided): Classification loss. logits (`torch.FloatTensor` of shape `(batch_size,...
2
1
0
0
0
0
0
3.6
1
0
0
0
0
0
0
0
28
5
5
5
4
18
5
5
4
0
1
0
0
469
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.NextSentencePredictorOutput
from typing import Optional from .utils import ModelOutput from dataclasses import dataclass import torch @dataclass class NextSentencePredictorOutput(ModelOutput): """ Base class for outputs of models predicting if two sentences are consecutive or not. Args: loss (`torch.FloatTensor` of shape `(1...
@dataclass class NextSentencePredictorOutput(ModelOutput): ''' Base class for outputs of models predicting if two sentences are consecutive or not. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `next_sentence_label` is provided): Next sequence prediction (cla...
2
1
0
0
0
0
0
3.6
1
0
0
0
0
0
0
0
27
4
5
5
4
18
5
5
4
0
1
0
0
470
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.QuestionAnsweringModelOutput
from dataclasses import dataclass from .utils import ModelOutput from typing import Optional import torch @dataclass class QuestionAnsweringModelOutput(ModelOutput): """ Base class for outputs of question answering models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when ...
@dataclass class QuestionAnsweringModelOutput(ModelOutput): ''' Base class for outputs of question answering models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Total span extraction loss is the sum of a Cross-Entropy for the start an...
2
1
0
0
0
0
0
3.17
1
0
0
0
0
0
0
0
29
4
6
6
5
19
6
6
5
0
1
0
0
471
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.SemanticSegmenterOutput
from typing import Optional import torch from .utils import ModelOutput from dataclasses import dataclass @dataclass class SemanticSegmenterOutput(ModelOutput): """ Base class for outputs of semantic segmentation models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `l...
@dataclass class SemanticSegmenterOutput(ModelOutput): ''' Base class for outputs of semantic segmentation models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Classification (or regression if config.num_labels==1) loss. logits...
2
1
0
0
0
0
0
4.4
1
0
0
0
0
0
0
0
35
8
5
5
4
22
5
5
4
0
1
0
0
472
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqLMOutput
from .utils import ModelOutput from .cache_utils import Cache, EncoderDecoderCache from typing import Optional import torch from dataclasses import dataclass @dataclass class Seq2SeqLMOutput(ModelOutput): """ Base class for sequence-to-sequence language models outputs. Args: loss (`torch.FloatTens...
@dataclass class Seq2SeqLMOutput(ModelOutput): ''' Base class for sequence-to-sequence language models outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Language modeling loss. logits (`torch.FloatTensor` of shape `(batch_s...
2
1
0
0
0
0
0
3.9
1
0
0
0
0
0
0
0
57
8
10
10
9
39
10
10
9
0
1
0
0
473
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqMoEModelOutput
import torch from typing import Optional from .utils import ModelOutput from dataclasses import dataclass from .cache_utils import Cache, EncoderDecoderCache @dataclass class Seq2SeqMoEModelOutput(ModelOutput): """ Base class for model encoder's outputs that also contains : pre-computed hidden states that can ...
@dataclass class Seq2SeqMoEModelOutput(ModelOutput): ''' Base class for model encoder's outputs that also contains : pre-computed hidden states that can speed up sequential decoding. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): ...
2
1
0
0
0
0
0
4.27
1
0
0
0
0
0
0
0
69
11
11
11
10
47
11
11
10
0
1
0
0
474
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqMoEOutput
from typing import Optional from .cache_utils import Cache, EncoderDecoderCache import torch from dataclasses import dataclass from .utils import ModelOutput @dataclass class Seq2SeqMoEOutput(ModelOutput): """ Base class for sequence-to-sequence language models outputs. Args: loss (`torch.FloatTen...
@dataclass class Seq2SeqMoEOutput(ModelOutput): ''' Base class for sequence-to-sequence language models outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Language modeling loss. logits (`torch.FloatTensor` of shape `(batch_...
2
1
0
0
0
0
0
2.88
1
0
0
0
0
0
0
0
72
10
16
16
15
46
16
16
15
0
1
0
0
475
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqModelOutput
from typing import Optional from .cache_utils import Cache, EncoderDecoderCache import torch from .utils import ModelOutput from dataclasses import dataclass @dataclass class Seq2SeqModelOutput(ModelOutput): """ Base class for model encoder's outputs that also contains : pre-computed hidden states that can spe...
@dataclass class Seq2SeqModelOutput(ModelOutput): ''' Base class for model encoder's outputs that also contains : pre-computed hidden states that can speed up sequential decoding. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Seq...
2
1
0
0
0
0
0
4.44
1
0
0
4
0
0
0
0
58
9
9
9
8
40
9
9
8
0
1
0
0
476
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqQuestionAnsweringModelOutput
from .cache_utils import Cache, EncoderDecoderCache from .utils import ModelOutput import torch from dataclasses import dataclass from typing import Optional @dataclass class Seq2SeqQuestionAnsweringModelOutput(ModelOutput): """ Base class for outputs of sequence-to-sequence question answering models. Arg...
@dataclass class Seq2SeqQuestionAnsweringModelOutput(ModelOutput): ''' Base class for outputs of sequence-to-sequence question answering models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Total span extraction loss is the sum of a Cr...
2
1
0
0
0
0
0
3.73
1
0
0
0
0
0
0
0
60
8
11
11
10
41
11
11
10
0
1
0
0
477
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqSequenceClassifierOutput
from typing import Optional from dataclasses import dataclass from .cache_utils import Cache, EncoderDecoderCache from .utils import ModelOutput import torch @dataclass class Seq2SeqSequenceClassifierOutput(ModelOutput): """ Base class for outputs of sequence-to-sequence sentence classification models. Ar...
@dataclass class Seq2SeqSequenceClassifierOutput(ModelOutput): ''' Base class for outputs of sequence-to-sequence sentence classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `label` is provided): Classification (or regression if config.num_l...
2
1
0
0
0
0
0
3.9
1
0
0
0
0
0
0
0
57
8
10
10
9
39
10
10
9
0
1
0
0
478
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqSpectrogramOutput
import torch from .cache_utils import Cache, EncoderDecoderCache from typing import Optional from .utils import ModelOutput from dataclasses import dataclass @dataclass class Seq2SeqSpectrogramOutput(ModelOutput): """ Base class for sequence-to-sequence spectrogram outputs. Args: loss (`torch.Floa...
@dataclass class Seq2SeqSpectrogramOutput(ModelOutput): ''' Base class for sequence-to-sequence spectrogram outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Spectrogram generation loss. spectrogram (`torch.FloatTensor` of ...
2
1
0
0
0
0
0
3.9
1
0
0
0
0
0
0
0
57
8
10
10
9
39
10
10
9
0
1
0
0
479
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqTSModelOutput
from dataclasses import dataclass import torch from typing import Optional from .cache_utils import Cache, EncoderDecoderCache from .utils import ModelOutput @dataclass class Seq2SeqTSModelOutput(ModelOutput): """ Base class for time series model's encoder outputs that also contains pre-computed hidden states ...
@dataclass class Seq2SeqTSModelOutput(ModelOutput): ''' Base class for time series model's encoder outputs that also contains pre-computed hidden states that can speed up sequential decoding. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): ...
2
1
0
0
0
0
0
4
1
0
0
0
0
0
0
0
69
9
12
12
11
48
12
12
11
0
1
0
0
480
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Seq2SeqTSPredictionOutput
from dataclasses import dataclass import torch from .utils import ModelOutput from typing import Optional from .cache_utils import Cache, EncoderDecoderCache @dataclass class Seq2SeqTSPredictionOutput(ModelOutput): """ Base class for time series model's decoder outputs that also contain the loss as well as the...
@dataclass class Seq2SeqTSPredictionOutput(ModelOutput): ''' Base class for time series model's decoder outputs that also contain the loss as well as the parameters of the chosen distribution. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when a `future_values` is provide...
2
1
0
0
0
0
0
3.69
1
0
0
0
0
0
0
0
69
8
13
13
12
48
13
13
12
0
1
0
0
481
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.SequenceClassifierOutput
from dataclasses import dataclass import torch from typing import Optional from .utils import ModelOutput @dataclass class SequenceClassifierOutput(ModelOutput): """ Base class for outputs of sentence classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when...
@dataclass class SequenceClassifierOutput(ModelOutput): ''' Base class for outputs of sentence classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Classification (or regression if config.num_labels==1) loss. log...
2
1
0
0
0
0
0
3.4
1
0
0
0
0
0
0
0
26
4
5
5
4
17
5
5
4
0
1
0
0
482
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.SequenceClassifierOutputWithPast
from typing import Optional import torch from .cache_utils import Cache, EncoderDecoderCache from dataclasses import dataclass from .utils import ModelOutput @dataclass class SequenceClassifierOutputWithPast(ModelOutput): """ Base class for outputs of sentence classification models. Args: loss (`t...
@dataclass class SequenceClassifierOutputWithPast(ModelOutput): ''' Base class for outputs of sentence classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Classification (or regression if config.num_labels==1) loss. ...
2
1
0
0
0
0
0
3.67
1
0
0
0
0
0
0
0
33
5
6
6
5
22
6
6
5
0
1
0
0
483
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.TokenClassifierOutput
from typing import Optional from .utils import ModelOutput from dataclasses import dataclass import torch @dataclass class TokenClassifierOutput(ModelOutput): """ Base class for outputs of token classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labe...
@dataclass class TokenClassifierOutput(ModelOutput): ''' Base class for outputs of token classification models. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided) : Classification loss. logits (`torch.FloatTensor` of shape `(batch_siz...
2
1
0
0
0
0
0
3.4
1
0
0
0
0
0
0
0
26
4
5
5
4
17
5
5
4
0
1
0
0
484
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.Wav2Vec2BaseModelOutput
from .utils import ModelOutput from typing import Optional import torch from dataclasses import dataclass @dataclass class Wav2Vec2BaseModelOutput(ModelOutput): """ Base class for models that have been trained with the Wav2Vec2 loss objective. Args: last_hidden_state (`torch.FloatTensor` of shape ...
@dataclass class Wav2Vec2BaseModelOutput(ModelOutput): ''' Base class for models that have been trained with the Wav2Vec2 loss objective. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states at the output of the la...
2
1
0
0
0
0
0
3.4
1
0
0
0
0
0
0
0
26
4
5
5
4
17
5
5
4
0
1
0
0
485
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_outputs.py
transformers.modeling_outputs.XVectorOutput
from typing import Optional import torch from dataclasses import dataclass from .utils import ModelOutput @dataclass class XVectorOutput(ModelOutput): """ Output type of [`Wav2Vec2ForXVector`]. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): ...
@dataclass class XVectorOutput(ModelOutput): ''' Output type of [`Wav2Vec2ForXVector`]. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided): Classification loss. logits (`torch.FloatTensor` of shape `(batch_size, config.xvector_output_...
2
1
0
0
0
0
0
3.17
1
0
0
0
0
0
0
0
29
4
6
6
5
19
6
6
5
0
1
0
0
486
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_utils.py
transformers.modeling_utils.ModuleUtilsMixin
from torch import Tensor, nn from .utils import ADAPTER_SAFE_WEIGHTS_NAME, ADAPTER_WEIGHTS_NAME, CONFIG_NAME, DUMMY_INPUTS, SAFE_WEIGHTS_INDEX_NAME, SAFE_WEIGHTS_NAME, WEIGHTS_INDEX_NAME, WEIGHTS_NAME, ContextManagers, PushToHubMixin, cached_file, check_torch_load_is_safe, copy_func, download_url, extract_commit_hash, ...
class ModuleUtilsMixin: ''' A few utilities for `torch.nn.Modules`, to be used as a mixin. ''' @staticmethod def _hook_rss_memory_pre_forward(module, *args, **kwargs): pass @staticmethod def _hook_rss_memory_post_forward(module, *args, **kwargs): pass def add_memory_hoo...
20
12
20
2
11
7
3
0.65
0
11
0
2
11
2
14
14
309
44
163
52
134
106
117
39
99
9
0
4
44
487
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/modeling_utils.py
transformers.modeling_utils.PreTrainedModel
from .loss.loss_utils import LOSS_MAPPING from torch.utils.checkpoint import checkpoint import sys from torch.distributions import constraints import shutil import re from torch import Tensor, nn import os from .integrations.tensor_parallel import _get_parameter_tp_plan, distribute_model, initialize_tensor_parallelism,...
class PreTrainedModel(nn.Module, EmbeddingAccessMixin, ModuleUtilsMixin, PushToHubMixin, PeftAdapterMixin): ''' Base class for all models. [`PreTrainedModel`] takes care of storing the configuration of the models and handles methods for loading, downloading and saving models as well as a few methods co...
125
54
56
6
37
12
8
0.35
5
30
6
31
51
13
67
129
3,998
507
2,590
572
2,354
913
1,476
423
1,384
146
1
7
574
488
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/configuration_albert.py
transformers.models.albert.configuration_albert.AlbertConfig
from ...configuration_utils import PretrainedConfig class AlbertConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`AlbertModel`] or a [`TFAlbertModel`]. It is used to instantiate an ALBERT model according to the specified arguments, defining the model architectu...
class AlbertConfig(PretrainedConfig): ''' This is the configuration class to store the configuration of a [`AlbertModel`] or a [`TFAlbertModel`]. It is used to instantiate an ALBERT model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defau...
2
1
43
1
42
0
1
1.61
1
1
0
0
1
17
1
1
126
11
44
43
19
71
21
20
19
1
1
0
1
489
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/configuration_albert.py
transformers.models.albert.configuration_albert.AlbertOnnxConfig
from collections import OrderedDict from collections.abc import Mapping from ...onnx import OnnxConfig class AlbertOnnxConfig(OnnxConfig): @property def inputs(self) -> Mapping[str, Mapping[int, str]]: if self.task == 'multiple-choice': dynamic_axis = {0: 'batch', 1: 'choice', 2: 'sequence...
class AlbertOnnxConfig(OnnxConfig): @property def inputs(self) -> Mapping[str, Mapping[int, str]]: pass
3
0
12
0
12
0
2
0
1
3
0
0
1
0
1
1
14
0
14
4
11
0
6
3
4
2
1
1
2
490
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertAttention
from ...processing_utils import Unpack from .configuration_albert import AlbertConfig from torch import nn from ...pytorch_utils import apply_chunking_to_forward, find_pruneable_heads_and_indices, prune_linear_layer import torch from typing import Callable, Optional, Union from ...modeling_utils import ALL_ATTENTION_FU...
class AlbertAttention(nn.Module): def __init__(self, config: AlbertConfig): pass def prune_heads(self, heads: list[int]) -> None: pass def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, **kwargs: U...
4
0
26
4
20
2
3
0.12
1
7
1
1
4
15
4
14
110
19
82
48
71
10
70
42
65
7
1
2
13
491
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertEmbeddings
import torch from typing import Callable, Optional, Union from torch import nn from .configuration_albert import AlbertConfig class AlbertEmbeddings(nn.Module): """ Construct the embeddings from word, position and token_type embeddings. """ def __init__(self, config: AlbertConfig): super().__i...
class AlbertEmbeddings(nn.Module): ''' Construct the embeddings from word, position and token_type embeddings. ''' def __init__(self, config: AlbertConfig): pass def forward(self, input_ids: Optional[torch.LongTensor]=None, token_type_ids: Optional[torch.LongTensor]=None, position_ids: Op...
3
1
30
4
23
3
4
0.21
1
4
1
0
2
6
2
12
66
9
47
23
37
10
34
16
31
7
1
2
8
492
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertForMaskedLM
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, MaskedLMOutput, MultipleChoiceModelOutput, QuestionAnsweringModelOutput, SequenceClassifierOutput, TokenClassifierOutput from torch import nn from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss import torch from ...utils.generic ...
@auto_docstring class AlbertForMaskedLM(AlbertPreTrainedModel): def __init__(self, config): pass def get_output_embeddings(self) -> nn.Linear: pass def set_output_embeddings(self, new_embeddings: nn.Linear) -> None: pass def get_input_embeddings(self) -> nn.Embedding: ...
9
1
19
3
10
6
2
0.55
2
5
3
0
5
2
5
6
106
19
56
28
36
31
27
15
21
5
2
1
9
493
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertForMultipleChoice
from torch import nn import torch from typing import Callable, Optional, Union from ...utils import ModelOutput, TransformersKwargs, auto_docstring, is_torch_flex_attn_available, logging from ...processing_utils import Unpack from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, MaskedLMOutput, M...
@auto_docstring class AlbertForMultipleChoice(AlbertPreTrainedModel): def __init__(self, config: AlbertConfig): pass @can_return_tuple @auto_docstring def forward(self, input_ids: Optional[torch.LongTensor]=None, attention_mask: Optional[torch.FloatTensor]=None, token_type_ids: Optional[torch.L...
6
1
37
4
29
4
6
0.11
1
7
4
0
2
3
2
3
81
9
65
27
44
7
28
14
25
11
2
1
12
494
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertForPreTraining
from typing import Callable, Optional, Union from ...utils.generic import can_return_tuple, check_model_inputs from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss from ...processing_utils import Unpack from torch import nn import torch from ...utils import ModelOutput, TransformersKwargs, auto_docstring, ...
@auto_docstring(custom_intro='\n Albert Model with two heads on top as done during the pretraining: a `masked language modeling` head and a\n `sentence order prediction (classification)` head.\n ') class AlbertForPreTraining(AlbertPreTrainedModel): def __init__(self, config: AlbertConfig): pass ...
9
1
19
3
11
5
2
0.38
1
7
5
0
5
3
5
6
103
19
61
33
40
23
30
19
24
5
2
1
9
495
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertForPreTrainingOutput
from ...utils import ModelOutput, TransformersKwargs, auto_docstring, is_torch_flex_attn_available, logging import torch from typing import Callable, Optional, Union from dataclasses import dataclass @dataclass @auto_docstring(custom_intro='\n Output type of [`AlbertForPreTraining`].\n ') class AlbertForPreTrain...
@dataclass @auto_docstring(custom_intro='\n Output type of [`AlbertForPreTraining`].\n ') class AlbertForPreTrainingOutput(ModelOutput): ''' loss (*optional*, returned when `labels` is provided, `torch.FloatTensor` of shape `(1,)`): Total loss as the sum of the masked language modeling loss and th...
3
1
0
0
0
0
0
3.5
1
0
0
0
0
0
0
0
31
4
6
6
5
21
6
6
5
0
1
0
0
496
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertForQuestionAnswering
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, MaskedLMOutput, MultipleChoiceModelOutput, QuestionAnsweringModelOutput, SequenceClassifierOutput, TokenClassifierOutput from .configuration_albert import AlbertConfig from torch import nn from ...utils import ModelOutput, TransformersKwargs, ...
@auto_docstring class AlbertForQuestionAnswering(AlbertPreTrainedModel): def __init__(self, config: AlbertConfig): pass @can_return_tuple @auto_docstring def forward(self, input_ids: Optional[torch.LongTensor]=None, attention_mask: Optional[torch.FloatTensor]=None, token_type_ids: Optional[torc...
6
0
41
5
30
7
4
0.18
1
7
4
0
2
3
2
3
94
10
71
30
45
13
32
16
29
7
2
2
8
497
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertForSequenceClassification
from .configuration_albert import AlbertConfig from ...utils.generic import can_return_tuple, check_model_inputs from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, MaskedLMOutput, MultipleChoiceModelOutput, QuestionAnsweringModelOutput, SequenceClassifierOutput, TokenClassifierOutput from torc...
@auto_docstring(custom_intro='\n Albert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled\n output) e.g. for GLUE tasks.\n ') class AlbertForSequenceClassification(AlbertPreTrainedModel): def __init__(self, config: AlbertConfig): pass ...
6
1
41
5
33
4
7
0.09
1
6
3
0
2
5
2
3
92
10
75
27
52
7
35
14
32
12
2
3
13
498
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertForTokenClassification
from .configuration_albert import AlbertConfig from ...utils import ModelOutput, TransformersKwargs, auto_docstring, is_torch_flex_attn_available, logging from ...processing_utils import Unpack from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss from ...utils.generic import can_return_tuple, check_model_i...
@auto_docstring class AlbertForTokenClassification(AlbertPreTrainedModel): def __init__(self, config: AlbertConfig): pass @can_return_tuple @auto_docstring def forward(self, input_ids: Optional[torch.LongTensor]=None, attention_mask: Optional[torch.FloatTensor]=None, token_type_ids: Optional[to...
6
1
33
4
27
3
4
0.08
1
5
3
0
2
4
2
3
74
9
60
27
39
5
23
14
20
5
2
1
7
499
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py
transformers.models.albert.modeling_albert.AlbertLayer
from ...activations import ACT2FN from ...utils import ModelOutput, TransformersKwargs, auto_docstring, is_torch_flex_attn_available, logging from ...pytorch_utils import apply_chunking_to_forward, find_pruneable_heads_and_indices, prune_linear_layer import torch from torch import nn from ...processing_utils import Unp...
class AlbertLayer(nn.Module): def __init__(self, config: AlbertConfig): pass def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, **kwargs: Unpack[TransformersKwargs]) -> tuple[torch.Tensor, torch.Tensor]: ...
4
0
12
1
11
0
1
0.03
1
4
1
0
3
9
3
13
39
5
34
23
23
1
22
16
18
1
1
0
3