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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
600 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/processing_aria.py | transformers.models.aria.processing_aria.AriaProcessor | from typing import Optional, Union
from ...image_processing_utils import BatchFeature
from ..auto import AutoTokenizer
from ...tokenization_utils import PreTokenizedInput, TextInput
import numpy as np
from ...processing_utils import MultiModalData, ProcessingKwargs, ProcessorMixin, Unpack
from ...image_utils import Ima... |
class AriaProcessor(ProcessorMixin):
'''
AriaProcessor is a processor for the Aria model which wraps the Aria image preprocessor and the LLama slow tokenizer.
Args:
image_processor (`AriaImageProcessor`, *optional*):
The AriaImageProcessor to use for image preprocessing.
tokeniz... | 6 | 3 | 19 | 2 | 11 | 6 | 2 | 0.63 | 1 | 10 | 3 | 0 | 5 | 1 | 5 | 22 | 118 | 15 | 63 | 34 | 43 | 40 | 37 | 20 | 31 | 5 | 2 | 2 | 11 |
601 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/processing_aria.py | transformers.models.aria.processing_aria.AriaProcessorKwargs | from ...processing_utils import MultiModalData, ProcessingKwargs, ProcessorMixin, Unpack
from ...utils import TensorType
class AriaProcessorKwargs(ProcessingKwargs, total=False):
_defaults = {'text_kwargs': {'padding': False, 'return_mm_token_type_ids': False}, 'images_kwargs': {'max_image_size': 980, 'split_image... |
class AriaProcessorKwargs(ProcessingKwargs, total=False):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 | 11 | 2 | 10 | 0 | 2 | 2 | 1 | 0 | 3 | 0 | 0 |
602 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.configuration_audio_spectrogram_transformer.ASTConfig | from ...configuration_utils import PretrainedConfig
from typing import Any
class ASTConfig(PretrainedConfig):
"""
This is the configuration class to store the configuration of a [`ASTModel`]. It is used to instantiate an AST
model according to the specified arguments, defining the model architecture. Insta... |
class ASTConfig(PretrainedConfig):
'''
This is the configuration class to store the configuration of a [`ASTModel`]. It is used to instantiate an AST
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configu... | 3 | 1 | 19 | 1 | 19 | 0 | 1 | 1.36 | 1 | 3 | 0 | 0 | 2 | 15 | 2 | 2 | 103 | 11 | 39 | 37 | 18 | 53 | 21 | 19 | 18 | 1 | 1 | 0 | 2 |
603 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.feature_extraction_audio_spectrogram_transformer.ASTFeatureExtractor | import numpy as np
from ...utils import TensorType, is_speech_available, is_torch_available, logging
from ...audio_utils import mel_filter_bank, spectrogram, window_function
from ...feature_extraction_utils import BatchFeature
from typing import Optional, Union
from ...feature_extraction_sequence_utils import SequenceF... |
class ASTFeatureExtractor(SequenceFeatureExtractor):
'''
Constructs a Audio Spectrogram Transformer (AST) feature extractor.
This feature extractor inherits from [`~feature_extraction_sequence_utils.SequenceFeatureExtractor`] which contains
most of the main methods. Users should refer to this superclas... | 5 | 3 | 41 | 5 | 29 | 7 | 5 | 0.44 | 1 | 8 | 1 | 0 | 4 | 9 | 4 | 21 | 198 | 27 | 119 | 47 | 92 | 52 | 56 | 24 | 51 | 11 | 3 | 2 | 18 |
604 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTAttention | from typing import Callable, Optional, Union
import torch
from torch import nn
from .configuration_audio_spectrogram_transformer import ASTConfig
from ...pytorch_utils import find_pruneable_heads_and_indices, prune_linear_layer
class ASTAttention(nn.Module):
def __init__(self, config: ASTConfig):
super().... |
class ASTAttention(nn.Module):
def __init__(self, config: ASTConfig):
pass
def prune_heads(self, heads: set[int]):
pass
def forward(self, hidden_states: torch.Tensor, head_mask: Optional[torch.Tensor]=None) -> torch.Tensor:
pass | 4 | 0 | 11 | 1 | 9 | 1 | 1 | 0.1 | 1 | 8 | 3 | 1 | 3 | 3 | 3 | 13 | 37 | 6 | 29 | 16 | 20 | 3 | 22 | 11 | 18 | 2 | 1 | 1 | 4 |
605 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTEmbeddings | from .configuration_audio_spectrogram_transformer import ASTConfig
import torch
from torch import nn
class ASTEmbeddings(nn.Module):
"""
Construct the CLS token, position and patch embeddings.
"""
def __init__(self, config: ASTConfig) -> None:
super().__init__()
self.cls_token = nn.Par... |
class ASTEmbeddings(nn.Module):
'''
Construct the CLS token, position and patch embeddings.
'''
def __init__(self, config: ASTConfig) -> None:
pass
def get_shape(self, config):
pass
def forward(self, input_values: torch.Tensor) -> torch.Tensor:
pass | 4 | 1 | 10 | 2 | 8 | 1 | 1 | 0.21 | 1 | 4 | 2 | 0 | 3 | 6 | 3 | 13 | 37 | 8 | 24 | 18 | 20 | 5 | 24 | 18 | 20 | 1 | 1 | 0 | 3 |
606 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTEncoder | from .configuration_audio_spectrogram_transformer import ASTConfig
import torch
from typing import Callable, Optional, Union
from torch import nn
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, SequenceClassifierOutput
class ASTEncoder(nn.Module):
def __init__(self, config: ASTConfig)... |
class ASTEncoder(nn.Module):
def __init__(self, config: ASTConfig):
pass
def forward(self, hidden_states: torch.Tensor, head_mask: Optional[torch.Tensor]=None) -> BaseModelOutput:
pass | 3 | 0 | 24 | 4 | 20 | 0 | 6 | 0 | 1 | 9 | 3 | 0 | 2 | 3 | 2 | 12 | 49 | 8 | 41 | 18 | 31 | 0 | 24 | 11 | 21 | 10 | 1 | 2 | 11 |
607 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTForAudioClassification | from ...processing_utils import Unpack
from .configuration_audio_spectrogram_transformer import ASTConfig
import torch
from ...utils.generic import can_return_tuple, check_model_inputs
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, SequenceClassifierOutput
from ...utils import Transformers... | @auto_docstring(custom_intro='\n Audio Spectrogram Transformer model with an audio classification head on top (a linear layer on top of the pooled\n output) e.g. for datasets like AudioSet, Speech Commands v2.\n ')
class ASTForAudioClassification(ASTPreTrainedModel):
def __init__(self, config: ASTConfig) ... | 6 | 1 | 36 | 5 | 28 | 4 | 7 | 0.12 | 1 | 9 | 4 | 0 | 2 | 3 | 2 | 3 | 83 | 10 | 65 | 21 | 45 | 8 | 32 | 12 | 29 | 12 | 2 | 3 | 13 |
608 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTIntermediate | import torch
from torch import nn
from ...activations import ACT2FN
from .configuration_audio_spectrogram_transformer import ASTConfig
class ASTIntermediate(nn.Module):
def __init__(self, config: ASTConfig):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.intermediate_size)
... |
class ASTIntermediate(nn.Module):
def __init__(self, config: ASTConfig):
pass
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 6 | 1 | 6 | 0 | 2 | 0 | 1 | 4 | 1 | 0 | 2 | 2 | 2 | 12 | 14 | 2 | 12 | 5 | 9 | 0 | 11 | 5 | 8 | 2 | 1 | 1 | 3 |
609 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTLayer | from typing import Callable, Optional, Union
import torch
from torch import nn
from .configuration_audio_spectrogram_transformer import ASTConfig
from ...modeling_layers import GradientCheckpointingLayer
class ASTLayer(GradientCheckpointingLayer):
"""This corresponds to the Block class in the timm implementation."... |
class ASTLayer(GradientCheckpointingLayer):
'''This corresponds to the Block class in the timm implementation.'''
def __init__(self, config: ASTConfig):
pass
def forward(self, hidden_states: torch.Tensor, head_mask: Optional[torch.Tensor]=None) -> torch.Tensor:
pass | 3 | 1 | 18 | 3 | 14 | 3 | 1 | 0.21 | 1 | 6 | 3 | 0 | 2 | 7 | 2 | 12 | 40 | 7 | 29 | 19 | 21 | 6 | 20 | 14 | 17 | 1 | 1 | 0 | 2 |
610 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTMLPHead | from torch import nn
from .configuration_audio_spectrogram_transformer import ASTConfig
class ASTMLPHead(nn.Module):
def __init__(self, config: ASTConfig):
super().__init__()
self.layernorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
self.dense = nn.Linear(config.hidden_s... |
class ASTMLPHead(nn.Module):
def __init__(self, config: ASTConfig):
pass
def forward(self, hidden_state):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 2 | 1 | 0 | 2 | 2 | 2 | 12 | 10 | 1 | 9 | 5 | 6 | 0 | 9 | 5 | 6 | 2 | 1 | 0 | 3 |
611 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTModel | import torch
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, SequenceClassifierOutput
from .configuration_audio_spectrogram_transformer import ASTConfig
from torch import nn
from ...utils import TransformersKwargs, auto_docstring, logging
from ...processing_utils import Unpack
from ...utils... | @auto_docstring
class ASTModel(ASTPreTrainedModel):
def __init__(self, config: ASTConfig) -> None:
pass
def get_input_embeddings(self) -> ASTPatchEmbeddings:
pass
def _prune_heads(self, heads_to_prune: dict[int, list[int]]) -> None:
'''
Prunes heads of the model. heads_to_... | 8 | 2 | 17 | 3 | 12 | 3 | 3 | 0.18 | 1 | 10 | 5 | 0 | 4 | 4 | 4 | 5 | 79 | 13 | 56 | 22 | 36 | 10 | 28 | 14 | 23 | 6 | 2 | 1 | 10 |
612 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTOutput | from .configuration_audio_spectrogram_transformer import ASTConfig
from torch import nn
import torch
class ASTOutput(nn.Module):
def __init__(self, config: ASTConfig):
super().__init__()
self.dense = nn.Linear(config.intermediate_size, config.hidden_size)
self.dropout = nn.Dropout(config.h... |
class ASTOutput(nn.Module):
def __init__(self, config: ASTConfig):
pass
def forward(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 6 | 1 | 5 | 0 | 1 | 0 | 1 | 3 | 1 | 0 | 2 | 2 | 2 | 12 | 13 | 3 | 10 | 5 | 7 | 0 | 10 | 5 | 7 | 1 | 1 | 0 | 2 |
613 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTPatchEmbeddings | from .configuration_audio_spectrogram_transformer import ASTConfig
import torch
from torch import nn
class ASTPatchEmbeddings(nn.Module):
"""
This class turns `input_values` into the initial `hidden_states` (patch embeddings) of shape `(batch_size,
seq_length, hidden_size)` to be consumed by a Transformer.... |
class ASTPatchEmbeddings(nn.Module):
'''
This class turns `input_values` into the initial `hidden_states` (patch embeddings) of shape `(batch_size,
seq_length, hidden_size)` to be consumed by a Transformer.
'''
def __init__(self, config: ASTConfig):
pass
def forward(self, input_values... | 3 | 1 | 8 | 1 | 7 | 0 | 1 | 0.29 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 12 | 22 | 4 | 14 | 8 | 11 | 4 | 12 | 8 | 9 | 1 | 1 | 0 | 2 |
614 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTPreTrainedModel | from typing import Callable, Optional, Union
from .configuration_audio_spectrogram_transformer import ASTConfig
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
from ...utils import TransformersKwargs, auto_docstring, logging
import torch
from torch import nn
@auto_docstring
class ASTPreTrainedMo... | @auto_docstring
class ASTPreTrainedModel(PreTrainedModel):
def _init_weights(self, module: Union[nn.Linear, nn.Conv2d, nn.LayerNorm]) -> None:
'''Initialize the weights'''
pass | 3 | 1 | 13 | 0 | 10 | 3 | 4 | 0.5 | 1 | 0 | 0 | 2 | 1 | 0 | 1 | 1 | 26 | 2 | 16 | 7 | 14 | 8 | 13 | 7 | 11 | 4 | 1 | 2 | 4 |
615 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTSelfAttention | from .configuration_audio_spectrogram_transformer import ASTConfig
from torch import nn
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
import torch
from typing import Callable, Optional, Union
class ASTSelfAttention(nn.Module):
def __init__(self, config: ASTConfig):
super().__init_... |
class ASTSelfAttention(nn.Module):
def __init__(self, config: ASTConfig):
pass
def forward(self, hidden_states: torch.Tensor, head_mask: Optional[torch.Tensor]=None) -> tuple[torch.Tensor, torch.Tensor]:
pass | 3 | 0 | 18 | 4 | 12 | 2 | 2 | 0.13 | 1 | 6 | 1 | 1 | 3 | 7 | 3 | 13 | 58 | 15 | 38 | 23 | 32 | 5 | 33 | 21 | 29 | 3 | 1 | 1 | 6 |
616 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py | transformers.models.audio_spectrogram_transformer.modeling_audio_spectrogram_transformer.ASTSelfOutput | from torch import nn
from .configuration_audio_spectrogram_transformer import ASTConfig
import torch
class ASTSelfOutput(nn.Module):
"""
The residual connection is defined in ASTLayer instead of here (as is the case with other models), due to the
layernorm applied before each block.
"""
def __init... |
class ASTSelfOutput(nn.Module):
'''
The residual connection is defined in ASTLayer instead of here (as is the case with other models), due to the
layernorm applied before each block.
'''
def __init__(self, config: ASTConfig):
pass
def forward(self, hidden_states: torch.Tensor, input_t... | 3 | 1 | 5 | 1 | 4 | 0 | 1 | 0.44 | 1 | 3 | 1 | 0 | 2 | 2 | 2 | 12 | 16 | 3 | 9 | 5 | 6 | 4 | 9 | 5 | 6 | 1 | 1 | 0 | 2 |
617 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/auto_factory.py | transformers.models.auto.auto_factory._BaseAutoBackboneClass | from ...utils import CONFIG_NAME, cached_file, copy_func, extract_commit_hash, find_adapter_config_file, is_peft_available, is_torch_available, logging, requires_backends
class _BaseAutoBackboneClass(_BaseAutoModelClass):
_model_mapping = None
@classmethod
def _load_timm_backbone_from_pretrained(cls, pret... |
class _BaseAutoBackboneClass(_BaseAutoModelClass):
@classmethod
def _load_timm_backbone_from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
pass
@classmethod
def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
pass | 5 | 0 | 15 | 3 | 13 | 0 | 3 | 0.03 | 1 | 3 | 1 | 1 | 0 | 0 | 2 | 6 | 37 | 7 | 29 | 13 | 23 | 1 | 21 | 11 | 17 | 3 | 1 | 1 | 5 |
618 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/auto_factory.py | transformers.models.auto.auto_factory._BaseAutoModelClass | import os
from typing import Any, TypeVar, Union
from ...utils import CONFIG_NAME, cached_file, copy_func, extract_commit_hash, find_adapter_config_file, is_peft_available, is_torch_available, logging, requires_backends
from .configuration_auto import AutoConfig, model_type_to_module_name, replace_list_option_in_docstr... |
class _BaseAutoModelClass:
def __init__(self, *args, **kwargs) -> None:
pass
@classmethod
def from_config(cls, config, **kwargs):
pass
@classmethod
def _prepare_config_for_auto_class(cls, config: PretrainedConfig) -> PretrainedConfig:
'''Additional autoclass-specific config... | 10 | 2 | 43 | 4 | 36 | 4 | 6 | 0.1 | 0 | 4 | 1 | 74 | 1 | 0 | 4 | 4 | 183 | 20 | 148 | 35 | 140 | 15 | 85 | 31 | 80 | 17 | 0 | 3 | 24 |
619 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/auto_factory.py | transformers.models.auto.auto_factory._LazyAutoMapping | from .configuration_auto import AutoConfig, model_type_to_module_name, replace_list_option_in_docstrings
from collections.abc import Iterator
import importlib
from typing import Any, TypeVar, Union
from collections import OrderedDict
from ...configuration_utils import PretrainedConfig
class _LazyAutoMapping(OrderedDic... |
class _LazyAutoMapping(OrderedDict[type[PretrainedConfig], _LazyAutoMappingValue]):
'''
" A mapping config to object (model or tokenizer for instance) that will load keys and values when it is accessed.
Args:
- config_mapping: The map model type to config class
- model_mapping: The map mode... | 13 | 2 | 7 | 0 | 6 | 0 | 2 | 0.13 | 1 | 5 | 0 | 0 | 12 | 5 | 12 | 62 | 100 | 15 | 75 | 29 | 62 | 10 | 60 | 29 | 47 | 5 | 3 | 2 | 22 |
620 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/configuration_auto.py | transformers.models.auto.configuration_auto.AutoConfig | from ...configuration_utils import PretrainedConfig
from ...utils import CONFIG_NAME, logging
import warnings
import os
from typing import Any, TypeVar, Union
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
class AutoConfig:
"""
This is a generic configuration class... |
class AutoConfig:
'''
This is a generic configuration class that will be instantiated as one of the configuration classes of the library
when created with the [`~AutoConfig.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws an error).
'''
... | 9 | 3 | 42 | 5 | 19 | 19 | 4 | 1.01 | 0 | 4 | 0 | 0 | 1 | 0 | 4 | 4 | 183 | 24 | 79 | 18 | 70 | 80 | 42 | 15 | 37 | 9 | 0 | 3 | 14 |
621 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/configuration_auto.py | transformers.models.auto.configuration_auto._LazyConfigMapping | from collections.abc import Callable, Iterator, KeysView, ValuesView
import importlib
from collections import OrderedDict
from ...configuration_utils import PretrainedConfig
class _LazyConfigMapping(OrderedDict[str, type[PretrainedConfig]]):
"""
A dictionary that lazily load its values when they are requested.... |
class _LazyConfigMapping(OrderedDict[str, type[PretrainedConfig]]):
'''
A dictionary that lazily load its values when they are requested.
'''
def __init__(self, mapping) -> None:
pass
def __getitem__(self, key: str) -> type[PretrainedConfig]:
pass
def keys(self) -> list[str]:... | 9 | 2 | 5 | 0 | 4 | 1 | 2 | 0.25 | 1 | 3 | 0 | 0 | 8 | 3 | 8 | 58 | 49 | 9 | 32 | 15 | 23 | 8 | 32 | 15 | 23 | 5 | 3 | 1 | 13 |
622 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/configuration_auto.py | transformers.models.auto.configuration_auto._LazyLoadAllMappings | from collections import OrderedDict
from collections.abc import Callable, Iterator, KeysView, ValuesView
import importlib
class _LazyLoadAllMappings(OrderedDict[str, str]):
"""
A mapping that will load all pairs of key values at the first access (either by indexing, requestions keys, values,
etc.)
Arg... |
class _LazyLoadAllMappings(OrderedDict[str, str]):
'''
A mapping that will load all pairs of key values at the first access (either by indexing, requestions keys, values,
etc.)
Args:
mapping: The mapping to load.
'''
def __init__(self, mapping):
pass
def _initialize(self):... | 9 | 1 | 4 | 0 | 4 | 0 | 1 | 0.19 | 1 | 0 | 0 | 0 | 8 | 3 | 8 | 58 | 49 | 11 | 32 | 16 | 23 | 6 | 32 | 16 | 23 | 3 | 3 | 1 | 10 |
623 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/feature_extraction_auto.py | transformers.models.auto.feature_extraction_auto.AutoFeatureExtractor | from .configuration_auto import CONFIG_MAPPING_NAMES, AutoConfig, model_type_to_module_name, replace_list_option_in_docstrings
import warnings
from ...utils import CONFIG_NAME, FEATURE_EXTRACTOR_NAME, cached_file, logging
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ... |
class AutoFeatureExtractor:
'''
This is a generic feature extractor class that will be instantiated as one of the feature extractor classes of the
library when created with the [`AutoFeatureExtractor.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws a... | 7 | 3 | 49 | 6 | 20 | 23 | 5 | 1.16 | 0 | 5 | 2 | 0 | 1 | 0 | 3 | 3 | 161 | 23 | 64 | 14 | 57 | 74 | 41 | 12 | 37 | 12 | 0 | 2 | 14 |
624 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/image_processing_auto.py | transformers.models.auto.image_processing_auto.AutoImageProcessor | from ...utils.import_utils import requires
from .configuration_auto import CONFIG_MAPPING_NAMES, AutoConfig, model_type_to_module_name, replace_list_option_in_docstrings
from ...utils import CONFIG_NAME, IMAGE_PROCESSOR_NAME, cached_file, is_timm_config_dict, is_timm_local_checkpoint, is_torchvision_available, is_visio... | @requires(backends=('vision',))
class AutoImageProcessor:
'''
This is a generic image processor class that will be instantiated as one of the image processor classes of the
library when created with the [`AutoImageProcessor.from_pretrained`] class method.
This class cannot be instantiated directly using... | 8 | 3 | 100 | 11 | 59 | 31 | 14 | 0.54 | 0 | 9 | 4 | 0 | 1 | 0 | 3 | 3 | 314 | 36 | 181 | 31 | 168 | 97 | 114 | 22 | 110 | 32 | 0 | 4 | 43 |
625 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoBackbone | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoBackbone(_BaseAutoBackboneClass):
_model_mapping = MODEL_FOR_BACKBONE_MAPPING |
class AutoBackbone(_BaseAutoBackboneClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 2 | 0 | 0 |
626 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModel | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModel(_BaseAutoModelClass):
_model_mapping = MODEL_MAPPING |
class AutoModel(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
627 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForAudioClassification | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForAudioClassification(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING |
class AutoModelForAudioClassification(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
628 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForAudioFrameClassification | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForAudioFrameClassification(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING |
class AutoModelForAudioFrameClassification(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
629 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForAudioXVector | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForAudioXVector(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_AUDIO_XVECTOR_MAPPING |
class AutoModelForAudioXVector(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
630 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForCTC | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForCTC(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_CTC_MAPPING |
class AutoModelForCTC(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
631 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForCausalLM | import os
from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
from typing import TYPE_CHECKING, Union
class AutoModelForCausalLM(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_CAUSAL_LM_MAPPING
@classmethod
def from_pretrained(cls: type['AutoModelFo... |
class AutoModelForCausalLM(_BaseAutoModelClass):
@classmethod
def from_pretrained(cls: type['AutoModelForCausalLM'], pretrained_model_name_or_path: Union[str, os.PathLike[str]], *model_args, **kwargs) -> '_BaseModelWithGenerate':
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
632 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForDepthEstimation | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForDepthEstimation(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_DEPTH_ESTIMATION_MAPPING |
class AutoModelForDepthEstimation(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
633 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForDocumentQuestionAnswering | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForDocumentQuestionAnswering(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING |
class AutoModelForDocumentQuestionAnswering(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
634 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForImageClassification | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForImageClassification(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING |
class AutoModelForImageClassification(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
635 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForImageSegmentation | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForImageSegmentation(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_IMAGE_SEGMENTATION_MAPPING |
class AutoModelForImageSegmentation(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
636 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForImageTextToText | from typing import TYPE_CHECKING, Union
from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
import os
class AutoModelForImageTextToText(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING
@classmethod
def from_pretrained(cls: t... |
class AutoModelForImageTextToText(_BaseAutoModelClass):
@classmethod
def from_pretrained(cls: type['AutoModelForImageTextToText'], pretrained_model_name_or_path: Union[str, os.PathLike[str]], *model_args, **kwargs) -> '_BaseModelWithGenerate':
pass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
637 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForImageToImage | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForImageToImage(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_IMAGE_TO_IMAGE_MAPPING |
class AutoModelForImageToImage(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
638 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForInstanceSegmentation | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForInstanceSegmentation(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING |
class AutoModelForInstanceSegmentation(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
639 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForKeypointDetection | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForKeypointDetection(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_KEYPOINT_DETECTION_MAPPING |
class AutoModelForKeypointDetection(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
640 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForMaskGeneration | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForMaskGeneration(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_MASK_GENERATION_MAPPING |
class AutoModelForMaskGeneration(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
641 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForMaskedImageModeling | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForMaskedImageModeling(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING |
class AutoModelForMaskedImageModeling(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
642 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForMaskedLM | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForMaskedLM(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_MASKED_LM_MAPPING |
class AutoModelForMaskedLM(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
643 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForMultipleChoice | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForMultipleChoice(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_MULTIPLE_CHOICE_MAPPING |
class AutoModelForMultipleChoice(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
644 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForNextSentencePrediction | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForNextSentencePrediction(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING |
class AutoModelForNextSentencePrediction(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
645 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForObjectDetection | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForObjectDetection(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_OBJECT_DETECTION_MAPPING |
class AutoModelForObjectDetection(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
646 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForPreTraining | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForPreTraining(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_PRETRAINING_MAPPING |
class AutoModelForPreTraining(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
647 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForQuestionAnswering | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForQuestionAnswering(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_QUESTION_ANSWERING_MAPPING |
class AutoModelForQuestionAnswering(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
648 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForSemanticSegmentation | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForSemanticSegmentation(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING |
class AutoModelForSemanticSegmentation(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
649 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForSeq2SeqLM | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForSeq2SeqLM(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING |
class AutoModelForSeq2SeqLM(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
650 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForSequenceClassification | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForSequenceClassification(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING |
class AutoModelForSequenceClassification(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
651 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForSpeechSeq2Seq | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForSpeechSeq2Seq(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING |
class AutoModelForSpeechSeq2Seq(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
652 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForTableQuestionAnswering | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForTableQuestionAnswering(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING |
class AutoModelForTableQuestionAnswering(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
653 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForTextEncoding | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForTextEncoding(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_TEXT_ENCODING_MAPPING |
class AutoModelForTextEncoding(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
654 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForTextToSpectrogram | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForTextToSpectrogram(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING |
class AutoModelForTextToSpectrogram(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
655 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForTextToWaveform | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForTextToWaveform(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING |
class AutoModelForTextToWaveform(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
656 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForTokenClassification | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForTokenClassification(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING |
class AutoModelForTokenClassification(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
657 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForUniversalSegmentation | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForUniversalSegmentation(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING |
class AutoModelForUniversalSegmentation(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
658 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForVideoClassification | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForVideoClassification(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING |
class AutoModelForVideoClassification(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
659 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForVision2Seq | import warnings
class AutoModelForVision2Seq(_AutoModelForVision2Seq):
@classmethod
def from_config(cls, config, **kwargs):
warnings.warn('The class `AutoModelForVision2Seq` is deprecated and will be removed in v5.0. Please use `AutoModelForImageTextToText` instead.', FutureWarning)
return sup... |
class AutoModelForVision2Seq(_AutoModelForVision2Seq):
@classmethod
def from_config(cls, config, **kwargs):
pass
@classmethod
def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
pass | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
660 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForVisualQuestionAnswering | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForVisualQuestionAnswering(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING |
class AutoModelForVisualQuestionAnswering(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
661 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForZeroShotImageClassification | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForZeroShotImageClassification(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING |
class AutoModelForZeroShotImageClassification(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
662 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelForZeroShotObjectDetection | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class AutoModelForZeroShotObjectDetection(_BaseAutoModelClass):
_model_mapping = MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING |
class AutoModelForZeroShotObjectDetection(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
663 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto.AutoModelWithLMHead | import warnings
class AutoModelWithLMHead(_AutoModelWithLMHead):
@classmethod
def from_config(cls, config, **kwargs):
warnings.warn('The class `AutoModelWithLMHead` is deprecated and will be removed in a future version. Please use `AutoModelForCausalLM` for causal language models, `AutoModelForMaskedL... |
class AutoModelWithLMHead(_AutoModelWithLMHead):
@classmethod
def from_config(cls, config, **kwargs):
pass
@classmethod
def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
pass | 5 | 0 | 8 | 0 | 8 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 2 | 6 | 20 | 1 | 19 | 5 | 14 | 0 | 7 | 3 | 4 | 1 | 2 | 0 | 2 |
664 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/modeling_auto.py | transformers.models.auto.modeling_auto._AutoModelWithLMHead | from .auto_factory import _BaseAutoBackboneClass, _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
class _AutoModelWithLMHead(_BaseAutoModelClass):
_model_mapping = MODEL_WITH_LM_HEAD_MAPPING |
class _AutoModelWithLMHead(_BaseAutoModelClass):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 4 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
665 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/processing_auto.py | transformers.models.auto.processing_auto.AutoProcessor | import warnings
import inspect
from .configuration_auto import CONFIG_MAPPING_NAMES, AutoConfig, model_type_to_module_name, replace_list_option_in_docstrings
from ...video_processing_utils import BaseVideoProcessor
from ...image_processing_utils import ImageProcessingMixin
from ...configuration_utils import PretrainedC... |
class AutoProcessor:
'''
This is a generic processor class that will be instantiated as one of the processor classes of the library when
created with the [`AutoProcessor.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws an error).
'''
def... | 7 | 3 | 72 | 9 | 38 | 24 | 9 | 0.66 | 0 | 11 | 7 | 0 | 1 | 0 | 3 | 3 | 228 | 32 | 118 | 19 | 111 | 78 | 75 | 16 | 71 | 24 | 0 | 3 | 26 |
666 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/auto/tokenization_auto.py | transformers.models.auto.tokenization_auto.AutoTokenizer | from ...tokenization_utils import PreTrainedTokenizer
from ..encoder_decoder import EncoderDecoderConfig
import warnings
from ...configuration_utils import PretrainedConfig
from .configuration_auto import CONFIG_MAPPING_NAMES, AutoConfig, config_class_to_model_type, model_type_to_module_name, replace_list_option_in_doc... |
class AutoTokenizer:
'''
This is a generic tokenizer class that will be instantiated as one of the tokenizer classes of the library when
created with the [`AutoTokenizer.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws an error).
'''
def... | 7 | 3 | 89 | 10 | 52 | 27 | 12 | 0.55 | 0 | 9 | 4 | 0 | 2 | 0 | 3 | 3 | 280 | 35 | 159 | 27 | 153 | 87 | 101 | 26 | 97 | 28 | 0 | 3 | 37 |
667 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/configuration_autoformer.py | transformers.models.autoformer.configuration_autoformer.AutoformerConfig | from ...configuration_utils import PretrainedConfig
from typing import Optional
class AutoformerConfig(PretrainedConfig):
"""
This is the configuration class to store the configuration of an [`AutoformerModel`]. It is used to instantiate an
Autoformer model according to the specified arguments, defining th... |
class AutoformerConfig(PretrainedConfig):
'''
This is the configuration class to store the configuration of an [`AutoformerModel`]. It is used to instantiate an
Autoformer model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will y... | 4 | 1 | 52 | 3 | 47 | 3 | 4 | 0.99 | 1 | 6 | 0 | 0 | 2 | 33 | 2 | 2 | 217 | 17 | 101 | 75 | 61 | 100 | 48 | 38 | 45 | 6 | 1 | 2 | 7 |
668 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoFormerDecoderOutput | from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
from typing import Optional, Union
from ...utils import auto_docstring, is_torch_flex_attn_available, logging
from ...modeling_outputs import BaseModelOutput, ModelOutput, SampleTSPredictionOutput, Seq2SeqTSPredictionOutput
from dataclasses import data... | @dataclass
@auto_docstring(custom_intro="\n Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding).\n ")
class AutoFormerDecoderOutput(ModelOutput):
'''
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
... | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 4.57 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 7 | 7 | 7 | 6 | 32 | 7 | 7 | 6 | 0 | 1 | 0 | 0 |
669 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerAttention | from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
from typing import Optional, Union
from torch import nn
import math
import torch
from ...utils.deprecation import deprecate_kwarg
class AutoformerAttention(nn.Module):
"""
AutoCorrelation Mechanism with the following two phases:
(1) pe... |
class AutoformerAttention(nn.Module):
'''
AutoCorrelation Mechanism with the following two phases:
(1) period-based dependencies discovery (2) time delay aggregation
This block replace the canonical self-attention mechanism.
'''
def __init__(self, embed_dim: int, num_heads: int, dropout: O... | 4 | 2 | 71 | 9 | 51 | 12 | 7 | 0.27 | 1 | 7 | 0 | 0 | 3 | 11 | 3 | 13 | 221 | 30 | 153 | 60 | 133 | 42 | 99 | 44 | 95 | 17 | 1 | 2 | 20 |
670 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerDecoder | from .configuration_autoformer import AutoformerConfig
from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
from typing import Optional, Union
from torch import nn
import torch
from ...modeling_attn_mask_utils import _prepare_4d_attention_mask, _prepare_4d_attention_mask_for_sdpa
class AutoformerDecoder... |
class AutoformerDecoder(AutoformerPreTrainedModel):
'''
Transformer decoder consisting of `config.decoder_layers` layers. Each layer is a [`AutoformerDecoderLayer`]
Args:
config: AutoformerConfig
'''
def __init__(self, config: AutoformerConfig):
pass
def forward(self, trend: O... | 3 | 2 | 106 | 14 | 62 | 31 | 17 | 0.53 | 1 | 13 | 5 | 0 | 2 | 8 | 2 | 3 | 221 | 30 | 125 | 39 | 108 | 66 | 63 | 25 | 60 | 31 | 2 | 3 | 33 |
671 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerDecoderLayer | from .configuration_autoformer import AutoformerConfig
from ...utils.deprecation import deprecate_kwarg
from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
from typing import Optional, Union
from ...activations import ACT2FN
from ...modeling_layers import GradientCheckpointingLayer
from torch import nn
... |
class AutoformerDecoderLayer(GradientCheckpointingLayer):
def __init__(self, config: AutoformerConfig, layer_idx=None):
pass
@deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58')
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor]=None, en... | 4 | 1 | 72 | 7 | 50 | 16 | 4 | 0.31 | 1 | 7 | 4 | 0 | 2 | 15 | 2 | 12 | 145 | 14 | 100 | 40 | 86 | 31 | 55 | 29 | 52 | 7 | 1 | 1 | 8 |
672 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerEncoder | from torch import nn
import torch
from .configuration_autoformer import AutoformerConfig
from typing import Optional, Union
from ...modeling_outputs import BaseModelOutput, ModelOutput, SampleTSPredictionOutput, Seq2SeqTSPredictionOutput
class AutoformerEncoder(AutoformerPreTrainedModel):
"""
Transformer encod... |
class AutoformerEncoder(AutoformerPreTrainedModel):
'''
Transformer encoder consisting of *config.encoder_layers* self attention layers. Each layer is a
[`AutoformerEncoderLayer`].
Args:
config: AutoformerConfig
'''
def __init__(self, config: AutoformerConfig):
pass
def fo... | 3 | 2 | 63 | 9 | 39 | 15 | 11 | 0.46 | 1 | 12 | 5 | 0 | 2 | 7 | 2 | 3 | 135 | 21 | 79 | 26 | 68 | 36 | 49 | 18 | 46 | 20 | 2 | 3 | 22 |
673 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerEncoderLayer | from .configuration_autoformer import AutoformerConfig
from typing import Optional, Union
from ...activations import ACT2FN
from ...modeling_layers import GradientCheckpointingLayer
from torch import nn
import torch
class AutoformerEncoderLayer(GradientCheckpointingLayer):
def __init__(self, config: AutoformerCon... |
class AutoformerEncoderLayer(GradientCheckpointingLayer):
def __init__(self, config: AutoformerConfig):
pass
def forward(self, hidden_states: torch.FloatTensor, attention_mask: torch.FloatTensor, layer_head_mask: torch.FloatTensor, output_attentions: Optional[bool]=False) -> tuple[torch.FloatTensor, ... | 3 | 1 | 35 | 3 | 27 | 6 | 2 | 0.22 | 1 | 6 | 4 | 0 | 2 | 11 | 2 | 12 | 72 | 6 | 54 | 24 | 45 | 12 | 36 | 18 | 33 | 3 | 1 | 1 | 4 |
674 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerFeatureEmbedder | import torch
from torch import nn
class AutoformerFeatureEmbedder(nn.Module):
"""
Embed a sequence of categorical features.
Args:
cardinalities (`list[int]`):
List of cardinalities of the categorical features.
embedding_dims (`list[int]`):
List of embedding dimensio... |
class AutoformerFeatureEmbedder(nn.Module):
'''
Embed a sequence of categorical features.
Args:
cardinalities (`list[int]`):
List of cardinalities of the categorical features.
embedding_dims (`list[int]`):
List of embedding dimensions of the categorical features.
... | 3 | 1 | 10 | 1 | 8 | 1 | 2 | 0.59 | 1 | 4 | 0 | 0 | 2 | 2 | 2 | 12 | 32 | 5 | 17 | 6 | 14 | 10 | 10 | 6 | 7 | 2 | 1 | 1 | 3 |
675 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerForPrediction | from .configuration_autoformer import AutoformerConfig
from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
from typing import Optional, Union
from ...utils import auto_docstring, is_torch_flex_attn_available, logging
from ...modeling_outputs import BaseModelOutput, ModelOutput, SampleTSPredictionOutput,... | @auto_docstring
class AutoformerForPrediction(AutoformerPreTrainedModel):
def __init__(self, config: AutoformerConfig):
pass
def output_params(self, decoder_output):
pass
def get_encoder(self):
pass
def get_decoder(self):
pass
@torch.jit.ignore
def output_dist... | 12 | 2 | 54 | 8 | 26 | 20 | 3 | 0.77 | 1 | 12 | 7 | 0 | 7 | 5 | 7 | 8 | 390 | 63 | 185 | 83 | 143 | 142 | 78 | 50 | 70 | 9 | 2 | 2 | 20 |
676 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerLayernorm | from .configuration_autoformer import AutoformerConfig
import torch
from torch import nn
class AutoformerLayernorm(nn.Module):
"""
Special designed layer normalization for the seasonal part, calculated as: AutoformerLayernorm(x) = nn.LayerNorm(x)
- torch.mean(nn.LayerNorm(x))
"""
def __init__(self... |
class AutoformerLayernorm(nn.Module):
'''
Special designed layer normalization for the seasonal part, calculated as: AutoformerLayernorm(x) = nn.LayerNorm(x)
- torch.mean(nn.LayerNorm(x))
'''
def __init__(self, config: AutoformerConfig):
pass
def forward(self, x):
pass | 3 | 1 | 4 | 0 | 4 | 0 | 1 | 0.5 | 1 | 2 | 1 | 0 | 2 | 1 | 2 | 12 | 14 | 2 | 8 | 6 | 5 | 4 | 8 | 6 | 5 | 1 | 1 | 0 | 2 |
677 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerMeanScaler | import torch
from torch import nn
from .configuration_autoformer import AutoformerConfig
class AutoformerMeanScaler(nn.Module):
"""
Computes a scaling factor as the weighted average absolute value along the first dimension, and scales the data
accordingly.
"""
def __init__(self, config: Autoformer... |
class AutoformerMeanScaler(nn.Module):
'''
Computes a scaling factor as the weighted average absolute value along the first dimension, and scales the data
accordingly.
'''
def __init__(self, config: AutoformerConfig):
pass
def forward(self, data: torch.Tensor, observed_indicator: torc... | 3 | 2 | 23 | 3 | 12 | 8 | 4 | 0.76 | 1 | 3 | 1 | 0 | 2 | 4 | 2 | 12 | 52 | 8 | 25 | 16 | 20 | 19 | 22 | 14 | 19 | 5 | 1 | 1 | 8 |
678 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerModel | from .configuration_autoformer import AutoformerConfig
from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
from typing import Optional, Union
from ...utils import auto_docstring, is_torch_flex_attn_available, logging
from ...modeling_outputs import BaseModelOutput, ModelOutput, SampleTSPredictionOutput,... | @auto_docstring
class AutoformerModel(AutoformerPreTrainedModel):
def __init__(self, config: AutoformerConfig):
pass
@property
def _past_length(self) -> int:
pass
def get_lagged_subsequences(self, sequence: torch.Tensor, subsequences_length: int, shift: int=0) -> torch.Tensor:
... | 10 | 3 | 46 | 5 | 29 | 12 | 5 | 0.39 | 1 | 16 | 11 | 0 | 7 | 5 | 7 | 8 | 330 | 39 | 210 | 74 | 169 | 81 | 76 | 42 | 68 | 11 | 2 | 1 | 32 |
679 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerModelOutput | from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache
from typing import Optional, Union
from ...utils import auto_docstring, is_torch_flex_attn_available, logging
from ...modeling_outputs import BaseModelOutput, ModelOutput, SampleTSPredictionOutput, Seq2SeqTSPredictionOutput
from dataclasses import data... | @dataclass
@auto_docstring(custom_intro='\n Autoformer model output that contains the additional trend output.\n ')
class AutoformerModelOutput(ModelOutput):
'''
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence of hidden-states at the output o... | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 3.77 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 71 | 9 | 13 | 13 | 12 | 49 | 13 | 13 | 12 | 0 | 1 | 0 | 0 |
680 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerNOPScaler | import torch
from typing import Optional, Union
from .configuration_autoformer import AutoformerConfig
from torch import nn
class AutoformerNOPScaler(nn.Module):
"""
Assigns a scaling factor equal to 1 along the first dimension, and therefore applies no scaling to the input data.
"""
def __init__(self... |
class AutoformerNOPScaler(nn.Module):
'''
Assigns a scaling factor equal to 1 along the first dimension, and therefore applies no scaling to the input data.
'''
def __init__(self, config: AutoformerConfig):
pass
def forward(self, data: torch.Tensor, observed_indicator: Optional[torch.Tens... | 3 | 2 | 10 | 0 | 5 | 5 | 2 | 1.09 | 1 | 3 | 1 | 0 | 2 | 2 | 2 | 12 | 25 | 2 | 11 | 9 | 6 | 12 | 9 | 7 | 6 | 3 | 1 | 0 | 4 |
681 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerPreTrainedModel | from .configuration_autoformer import AutoformerConfig
from typing import Optional, Union
from ...utils import auto_docstring, is_torch_flex_attn_available, logging
from torch import nn
import torch
from ...modeling_attn_mask_utils import _prepare_4d_attention_mask, _prepare_4d_attention_mask_for_sdpa
from ...modeling_... | @auto_docstring
class AutoformerPreTrainedModel(PreTrainedModel):
def _init_weights(self, module: nn.Module):
pass
def _update_full_mask(self, attention_mask: Union[torch.Tensor, None], inputs_embeds: torch.Tensor):
pass | 4 | 0 | 12 | 0 | 12 | 0 | 6 | 0 | 1 | 1 | 1 | 4 | 1 | 0 | 1 | 1 | 18 | 1 | 17 | 7 | 15 | 0 | 15 | 7 | 13 | 6 | 1 | 2 | 6 |
682 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerSeriesDecompositionLayer | from .configuration_autoformer import AutoformerConfig
from torch import nn
import torch
class AutoformerSeriesDecompositionLayer(nn.Module):
"""
Returns the trend and the seasonal parts of the time series. Calculated as:
x_trend = AvgPool(Padding(X)) and x_seasonal = X - x_trend
"""
def __in... |
class AutoformerSeriesDecompositionLayer(nn.Module):
'''
Returns the trend and the seasonal parts of the time series. Calculated as:
x_trend = AvgPool(Padding(X)) and x_seasonal = X - x_trend
'''
def __init__(self, config: AutoformerConfig):
pass
def forward(self, x):
'''I... | 3 | 2 | 8 | 1 | 6 | 2 | 1 | 0.54 | 1 | 2 | 1 | 0 | 2 | 2 | 2 | 12 | 24 | 4 | 13 | 11 | 10 | 7 | 13 | 11 | 10 | 1 | 1 | 0 | 2 |
683 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerSinusoidalPositionalEmbedding | from typing import Optional, Union
import torch
from torch import nn
import numpy as np
class AutoformerSinusoidalPositionalEmbedding(nn.Embedding):
"""This module produces sinusoidal positional embeddings of any length."""
def __init__(self, num_positions: int, embedding_dim: int, padding_idx: Optional[int]=... |
class AutoformerSinusoidalPositionalEmbedding(nn.Embedding):
'''This module produces sinusoidal positional embeddings of any length.'''
def __init__(self, num_positions: int, embedding_dim: int, padding_idx: Optional[int]=None) -> None:
pass
def _init_weight(self):
'''
Identical t... | 5 | 3 | 8 | 0 | 7 | 2 | 1 | 0.3 | 1 | 4 | 0 | 0 | 2 | 1 | 3 | 3 | 32 | 3 | 23 | 12 | 17 | 7 | 17 | 10 | 13 | 2 | 1 | 0 | 4 |
684 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerStdScaler | from torch import nn
from .configuration_autoformer import AutoformerConfig
import torch
class AutoformerStdScaler(nn.Module):
"""
Standardize features by calculating the mean and scaling along the first dimension, and then normalizes it by
subtracting from the mean and dividing by the standard deviation.
... |
class AutoformerStdScaler(nn.Module):
'''
Standardize features by calculating the mean and scaling along the first dimension, and then normalizes it by
subtracting from the mean and dividing by the standard deviation.
'''
def __init__(self, config: AutoformerConfig):
pass
def forward(... | 3 | 2 | 13 | 1 | 7 | 6 | 3 | 1 | 1 | 3 | 1 | 0 | 2 | 3 | 2 | 12 | 33 | 3 | 15 | 12 | 10 | 15 | 13 | 10 | 10 | 4 | 1 | 0 | 5 |
685 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/autoformer/modeling_autoformer.py | transformers.models.autoformer.modeling_autoformer.AutoformerValueEmbedding | from torch import nn
class AutoformerValueEmbedding(nn.Module):
def __init__(self, feature_size, d_model):
super().__init__()
self.value_projection = nn.Linear(in_features=feature_size, out_features=d_model, bias=False)
def forward(self, x):
return self.value_projection(x) |
class AutoformerValueEmbedding(nn.Module):
def __init__(self, feature_size, d_model):
pass
def forward(self, x):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 12 | 7 | 1 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
686 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/configuration_bamba.py | transformers.models.bamba.configuration_bamba.BambaConfig | from ...configuration_utils import PretrainedConfig
class BambaConfig(PretrainedConfig):
"""
This is the configuration class to store the configuration of a [`BambaModel`]. It is used to instantiate a
BambaModel model according to the specified arguments, defining the model architecture. Instantiating a co... |
class BambaConfig(PretrainedConfig):
'''
This is the configuration class to store the configuration of a [`BambaModel`]. It is used to instantiate a
BambaModel model according to the specified arguments, defining the model architecture. Instantiating a configuration
with defaults taken from [ibm-fms/Ba... | 4 | 1 | 47 | 5 | 41 | 1 | 4 | 0.92 | 1 | 3 | 0 | 0 | 2 | 29 | 2 | 2 | 180 | 17 | 85 | 66 | 51 | 78 | 45 | 35 | 42 | 5 | 1 | 1 | 7 |
687 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaAttention | from ...cache_utils import Cache
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple, logging
from ...utils.deprecation import deprecate_kwarg
from .configuration_bamba import BambaConfig
from typing import Any, Callable, Optional, TypedDict, Union
from ...processing_utils import Unpack
from torch... |
class BambaAttention(nn.Module):
'''Multi-headed attention from 'Attention Is All You Need' paper'''
def __init__(self, config: BambaConfig, layer_idx: int):
pass
@deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58')
def forward(self, hidden_states: torch.Tensor, posit... | 4 | 1 | 35 | 4 | 31 | 1 | 3 | 0.03 | 1 | 6 | 3 | 0 | 2 | 11 | 2 | 12 | 74 | 9 | 63 | 31 | 52 | 2 | 34 | 23 | 31 | 5 | 1 | 2 | 6 |
688 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaDecoderLayer | from .configuration_bamba import BambaConfig
import torch
from ...processing_utils import Unpack
from typing import Any, Callable, Optional, TypedDict, Union
from ...modeling_layers import GradientCheckpointingLayer
from ...utils.deprecation import deprecate_kwarg
class BambaDecoderLayer(GradientCheckpointingLayer):
... |
class BambaDecoderLayer(GradientCheckpointingLayer):
def __init__(self, config: BambaConfig, layer_idx: int, layer_type: str='mamba'):
pass
@deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58')
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.T... | 4 | 1 | 46 | 5 | 29 | 13 | 4 | 0.43 | 1 | 12 | 6 | 0 | 2 | 6 | 2 | 12 | 93 | 11 | 58 | 25 | 44 | 25 | 29 | 14 | 26 | 4 | 1 | 1 | 8 |
689 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaForCausalLM | from ...utils import TransformersKwargs, auto_docstring, can_return_tuple, logging
from ...modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast
from typing import Any, Callable, Optional, TypedDict, Union
from torch import nn
import torch
from ...generation import GenerationMixin
@auto_docstring
cla... | @auto_docstring
class BambaForCausalLM(BambaPreTrainedModel, GenerationMixin):
def __init__(self, config):
pass
@can_return_tuple
@auto_docstring
def forward(self, input_ids: Optional[torch.LongTensor]=None, attention_mask: Optional[torch.Tensor]=None, position_ids: Optional[torch.LongTensor]=N... | 7 | 1 | 18 | 2 | 12 | 4 | 2 | 0.34 | 2 | 8 | 3 | 0 | 9 | 5 | 9 | 10 | 181 | 27 | 118 | 50 | 80 | 40 | 53 | 23 | 43 | 8 | 2 | 2 | 22 |
690 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaMLP | from torch import nn
from transformers.activations import ACT2FN
class BambaMLP(nn.Module):
def __init__(self, config):
super().__init__()
self.config = config
self.hidden_size = config.hidden_size
self.intermediate_size = config.intermediate_size
self.gate_proj = nn.Linear... |
class BambaMLP(nn.Module):
def __init__(self, config):
pass
def forward(self, x):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 7 | 2 | 12 | 14 | 1 | 13 | 11 | 10 | 0 | 13 | 11 | 10 | 1 | 1 | 0 | 2 |
691 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaMixer | from transformers.activations import ACT2FN
from torch import nn
import torch
from .configuration_bamba import BambaConfig
from typing import Any, Callable, Optional, TypedDict, Union
class BambaMixer(nn.Module):
"""
Compute ∆, A, B, C, and D the state space parameters and compute the `contextualized_states`.
... |
class BambaMixer(nn.Module):
'''
Compute ∆, A, B, C, and D the state space parameters and compute the `contextualized_states`.
A, D are input independent (see Mamba paper [1] Section 3.5.2 "Interpretation of A" for why A isn't selective)
∆, B, C are input-dependent (this is a key difference between Mam... | 5 | 1 | 113 | 15 | 81 | 20 | 5 | 0.29 | 1 | 7 | 3 | 0 | 4 | 25 | 4 | 14 | 471 | 65 | 323 | 107 | 300 | 94 | 181 | 89 | 176 | 8 | 1 | 3 | 20 |
692 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaModel | import torch
from ...modeling_attn_mask_utils import AttentionMaskConverter
from torch import nn
from typing import Any, Callable, Optional, TypedDict, Union
from ...processing_utils import Unpack
from .configuration_bamba import BambaConfig
from ...modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPas... | @auto_docstring
class BambaModel(BambaPreTrainedModel):
def __init__(self, config: BambaConfig):
pass
@can_return_tuple
@auto_docstring
def forward(self, input_ids: Optional[torch.LongTensor]=None, attention_mask: Optional[torch.Tensor]=None, position_ids: Optional[torch.LongTensor]=None, past_... | 10 | 2 | 38 | 4 | 28 | 6 | 6 | 0.24 | 1 | 14 | 7 | 0 | 6 | 8 | 7 | 8 | 279 | 38 | 196 | 71 | 157 | 47 | 102 | 40 | 94 | 23 | 2 | 3 | 41 |
693 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaPreTrainedModel | from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple, logging
import torch
from .configuration_bamba import BambaConfig
@auto_docstring
class BambaPreTrainedModel(PreTrainedModel):
config: BambaConfig
base_model_prefix ... | @auto_docstring
class BambaPreTrainedModel(PreTrainedModel):
def _init_weights(self, module):
pass | 3 | 0 | 10 | 0 | 10 | 0 | 5 | 0.05 | 1 | 0 | 0 | 2 | 1 | 0 | 1 | 1 | 21 | 1 | 20 | 12 | 18 | 1 | 19 | 12 | 17 | 5 | 1 | 2 | 5 |
694 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaRMSNorm | from torch import nn
import torch
from ...integrations import use_kernel_forward_from_hub
@use_kernel_forward_from_hub('RMSNorm')
class BambaRMSNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-06):
"""
BambaRMSNorm is equivalent to T5LayerNorm
"""
super().__init__()
... | @use_kernel_forward_from_hub('RMSNorm')
class BambaRMSNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-06):
'''
BambaRMSNorm is equivalent to T5LayerNorm
'''
pass
def forward(self, hidden_states):
pass
def extra_repr(self):
pass | 5 | 1 | 5 | 0 | 4 | 1 | 1 | 0.23 | 1 | 2 | 0 | 0 | 3 | 2 | 3 | 13 | 18 | 2 | 13 | 8 | 9 | 3 | 13 | 8 | 9 | 1 | 1 | 0 | 3 |
695 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaRMSNormGated | from torch import nn
import torch
class BambaRMSNormGated(torch.nn.Module):
def __init__(self, hidden_size, eps=1e-06):
super().__init__()
self.weight = nn.Parameter(torch.ones(hidden_size))
self.variance_epsilon = eps
def forward(self, hidden_states, gate=None):
input_dtype =... |
class BambaRMSNormGated(torch.nn.Module):
def __init__(self, hidden_size, eps=1e-06):
pass
def forward(self, hidden_states, gate=None):
pass | 3 | 0 | 7 | 1 | 6 | 0 | 2 | 0 | 1 | 1 | 0 | 0 | 2 | 2 | 2 | 12 | 16 | 3 | 13 | 7 | 10 | 0 | 13 | 7 | 10 | 2 | 1 | 1 | 3 |
696 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.BambaRotaryEmbedding | from torch import nn
from .configuration_bamba import BambaConfig
import torch
from ...modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
class BambaRotaryEmbedding(nn.Module):
inv_freq: torch.Tensor
def __init__(self, config: BambaConfig, device=None):
super().__init__()
if h... |
class BambaRotaryEmbedding(nn.Module):
def __init__(self, config: BambaConfig, device=None):
pass
@torch.no_grad()
@dynamic_rope_update
def forward(self, x, position_ids):
pass | 5 | 0 | 18 | 2 | 13 | 5 | 3 | 0.35 | 1 | 4 | 1 | 0 | 3 | 7 | 3 | 13 | 59 | 8 | 40 | 21 | 35 | 14 | 38 | 20 | 34 | 3 | 1 | 1 | 8 |
697 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modeling_bamba.py | transformers.models.bamba.modeling_bamba.HybridMambaAttentionDynamicCache | from .configuration_bamba import BambaConfig
from typing import Any, Callable, Optional, TypedDict, Union
import torch
class HybridMambaAttentionDynamicCache:
"""
A dynamic cache that can handle both the attention cache (which has a seq_len dimension) and the mamba cache
(which has a constant shape regardl... | null | 5 | 3 | 38 | 2 | 36 | 1 | 3 | 0.32 | 1 | 3 | 1 | 0 | 1 | 7 | 1 | 39 | 52 | 4 | 37 | 12 | 35 | 12 | 19 | 12 | 17 | 3 | 4 | 2 | 3 |
698 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modular_bamba.py | transformers.models.bamba.modular_bamba.BambaAttention | from transformers.models.llama.modeling_llama import LlamaAttention, LlamaForCausalLM, LlamaMLP, LlamaRMSNorm, LlamaRotaryEmbedding, rotate_half
class BambaAttention(LlamaAttention):
pass |
class BambaAttention(LlamaAttention):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 2 | 0 | 0 |
699 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/bamba/modular_bamba.py | transformers.models.bamba.modular_bamba.BambaDecoderLayer | from typing import Optional, TypedDict, Union
from ...processing_utils import Unpack
import torch
from transformers.models.jamba.modeling_jamba import HybridMambaAttentionDynamicCache, JambaAttentionDecoderLayer
from ...utils.deprecation import deprecate_kwarg
from .configuration_bamba import BambaConfig
class BambaDe... |
class BambaDecoderLayer(JambaAttentionDecoderLayer):
def __init__(self, config: BambaConfig, layer_idx: int, layer_type: str='mamba'):
pass
@deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58')
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.T... | 4 | 1 | 46 | 6 | 28 | 13 | 4 | 0.44 | 1 | 11 | 5 | 0 | 2 | 4 | 2 | 14 | 93 | 12 | 57 | 23 | 43 | 25 | 28 | 12 | 25 | 4 | 2 | 1 | 8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.