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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
500 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py | transformers.models.albert.modeling_albert.AlbertLayerGroup | import torch
from ...processing_utils import Unpack
from .configuration_albert import AlbertConfig
from ...utils import ModelOutput, TransformersKwargs, auto_docstring, is_torch_flex_attn_available, logging
from typing import Callable, Optional, Union
from torch import nn
class AlbertLayerGroup(nn.Module):
def __... |
class AlbertLayerGroup(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[Union[torch.Tensor, tuple[torc... | 3 | 0 | 16 | 3 | 13 | 1 | 4 | 0.04 | 1 | 7 | 2 | 0 | 2 | 1 | 2 | 12 | 33 | 6 | 27 | 16 | 17 | 1 | 20 | 9 | 17 | 6 | 1 | 2 | 7 |
501 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py | transformers.models.albert.modeling_albert.AlbertMLMHead | from ...activations import ACT2FN
from torch import nn
from .configuration_albert import AlbertConfig
import torch
class AlbertMLMHead(nn.Module):
def __init__(self, config: AlbertConfig):
super().__init__()
self.LayerNorm = nn.LayerNorm(config.embedding_size, eps=config.layer_norm_eps)
se... |
class AlbertMLMHead(nn.Module):
def __init__(self, config: AlbertConfig):
pass
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
pass
def _tie_weights(self) -> None:
pass | 4 | 0 | 8 | 1 | 7 | 1 | 1 | 0.1 | 1 | 3 | 1 | 0 | 3 | 5 | 3 | 13 | 28 | 5 | 21 | 10 | 17 | 2 | 20 | 10 | 16 | 2 | 1 | 1 | 4 |
502 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py | transformers.models.albert.modeling_albert.AlbertModel | from .configuration_albert import AlbertConfig
from torch import nn
from ...utils.generic import can_return_tuple, check_model_inputs
from ...modeling_attn_mask_utils import _prepare_4d_attention_mask, _prepare_4d_attention_mask_for_sdpa
from ...processing_utils import Unpack
from ...modeling_outputs import BaseModelOu... | @auto_docstring
class AlbertModel(AlbertPreTrainedModel):
def __init__(self, config: AlbertConfig, add_pooling_layer: bool=True):
'''
add_pooling_layer (bool, *optional*, defaults to `True`):
Whether to add a pooling layer
'''
pass
def get_input_embeddings(self) -> ... | 10 | 2 | 25 | 3 | 19 | 2 | 4 | 0.1 | 1 | 8 | 4 | 0 | 5 | 7 | 5 | 6 | 137 | 22 | 105 | 41 | 82 | 11 | 59 | 29 | 53 | 14 | 2 | 2 | 20 |
503 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py | transformers.models.albert.modeling_albert.AlbertPreTrainedModel | from torch import nn
from ...utils import ModelOutput, TransformersKwargs, auto_docstring, is_torch_flex_attn_available, logging
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
from .configuration_albert import AlbertConfig
@auto_docstring
class AlbertPreTrainedModel(PreTrainedModel):
config... | @auto_docstring
class AlbertPreTrainedModel(PreTrainedModel):
def _init_weights(self, module):
'''Initialize the weights.'''
pass | 3 | 1 | 15 | 0 | 12 | 3 | 6 | 0.41 | 1 | 0 | 0 | 7 | 1 | 0 | 1 | 1 | 26 | 2 | 17 | 6 | 15 | 7 | 15 | 6 | 13 | 6 | 1 | 2 | 6 |
504 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py | transformers.models.albert.modeling_albert.AlbertSOPHead | from torch import nn
from .configuration_albert import AlbertConfig
import torch
class AlbertSOPHead(nn.Module):
def __init__(self, config: AlbertConfig):
super().__init__()
self.dropout = nn.Dropout(config.classifier_dropout_prob)
self.classifier = nn.Linear(config.hidden_size, config.num... |
class AlbertSOPHead(nn.Module):
def __init__(self, config: AlbertConfig):
pass
def forward(self, pooled_output: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 1 | 3 | 1 | 0 | 2 | 2 | 2 | 12 | 11 | 2 | 9 | 7 | 6 | 0 | 9 | 7 | 6 | 1 | 1 | 0 | 2 |
505 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/modeling_albert.py | transformers.models.albert.modeling_albert.AlbertTransformer | from ...utils import ModelOutput, TransformersKwargs, auto_docstring, is_torch_flex_attn_available, logging
import torch
from torch import nn
from ...processing_utils import Unpack
from .configuration_albert import AlbertConfig
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, MaskedLMOutput,... |
class AlbertTransformer(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]) -> Union[BaseModelOutput, tuple]:
... | 3 | 0 | 25 | 5 | 19 | 1 | 5 | 0.05 | 1 | 9 | 3 | 0 | 2 | 3 | 2 | 12 | 51 | 10 | 39 | 20 | 28 | 2 | 23 | 12 | 20 | 8 | 1 | 2 | 9 |
506 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/tokenization_albert.py | transformers.models.albert.tokenization_albert.AlbertTokenizer | from ...utils.import_utils import requires
import unicodedata
import sentencepiece as spm
from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from shutil import copyfile
from typing import Any, Optional
import os
@requires(backends=('sentencepiece',))
class AlbertTokenizer(PreTrainedTokenizer):
"""
... | @requires(backends=('sentencepiece',))
class AlbertTokenizer(PreTrainedTokenizer):
'''
Construct an ALBERT tokenizer. Based on [SentencePiece](https://github.com/google/sentencepiece).
This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
thi... | 16 | 7 | 16 | 2 | 11 | 4 | 3 | 0.73 | 1 | 6 | 0 | 0 | 14 | 7 | 14 | 103 | 311 | 52 | 150 | 63 | 113 | 109 | 102 | 40 | 87 | 5 | 3 | 4 | 35 |
507 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/albert/tokenization_albert_fast.py | transformers.models.albert.tokenization_albert_fast.AlbertTokenizerFast | from ...tokenization_utils import AddedToken
from typing import Optional
from shutil import copyfile
from ...tokenization_utils_fast import PreTrainedTokenizerFast
import os
class AlbertTokenizerFast(PreTrainedTokenizerFast):
"""
Construct a "fast" ALBERT tokenizer (backed by HuggingFace's *tokenizers* library... |
class AlbertTokenizerFast(PreTrainedTokenizerFast):
'''
Construct a "fast" ALBERT tokenizer (backed by HuggingFace's *tokenizers* library). Based on
[Unigram](https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models). This
tokenizer inherits from [`PreTrainedTokeniz... | 4 | 2 | 23 | 3 | 15 | 6 | 3 | 0.92 | 1 | 5 | 0 | 0 | 5 | 4 | 5 | 93 | 172 | 24 | 77 | 37 | 51 | 71 | 34 | 17 | 28 | 5 | 3 | 1 | 13 |
508 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/configuration_align.py | transformers.models.align.configuration_align.AlignConfig | from ...configuration_utils import PretrainedConfig
class AlignConfig(PretrainedConfig):
"""
[`AlignConfig`] is the configuration class to store the configuration of a [`AlignModel`]. It is used to
instantiate a ALIGN model according to the specified arguments, defining the text model and vision model conf... |
class AlignConfig(PretrainedConfig):
'''
[`AlignConfig`] is the configuration class to store the configuration of a [`AlignModel`]. It is used to
instantiate a ALIGN model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defa... | 2 | 1 | 18 | 3 | 12 | 3 | 2 | 1.56 | 1 | 3 | 2 | 0 | 1 | 5 | 2 | 2 | 88 | 19 | 27 | 19 | 15 | 42 | 18 | 10 | 15 | 3 | 1 | 1 | 4 |
509 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/configuration_align.py | transformers.models.align.configuration_align.AlignTextConfig | from ...configuration_utils import PretrainedConfig
class AlignTextConfig(PretrainedConfig):
"""
This is the configuration class to store the configuration of a [`AlignTextModel`]. It is used to instantiate a
ALIGN text encoder according to the specified arguments, defining the model architecture. Instanti... |
class AlignTextConfig(PretrainedConfig):
'''
This is the configuration class to store the configuration of a [`AlignTextModel`]. It is used to instantiate a
ALIGN text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yie... | 2 | 1 | 36 | 1 | 35 | 0 | 1 | 1.5 | 1 | 1 | 0 | 0 | 1 | 15 | 1 | 1 | 105 | 10 | 38 | 37 | 18 | 57 | 20 | 19 | 18 | 1 | 1 | 0 | 1 |
510 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/configuration_align.py | transformers.models.align.configuration_align.AlignVisionConfig | from ...configuration_utils import PretrainedConfig
class AlignVisionConfig(PretrainedConfig):
"""
This is the configuration class to store the configuration of a [`AlignVisionModel`]. It is used to instantiate a
ALIGN vision encoder according to the specified arguments, defining the model architecture. In... |
class AlignVisionConfig(PretrainedConfig):
'''
This is the configuration class to store the configuration of a [`AlignVisionModel`]. It is used to instantiate a
ALIGN vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults wi... | 2 | 1 | 47 | 1 | 46 | 0 | 1 | 1.24 | 1 | 4 | 0 | 0 | 1 | 21 | 1 | 1 | 120 | 10 | 49 | 48 | 24 | 61 | 26 | 25 | 24 | 1 | 1 | 0 | 1 |
511 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignModel | import torch
from ...utils import ModelOutput, auto_docstring, can_return_tuple, filter_out_non_signature_kwargs, logging
from torch import nn
from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
from typing import Any, Callable, Optional, Union
@auto_docstring
class AlignModel(AlignPreTrai... | @auto_docstring
class AlignModel(AlignPreTrainedModel):
def __init__(self, config: AlignConfig):
pass
@filter_out_non_signature_kwargs()
@auto_docstring
def get_text_features(self, input_ids: Optional[torch.Tensor]=None, attention_mask: Optional[torch.Tensor]=None, token_type_ids: Optional[torc... | 12 | 3 | 54 | 9 | 32 | 13 | 4 | 0.4 | 1 | 11 | 6 | 0 | 4 | 6 | 4 | 5 | 225 | 41 | 132 | 59 | 94 | 53 | 51 | 27 | 46 | 7 | 2 | 1 | 17 |
512 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignOutput | import torch
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithNoAttention, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndNoAttention
from dataclasses import dataclass
from typing import Any, Callable, Optional, Union
from ...utils import ModelOutput, auto_docstring, can_return_tuple, filte... | @dataclass
@auto_docstring
class AlignOutput(ModelOutput):
'''
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `return_loss` is `True`):
Contrastive loss for image-text similarity.
logits_per_image (`torch.FloatTensor` of shape `(image_batch_size, text_batch_size)`):
The... | 4 | 1 | 5 | 0 | 5 | 0 | 2 | 1.46 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 1 | 34 | 2 | 13 | 9 | 11 | 19 | 10 | 9 | 8 | 2 | 1 | 0 | 2 |
513 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignPreTrainedModel | from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
from torch import nn
from ...utils import ModelOutput, auto_docstring, can_return_tuple, filter_out_non_signature_kwargs, logging
@auto_docstring
class AlignPreTrained... | @auto_docstring
class AlignPreTrainedModel(PreTrainedModel):
def _init_weights(self, module: nn.Module):
'''Initialize the weights'''
pass | 3 | 1 | 17 | 0 | 16 | 1 | 7 | 0.25 | 1 | 1 | 1 | 3 | 1 | 0 | 1 | 1 | 27 | 2 | 20 | 5 | 18 | 5 | 18 | 5 | 16 | 7 | 1 | 2 | 7 |
514 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextAttention | from typing import Any, Callable, Optional, Union
from ...pytorch_utils import apply_chunking_to_forward, find_pruneable_heads_and_indices, prune_linear_layer
import torch
from torch import nn
class AlignTextAttention(nn.Module):
def __init__(self, config):
super().__init__()
self.self = AlignText... |
class AlignTextAttention(nn.Module):
def __init__(self, config):
pass
def prune_heads(self, heads):
pass
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=False, ... | 4 | 0 | 15 | 1 | 14 | 1 | 1 | 0.07 | 1 | 5 | 1 | 0 | 3 | 3 | 3 | 13 | 49 | 4 | 43 | 20 | 30 | 3 | 22 | 11 | 18 | 2 | 1 | 1 | 4 |
515 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextEmbeddings | import torch
from torch import nn
from typing import Any, Callable, Optional, Union
class AlignTextEmbeddings(nn.Module):
"""Construct the embeddings from word, position and token_type embeddings."""
def __init__(self, config):
super().__init__()
self.word_embeddings = nn.Embedding(config.voca... |
class AlignTextEmbeddings(nn.Module):
'''Construct the embeddings from word, position and token_type embeddings.'''
def __init__(self, config):
pass
def forward(self, input_ids: Optional[torch.LongTensor]=None, token_type_ids: Optional[torch.LongTensor]=None, position_ids: Optional[torch.LongTens... | 3 | 1 | 29 | 3 | 23 | 3 | 4 | 0.15 | 1 | 3 | 0 | 0 | 2 | 6 | 2 | 12 | 62 | 8 | 47 | 23 | 37 | 7 | 34 | 16 | 31 | 7 | 1 | 2 | 8 |
516 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextEncoder | from ...utils import ModelOutput, auto_docstring, can_return_tuple, filter_out_non_signature_kwargs, logging
from typing import Any, Callable, Optional, Union
from torch import nn
import torch
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithNoAttention, BaseModelOutputWithPooling, BaseModelOutputWit... |
class AlignTextEncoder(nn.Module):
def __init__(self, config):
pass
@can_return_tuple
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=False, output_hidden_states: Optiona... | 4 | 0 | 45 | 4 | 41 | 0 | 9 | 0 | 1 | 8 | 2 | 0 | 2 | 3 | 2 | 12 | 91 | 8 | 83 | 26 | 68 | 0 | 35 | 14 | 32 | 17 | 1 | 3 | 18 |
517 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextIntermediate | from ...activations import ACT2FN
import torch
from torch import nn
class AlignTextIntermediate(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.intermediate_size)
if isinstance(config.hidden_act, str):
self.intermedia... |
class AlignTextIntermediate(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 2 | 2 | 2 | 12 | 13 | 1 | 12 | 5 | 9 | 0 | 11 | 5 | 8 | 2 | 1 | 1 | 3 |
518 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextLayer | from ...pytorch_utils import apply_chunking_to_forward, find_pruneable_heads_and_indices, prune_linear_layer
from ...modeling_layers import GradientCheckpointingLayer
from typing import Any, Callable, Optional, Union
import torch
class AlignTextLayer(GradientCheckpointingLayer):
def __init__(self, config):
... |
class AlignTextLayer(GradientCheckpointingLayer):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=False, **kwargs) -> tuple[torch.Tensor]:
... | 4 | 0 | 27 | 2 | 23 | 2 | 4 | 0.1 | 1 | 7 | 3 | 0 | 3 | 8 | 3 | 13 | 84 | 9 | 70 | 32 | 57 | 7 | 41 | 23 | 37 | 7 | 1 | 2 | 11 |
519 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextModel | from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithNoAttention, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndNoAttention
from typing import Any, Callable, Optional, Union
import torch
from ...utils import Model... | @auto_docstring(custom_intro='\n The text model from ALIGN without any head or projection on top.\n ')
class AlignTextModel(AlignPreTrainedModel):
def __init__(self, config: AlignTextConfig, add_pooling_layer: bool=True):
'''
add_pooling_layer (bool, *optional*, defaults to `True`):
... | 8 | 2 | 28 | 4 | 19 | 5 | 4 | 0.25 | 1 | 9 | 5 | 0 | 4 | 4 | 4 | 5 | 121 | 21 | 80 | 33 | 62 | 20 | 43 | 21 | 38 | 13 | 2 | 2 | 17 |
520 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextOutput | import torch
from torch import nn
class AlignTextOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.intermediate_size, config.hidden_size)
self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
self.dropout = nn.Dro... |
class AlignTextOutput(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 3 | 2 | 12 | 12 | 1 | 11 | 6 | 8 | 0 | 11 | 6 | 8 | 1 | 1 | 0 | 2 |
521 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextPooler | from torch import nn
import torch
class AlignTextPooler(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.activation = nn.Tanh()
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
first_t... |
class AlignTextPooler(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 6 | 0 | 5 | 1 | 1 | 0.2 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 12 | 13 | 1 | 10 | 7 | 7 | 2 | 10 | 7 | 7 | 1 | 1 | 0 | 2 |
522 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextSelfAttention | import torch
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
from torch import nn
from typing import Any, Callable, Optional, Union
class AlignTextSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if config.hidden_size % config.num_attention_heads != 0... |
class AlignTextSelfAttention(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=False, **kwargs) -> tuple[torch.Tensor]:
pa... | 3 | 0 | 43 | 7 | 31 | 6 | 6 | 0.19 | 1 | 5 | 0 | 0 | 3 | 11 | 3 | 13 | 132 | 22 | 93 | 44 | 80 | 18 | 72 | 35 | 68 | 13 | 1 | 2 | 17 |
523 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignTextSelfOutput | import torch
from torch import nn
class AlignTextSelfOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
self.dropout = nn.Dropo... |
class AlignTextSelfOutput(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 3 | 2 | 12 | 12 | 1 | 11 | 6 | 8 | 0 | 11 | 6 | 8 | 1 | 1 | 0 | 2 |
524 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionBlock | import torch
from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
from torch import nn
class AlignVisionBlock(nn.Module):
"""
This corresponds to the block module of original the EfficientNet vision encoder implementation.
Args:
config ([`AlignVisionConfig`]):
... |
class AlignVisionBlock(nn.Module):
'''
This corresponds to the block module of original the EfficientNet vision encoder implementation.
Args:
config ([`AlignVisionConfig`]):
Model configuration class.
in_dim (`int`):
Number of input channels.
out_dim (`int`):... | 3 | 1 | 26 | 2 | 23 | 1 | 4 | 0.55 | 1 | 10 | 5 | 0 | 2 | 6 | 2 | 12 | 79 | 6 | 47 | 22 | 33 | 26 | 19 | 11 | 16 | 5 | 1 | 1 | 7 |
525 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionDepthwiseConv2d | from torch import nn
class AlignVisionDepthwiseConv2d(nn.Conv2d):
def __init__(self, in_channels, depth_multiplier=1, kernel_size=3, stride=1, padding=0, dilation=1, bias=True, padding_mode='zeros'):
out_channels = in_channels * depth_multiplier
super().__init__(in_channels=in_channels, out_channe... |
class AlignVisionDepthwiseConv2d(nn.Conv2d):
def __init__(self, in_channels, depth_multiplier=1, kernel_size=3, stride=1, padding=0, dilation=1, bias=True, padding_mode='zeros'):
pass | 2 | 0 | 23 | 0 | 23 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 24 | 0 | 24 | 13 | 12 | 0 | 4 | 3 | 2 | 1 | 1 | 0 | 1 |
526 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionDepthwiseLayer | from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
from ...activations import ACT2FN
from torch import nn
import torch
class AlignVisionDepthwiseLayer(nn.Module):
"""
This corresponds to the depthwise convolution phase of each block in the original implementation.
"""
def... |
class AlignVisionDepthwiseLayer(nn.Module):
'''
This corresponds to the depthwise convolution phase of each block in the original implementation.
'''
def __init__(self, config: AlignVisionConfig, in_dim: int, stride: int, kernel_size: int, adjust_padding: bool):
pass
def forward(self, hid... | 3 | 1 | 16 | 2 | 14 | 1 | 2 | 0.14 | 1 | 6 | 2 | 0 | 2 | 5 | 2 | 12 | 37 | 5 | 28 | 17 | 18 | 4 | 17 | 10 | 14 | 2 | 1 | 1 | 4 |
527 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionEmbeddings | from torch import nn
from ...activations import ACT2FN
from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
import torch
class AlignVisionEmbeddings(nn.Module):
"""
A module that corresponds to the stem module of the original work.
"""
def __init__(self, config: AlignVision... |
class AlignVisionEmbeddings(nn.Module):
'''
A module that corresponds to the stem module of the original work.
'''
def __init__(self, config: AlignVisionConfig):
pass
def forward(self, pixel_values: torch.Tensor) -> torch.Tensor:
pass | 3 | 1 | 9 | 1 | 8 | 0 | 1 | 0.19 | 1 | 3 | 1 | 0 | 2 | 5 | 2 | 12 | 23 | 4 | 16 | 9 | 13 | 3 | 14 | 9 | 11 | 1 | 1 | 0 | 2 |
528 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionEncoder | import torch
from torch import nn
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithNoAttention, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndNoAttention
from typing import Any, Callable, Optional, Union
from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
impor... |
class AlignVisionEncoder(nn.Module):
'''
Forward propagates the embeddings through each vision encoder (EfficientNet) block.
Args:
config ([`AlignVisionConfig`]):
Model configuration class.
'''
def __init__(self, config: AlignVisionConfig):
pass
def... | 4 | 1 | 22 | 3 | 18 | 1 | 4 | 0.13 | 1 | 9 | 4 | 0 | 2 | 2 | 2 | 12 | 72 | 12 | 53 | 28 | 44 | 7 | 35 | 23 | 31 | 7 | 1 | 2 | 13 |
529 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionExpansionLayer | from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
import torch
from torch import nn
from ...activations import ACT2FN
class AlignVisionExpansionLayer(nn.Module):
"""
This corresponds to the expansion phase of each block in the original implementation.
"""
def __init__(se... |
class AlignVisionExpansionLayer(nn.Module):
'''
This corresponds to the expansion phase of each block in the original implementation.
'''
def __init__(self, config: AlignVisionConfig, in_dim: int, out_dim: int, stride: int):
pass
def forward(self, hidden_states: torch.FloatTensor) -> torc... | 3 | 1 | 9 | 1 | 8 | 1 | 1 | 0.24 | 1 | 4 | 1 | 0 | 2 | 3 | 2 | 12 | 24 | 3 | 17 | 6 | 14 | 4 | 11 | 6 | 8 | 1 | 1 | 0 | 2 |
530 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionFinalBlockLayer | from torch import nn
from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
import torch
class AlignVisionFinalBlockLayer(nn.Module):
"""
This corresponds to the final phase of each block in the original implementation.
"""
def __init__(self, config: AlignVisionConfig, in_dim... |
class AlignVisionFinalBlockLayer(nn.Module):
'''
This corresponds to the final phase of each block in the original implementation.
'''
def __init__(self, config: AlignVisionConfig, in_dim: int, out_dim: int, stride: int, drop_rate: float, id_skip: bool):
pass
def forward(self, embeddings:... | 3 | 1 | 13 | 1 | 12 | 0 | 2 | 0.13 | 1 | 6 | 1 | 0 | 2 | 4 | 2 | 12 | 31 | 4 | 24 | 9 | 19 | 3 | 14 | 7 | 11 | 2 | 1 | 1 | 3 |
531 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionModel | from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithNoAttention, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndNoAttention
import torch
from torch import nn
from typing import Any, Callable, Optional, Union
from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
from ... | @auto_docstring(custom_intro='\n The vision model from ALIGN without any head or projection on top.\n ')
class AlignVisionModel(AlignPreTrainedModel):
def __init__(self, config: AlignVisionConfig):
pass
def get_input_embeddings(self) -> nn.Module:
pass
@can_return_tuple
@auto_doc... | 7 | 1 | 25 | 4 | 14 | 7 | 3 | 0.42 | 1 | 7 | 4 | 0 | 3 | 4 | 3 | 4 | 83 | 15 | 48 | 21 | 37 | 20 | 29 | 15 | 25 | 5 | 2 | 1 | 9 |
532 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/modeling_align.py | transformers.models.align.modeling_align.AlignVisionSqueezeExciteLayer | from torch import nn
from .configuration_align import AlignConfig, AlignTextConfig, AlignVisionConfig
import torch
from ...activations import ACT2FN
class AlignVisionSqueezeExciteLayer(nn.Module):
"""
This corresponds to the Squeeze and Excitement phase of each block in the original implementation.
"""
... |
class AlignVisionSqueezeExciteLayer(nn.Module):
'''
This corresponds to the Squeeze and Excitement phase of each block in the original implementation.
'''
def __init__(self, config: AlignVisionConfig, in_dim: int, expand_dim: int, expand: bool=False):
pass
def forward(self, hidden_states:... | 3 | 1 | 16 | 2 | 14 | 0 | 2 | 0.1 | 1 | 5 | 1 | 0 | 2 | 7 | 2 | 12 | 37 | 5 | 29 | 11 | 26 | 3 | 19 | 11 | 16 | 2 | 1 | 0 | 3 |
533 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/processing_align.py | transformers.models.align.processing_align.AlignProcessor | from ...processing_utils import ProcessingKwargs, ProcessorMixin
class AlignProcessor(ProcessorMixin):
"""
Constructs an ALIGN processor which wraps [`EfficientNetImageProcessor`] and
[`BertTokenizer`]/[`BertTokenizerFast`] into a single processor that inherits both the image processor and
tokenizer fu... |
class AlignProcessor(ProcessorMixin):
'''
Constructs an ALIGN processor which wraps [`EfficientNetImageProcessor`] and
[`BertTokenizer`]/[`BertTokenizerFast`] into a single processor that inherits both the image processor and
tokenizer functionalities. See the [`~AlignProcessor.__call__`] and [`~OwlViT... | 2 | 1 | 17 | 1 | 8 | 8 | 2 | 1.45 | 1 | 6 | 2 | 0 | 5 | 0 | 5 | 22 | 123 | 15 | 44 | 23 | 30 | 64 | 30 | 15 | 24 | 7 | 2 | 1 | 11 |
534 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/align/processing_align.py | transformers.models.align.processing_align.AlignProcessorKwargs | from ...processing_utils import ProcessingKwargs, ProcessorMixin
class AlignProcessorKwargs(ProcessingKwargs, total=False):
_defaults = {'text_kwargs': {'padding': 'max_length', 'max_length': 64}} |
class AlignProcessorKwargs(ProcessingKwargs, total=False):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0 | 7 | 2 | 6 | 1 | 2 | 2 | 1 | 0 | 3 | 0 | 0 |
535 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/configuration_altclip.py | transformers.models.altclip.configuration_altclip.AltCLIPConfig | from ...configuration_utils import PretrainedConfig
class AltCLIPConfig(PretrainedConfig):
"""
This is the configuration class to store the configuration of a [`AltCLIPModel`]. It is used to instantiate an
AltCLIP model according to the specified arguments, defining the model architecture. Instantiating a ... |
class AltCLIPConfig(PretrainedConfig):
'''
This is the configuration class to store the configuration of a [`AltCLIPModel`]. It is used to instantiate an
AltCLIP model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a sim... | 2 | 1 | 49 | 8 | 30 | 12 | 8 | 0.89 | 1 | 4 | 2 | 0 | 1 | 5 | 2 | 2 | 147 | 28 | 63 | 19 | 57 | 56 | 44 | 16 | 41 | 14 | 1 | 4 | 15 |
536 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/configuration_altclip.py | transformers.models.altclip.configuration_altclip.AltCLIPTextConfig | from ...configuration_utils import PretrainedConfig
class AltCLIPTextConfig(PretrainedConfig):
"""
This is the configuration class to store the configuration of a [`AltCLIPTextModel`]. It is used to instantiate a
AltCLIP text model according to the specified arguments, defining the model architecture. Inst... |
class AltCLIPTextConfig(PretrainedConfig):
'''
This is the configuration class to store the configuration of a [`AltCLIPTextModel`]. It is used to instantiate a
AltCLIP text model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will... | 2 | 1 | 41 | 1 | 40 | 0 | 1 | 1.5 | 1 | 1 | 0 | 0 | 1 | 16 | 1 | 1 | 116 | 11 | 42 | 41 | 18 | 63 | 20 | 19 | 18 | 1 | 1 | 0 | 1 |
537 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/configuration_altclip.py | transformers.models.altclip.configuration_altclip.AltCLIPVisionConfig | from ...configuration_utils import PretrainedConfig
class AltCLIPVisionConfig(PretrainedConfig):
"""
This is the configuration class to store the configuration of a [`AltCLIPModel`]. It is used to instantiate an
AltCLIP model according to the specified arguments, defining the model architecture. Instantiat... |
class AltCLIPVisionConfig(PretrainedConfig):
'''
This is the configuration class to store the configuration of a [`AltCLIPModel`]. It is used to instantiate an
AltCLIP model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield... | 2 | 1 | 32 | 1 | 31 | 0 | 1 | 1.35 | 1 | 1 | 0 | 0 | 1 | 13 | 1 | 1 | 91 | 11 | 34 | 33 | 16 | 46 | 18 | 17 | 16 | 1 | 1 | 0 | 1 |
538 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPAttention | from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
from typing import Any, Callable, Optional, Union
import torch
import torch.nn as nn
class AltCLIPAttention(nn.Module):
"""Multi-headed attention from 'Attention Is All You Need' paper"""
def __init__(self, config):
super().__init_... |
class AltCLIPAttention(nn.Module):
'''Multi-headed attention from 'Attention Is All You Need' paper'''
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor]=None, causal_attention_mask: Optional[torch.Tensor]=None, output_attentions... | 3 | 2 | 32 | 5 | 25 | 2 | 4 | 0.11 | 1 | 5 | 0 | 0 | 3 | 10 | 3 | 13 | 102 | 19 | 75 | 30 | 65 | 8 | 54 | 24 | 50 | 8 | 1 | 2 | 11 |
539 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPEncoder | from ...utils import ModelOutput, auto_docstring, can_return_tuple, filter_out_non_signature_kwargs, logging, torch_int
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndCrossAttentions, BaseModelOutputWithPoolingAndProjection
from typing import Any, Callable, Opt... |
class AltCLIPEncoder(nn.Module):
'''
Transformer encoder consisting of `config.num_hidden_layers` self attention layers. Each layer is a
[`AltCLIPEncoderLayer`].
Args:
config: AltCLIPConfig
'''
def __init__(self, config: AltCLIPConfig):
pass
@can_return_tuple
def forwar... | 4 | 2 | 43 | 5 | 25 | 13 | 7 | 0.61 | 1 | 9 | 3 | 0 | 2 | 3 | 2 | 12 | 95 | 13 | 51 | 19 | 40 | 31 | 27 | 11 | 24 | 12 | 1 | 2 | 13 |
540 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPEncoderLayer | import torch.nn as nn
from typing import Any, Callable, Optional, Union
import torch
from .configuration_altclip import AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig
from ...modeling_layers import GradientCheckpointingLayer
class AltCLIPEncoderLayer(GradientCheckpointingLayer):
def __init__(self, config: ... |
class AltCLIPEncoderLayer(GradientCheckpointingLayer):
def __init__(self, config: AltCLIPConfig):
pass
def forward(self, hidden_states: torch.Tensor, attention_mask: torch.Tensor, causal_attention_mask: torch.Tensor, output_attentions: Optional[bool]=False) -> tuple[torch.FloatTensor]:
'''
... | 3 | 1 | 23 | 3 | 16 | 5 | 2 | 0.31 | 1 | 6 | 3 | 0 | 2 | 5 | 2 | 12 | 48 | 6 | 32 | 17 | 23 | 10 | 21 | 11 | 18 | 2 | 1 | 1 | 3 |
541 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPMLP | import torch.nn as nn
from ...activations import ACT2FN
import torch
class AltCLIPMLP(nn.Module):
def __init__(self, config):
super().__init__()
self.config = config
self.activation_fn = ACT2FN[config.hidden_act]
self.fc1 = nn.Linear(config.hidden_size, config.intermediate_size)
... |
class AltCLIPMLP(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 4 | 2 | 12 | 13 | 1 | 12 | 7 | 9 | 0 | 12 | 7 | 9 | 1 | 1 | 0 | 2 |
542 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPModel | from ...utils import ModelOutput, auto_docstring, can_return_tuple, filter_out_non_signature_kwargs, logging, torch_int
import torch.nn as nn
import torch
from typing import Any, Callable, Optional, Union
from .configuration_altclip import AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig
class AltCLIPModel(AltCLI... |
class AltCLIPModel(AltCLIPPreTrainedModel):
def __init__(self, config: AltCLIPConfig):
pass
@filter_out_non_signature_kwargs()
@auto_docstring
def get_text_features(self, input_ids: torch.Tensor, attention_mask: Optional[torch.Tensor]=None, position_ids: Optional[torch.Tensor]=None, token_type... | 10 | 3 | 53 | 7 | 33 | 13 | 5 | 0.39 | 1 | 11 | 6 | 0 | 4 | 8 | 4 | 5 | 222 | 33 | 137 | 62 | 100 | 53 | 57 | 31 | 52 | 7 | 2 | 1 | 18 |
543 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPOutput | from dataclasses import dataclass
import torch
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndCrossAttentions, BaseModelOutputWithPoolingAndProjection
from typing import Any, Callable, Optional, Union
from ...utils import ModelOutput, auto_docstring, can_return... | @dataclass
@auto_docstring
class AltCLIPOutput(ModelOutput):
'''
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `return_loss` is `True`):
Contrastive loss for image-text similarity.
logits_per_image (`torch.FloatTensor` of shape `(image_batch_size, text_batch_size)`):
T... | 4 | 1 | 5 | 0 | 5 | 0 | 2 | 1.46 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 1 | 34 | 2 | 13 | 9 | 11 | 19 | 10 | 9 | 8 | 2 | 1 | 0 | 2 |
544 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPPreTrainedModel | from .configuration_altclip import AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig
from ...utils import ModelOutput, auto_docstring, can_return_tuple, filter_out_non_signature_kwargs, logging, torch_int
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
import torch.nn as nn
@auto_docstring
c... | @auto_docstring
class AltCLIPPreTrainedModel(PreTrainedModel):
def _init_weights(self, module):
'''Initialize the weights'''
pass | 3 | 1 | 44 | 0 | 43 | 1 | 10 | 0.1 | 1 | 4 | 4 | 4 | 1 | 0 | 1 | 1 | 55 | 2 | 48 | 10 | 46 | 5 | 36 | 10 | 34 | 10 | 1 | 2 | 10 |
545 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPTextModel | from .configuration_altclip import AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndCrossAttentions, BaseModelOutputWithPoolingAndProjection
from typing import Any, Callable, Optional, Union
import torch
from ... |
class AltCLIPTextModel(AltCLIPPreTrainedModel):
def __init__(self, config):
pass
def get_input_embeddings(self) -> nn.Module:
pass
def set_input_embeddings(self, value: nn.Embedding) -> None:
pass
def resize_token_embeddings(self, new_num_tokens: Optional[int]=None) -> nn.Em... | 8 | 1 | 16 | 3 | 10 | 3 | 1 | 0.29 | 1 | 6 | 2 | 0 | 5 | 3 | 5 | 6 | 90 | 18 | 56 | 28 | 35 | 16 | 24 | 14 | 18 | 3 | 2 | 1 | 7 |
546 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPVisionEmbeddings | from .configuration_altclip import AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig
import torch
from ...utils import ModelOutput, auto_docstring, can_return_tuple, filter_out_non_signature_kwargs, logging, torch_int
import torch.nn as nn
class AltCLIPVisionEmbeddings(nn.Module):
def __init__(self, config: A... |
class AltCLIPVisionEmbeddings(nn.Module):
def __init__(self, config: AltCLIPVisionConfig):
pass
def interpolate_pos_encoding(self, embeddings: torch.Tensor, height: int, width: int) -> torch.Tensor:
'''
This method allows to interpolate the pre-trained position encodings, to be able t... | 4 | 1 | 26 | 5 | 19 | 3 | 2 | 0.16 | 1 | 5 | 1 | 0 | 3 | 9 | 3 | 13 | 81 | 16 | 57 | 27 | 53 | 9 | 43 | 27 | 39 | 3 | 1 | 1 | 6 |
547 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPVisionModel | import torch.nn as nn
import torch
from .configuration_altclip import AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig
from typing import Any, Callable, Optional, Union
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndCrossAttentions, BaseModelOutputWithPool... |
class AltCLIPVisionModel(AltCLIPPreTrainedModel):
def __init__(self, config: AltCLIPVisionConfig):
pass
def get_input_embeddings(self) -> nn.Module:
pass
@auto_docstring
def forward(self, pixel_values: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=None, output_hi... | 5 | 1 | 15 | 2 | 7 | 6 | 1 | 0.63 | 1 | 5 | 3 | 0 | 3 | 1 | 3 | 4 | 54 | 10 | 27 | 15 | 14 | 17 | 12 | 7 | 8 | 2 | 2 | 0 | 4 |
548 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltCLIPVisionTransformer | from typing import Any, Callable, Optional, Union
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndCrossAttentions, BaseModelOutputWithPoolingAndProjection
import torch.nn as nn
from .configuration_altclip import AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionCon... |
class AltCLIPVisionTransformer(nn.Module):
def __init__(self, config: AltCLIPVisionConfig):
pass
@can_return_tuple
@auto_docstring
def forward(self, pixel_values: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=None, output_hidden_states: Optional[bool]=None, return_dict: O... | 5 | 0 | 27 | 4 | 21 | 2 | 4 | 0.07 | 1 | 7 | 4 | 0 | 2 | 5 | 2 | 12 | 57 | 9 | 45 | 21 | 33 | 3 | 24 | 13 | 21 | 6 | 1 | 1 | 7 |
549 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaAttention | from typing import Any, Callable, Optional, Union
from ...pytorch_utils import apply_chunking_to_forward, find_pruneable_heads_and_indices, prune_linear_layer
import torch.nn as nn
import torch
class AltRobertaAttention(nn.Module):
def __init__(self, config, position_embedding_type=None):
super().__init__... |
class AltRobertaAttention(nn.Module):
def __init__(self, config, position_embedding_type=None):
pass
def prune_heads(self, heads):
pass
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, output_att... | 4 | 0 | 15 | 1 | 14 | 1 | 1 | 0.07 | 1 | 5 | 1 | 0 | 3 | 3 | 3 | 13 | 49 | 4 | 43 | 20 | 30 | 3 | 22 | 11 | 18 | 2 | 1 | 1 | 4 |
550 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaEmbeddings | import torch.nn as nn
import torch
from typing import Any, Callable, Optional, Union
class AltRobertaEmbeddings(nn.Module):
"""Construct the embeddings from word, position and token_type embeddings."""
def __init__(self, config):
super().__init__()
self.word_embeddings = nn.Embedding(config.vo... |
class AltRobertaEmbeddings(nn.Module):
'''Construct the embeddings from word, position and token_type embeddings.'''
def __init__(self, config):
pass
def forward(self, input_ids: Optional[torch.LongTensor]=None, token_type_ids: Optional[torch.LongTensor]=None, position_ids: Optional[torch.LongTen... | 7 | 3 | 26 | 3 | 18 | 5 | 3 | 0.32 | 1 | 1 | 0 | 0 | 3 | 7 | 3 | 13 | 87 | 13 | 56 | 23 | 50 | 18 | 43 | 21 | 39 | 8 | 1 | 2 | 10 |
551 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaEncoder | from ...utils import ModelOutput, auto_docstring, can_return_tuple, filter_out_non_signature_kwargs, logging, torch_int
from typing import Any, Callable, Optional, Union
import torch.nn as nn
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndCrossAttentions, BaseM... |
class AltRobertaEncoder(nn.Module):
def __init__(self, config):
pass
@can_return_tuple
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=False, output_hidden_states: Option... | 4 | 0 | 45 | 4 | 41 | 0 | 9 | 0 | 1 | 8 | 2 | 0 | 2 | 3 | 2 | 12 | 91 | 8 | 83 | 26 | 68 | 0 | 35 | 14 | 32 | 17 | 1 | 3 | 18 |
552 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaIntermediate | import torch.nn as nn
from ...activations import ACT2FN
import torch
class AltRobertaIntermediate(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.intermediate_size)
if isinstance(config.hidden_act, str):
self.intermed... |
class AltRobertaIntermediate(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 2 | 2 | 2 | 12 | 13 | 1 | 12 | 5 | 9 | 0 | 11 | 5 | 8 | 2 | 1 | 1 | 3 |
553 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaLayer | import torch
import torch.nn as nn
from typing import Any, Callable, Optional, Union
from ...pytorch_utils import apply_chunking_to_forward, find_pruneable_heads_and_indices, prune_linear_layer
from ...modeling_layers import GradientCheckpointingLayer
class AltRobertaLayer(GradientCheckpointingLayer):
def __init_... |
class AltRobertaLayer(GradientCheckpointingLayer):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=False, **kwargs) -> tuple[torch.Tensor]:
... | 4 | 0 | 27 | 2 | 23 | 2 | 4 | 0.1 | 1 | 7 | 3 | 0 | 3 | 8 | 3 | 13 | 84 | 9 | 70 | 32 | 57 | 7 | 41 | 23 | 37 | 7 | 1 | 2 | 11 |
554 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaModel | from typing import Any, Callable, Optional, Union
from .configuration_altclip import AltCLIPConfig, AltCLIPTextConfig, AltCLIPVisionConfig
from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPooling, BaseModelOutputWithPoolingAndCrossAttentions, BaseModelOutputWithPoolingAndProjection
import torch
impor... | @auto_docstring(custom_intro='\n The model behaves as an encoder following the architecture described in *Attention is\n all you need*_ by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz\n Kaiser and Illia Polosukhin.\n\n .. _*Attention is all you need*: https... | 8 | 2 | 30 | 3 | 20 | 7 | 5 | 0.44 | 1 | 8 | 4 | 0 | 5 | 4 | 5 | 6 | 175 | 27 | 103 | 41 | 82 | 45 | 56 | 26 | 50 | 18 | 2 | 2 | 24 |
555 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaOutput | import torch.nn as nn
import torch
class AltRobertaOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.intermediate_size, config.hidden_size)
self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
self.dropout = nn.D... |
class AltRobertaOutput(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 3 | 2 | 12 | 12 | 1 | 11 | 6 | 8 | 0 | 11 | 6 | 8 | 1 | 1 | 0 | 2 |
556 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaPooler | import torch.nn as nn
import torch
class AltRobertaPooler(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.activation = nn.Tanh()
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
first... |
class AltRobertaPooler(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 6 | 0 | 5 | 1 | 1 | 0.2 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 12 | 13 | 1 | 10 | 7 | 7 | 2 | 10 | 7 | 7 | 1 | 1 | 0 | 2 |
557 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaSelfAttention | import torch.nn as nn
from typing import Any, Callable, Optional, Union
import torch
import math
class AltRobertaSelfAttention(nn.Module):
def __init__(self, config, position_embedding_type=None):
super().__init__()
if config.hidden_size % config.num_attention_heads != 0 and (not hasattr(config, '... |
class AltRobertaSelfAttention(nn.Module):
def __init__(self, config, position_embedding_type=None):
pass
def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor]=None, head_mask: Optional[torch.FloatTensor]=None, output_attentions: Optional[bool]=False) -> tuple[torc... | 3 | 0 | 43 | 7 | 31 | 6 | 6 | 0.19 | 1 | 5 | 0 | 0 | 3 | 11 | 3 | 13 | 132 | 22 | 93 | 44 | 80 | 18 | 72 | 35 | 68 | 13 | 1 | 2 | 17 |
558 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/modeling_altclip.py | transformers.models.altclip.modeling_altclip.AltRobertaSelfOutput | import torch.nn as nn
import torch
class AltRobertaSelfOutput(nn.Module):
def __init__(self, config):
super().__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.LayerNorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
self.dropout = nn.Dro... |
class AltRobertaSelfOutput(nn.Module):
def __init__(self, config):
pass
def forward(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 3 | 2 | 12 | 12 | 1 | 11 | 6 | 8 | 0 | 11 | 6 | 8 | 1 | 1 | 0 | 2 |
559 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/altclip/processing_altclip.py | transformers.models.altclip.processing_altclip.AltCLIPProcessor | from ...processing_utils import ProcessorMixin
from ...utils.deprecation import deprecate_kwarg
class AltCLIPProcessor(ProcessorMixin):
"""
Constructs a AltCLIP processor which wraps a CLIP image processor and a XLM-Roberta tokenizer into a single
processor.
[`AltCLIPProcessor`] offers all the functio... |
class AltCLIPProcessor(ProcessorMixin):
'''
Constructs a AltCLIP processor which wraps a CLIP image processor and a XLM-Roberta tokenizer into a single
processor.
[`AltCLIPProcessor`] offers all the functionalities of [`CLIPImageProcessor`] and [`XLMRobertaTokenizerFast`]. See
the [`~AltCLIPProcess... | 3 | 1 | 18 | 2 | 9 | 7 | 3 | 0.96 | 1 | 6 | 2 | 0 | 5 | 0 | 5 | 22 | 115 | 17 | 50 | 24 | 35 | 48 | 35 | 15 | 29 | 8 | 2 | 1 | 14 |
560 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/configuration_aria.py | transformers.models.aria.configuration_aria.AriaConfig | from ...configuration_utils import PretrainedConfig
from ..auto import CONFIG_MAPPING, AutoConfig
from typing import Optional
class AriaConfig(PretrainedConfig):
"""
This class handles the configuration for both vision and text components of the Aria model,
as well as additional parameters for image token ... |
class AriaConfig(PretrainedConfig):
'''
This class handles the configuration for both vision and text components of the Aria model,
as well as additional parameters for image token handling and projector mapping.
Instantiating a configuration with the defaults will yield a similar configuration to that... | 2 | 1 | 39 | 5 | 32 | 2 | 6 | 0.97 | 1 | 5 | 1 | 0 | 1 | 7 | 1 | 1 | 79 | 10 | 35 | 20 | 24 | 34 | 21 | 11 | 19 | 6 | 1 | 1 | 6 |
561 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/configuration_aria.py | transformers.models.aria.configuration_aria.AriaTextConfig | from ...modeling_rope_utils import rope_config_validation
from ...configuration_utils import PretrainedConfig
class AriaTextConfig(PretrainedConfig):
"""
This class handles the configuration for the text component of the Aria model.
Instantiating a configuration with the defaults will yield a similar confi... |
class AriaTextConfig(PretrainedConfig):
'''
This class handles the configuration for the text component of the Aria model.
Instantiating a configuration with the defaults will yield a similar configuration to that of the model of the Aria
[rhymes-ai/Aria](https://huggingface.co/rhymes-ai/Aria) architec... | 2 | 1 | 67 | 2 | 62 | 3 | 4 | 1.44 | 1 | 2 | 0 | 0 | 1 | 21 | 1 | 1 | 188 | 5 | 75 | 55 | 45 | 108 | 33 | 27 | 31 | 4 | 1 | 1 | 4 |
562 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/image_processing_aria.py | transformers.models.aria.image_processing_aria.AriaImageProcessor | from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_patch_output_size, select_best_resolution
from typing import Optional, Union
from ...utils import TensorType, logging
import numpy as np
from ...image_transforms import PaddingMode, convert_to_rgb, pad, resize, to_channel_dimension_format
from ... |
class AriaImageProcessor(BaseImageProcessor):
'''
A vision processor for the Aria model that handles image preprocessing.
Initialize the AriaImageProcessor.
Args:
image_mean (`list`, *optional*, defaults to [0.5, 0.5, 0.5]):
Mean values for normalization.
image_std (`list`, ... | 9 | 7 | 60 | 6 | 33 | 22 | 5 | 0.76 | 1 | 12 | 3 | 0 | 6 | 9 | 6 | 26 | 392 | 44 | 199 | 88 | 146 | 152 | 96 | 42 | 89 | 20 | 3 | 3 | 32 |
563 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaCausalLMOutputWithPast | from ...modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast, ModelOutput
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple
from dataclasses import dataclass
from typing import Callable, Optional, Union
import torch
from ...cache_utils import Cache, DynamicCache
@dataclass
@a... | @dataclass
@auto_docstring(custom_intro='\n Base class for Aria causal language model (or autoregressive) outputs.\n ')
class AriaCausalLMOutputWithPast(ModelOutput):
'''
loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
Language modeling loss (for next-to... | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 3.57 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 37 | 5 | 7 | 7 | 6 | 25 | 7 | 7 | 6 | 0 | 1 | 0 | 0 |
564 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaCrossAttention | from .configuration_aria import AriaConfig, AriaTextConfig
from torch import nn
class AriaCrossAttention(nn.Module):
"""
Aria Cross-Attention module.
Args:
config (`AriaConfig`):
The configuration to use.
"""
def __init__(self, config: AriaConfig, dropout_rate: float=0):
... |
class AriaCrossAttention(nn.Module):
'''
Aria Cross-Attention module.
Args:
config (`AriaConfig`):
The configuration to use.
'''
def __init__(self, config: AriaConfig, dropout_rate: float=0):
pass
def forward(self, key_value_states, hidden_states, attn_mask=None):
... | 3 | 2 | 22 | 4 | 11 | 7 | 1 | 0.91 | 1 | 3 | 1 | 0 | 2 | 9 | 2 | 12 | 53 | 11 | 22 | 18 | 19 | 20 | 22 | 18 | 19 | 1 | 1 | 0 | 2 |
565 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaForConditionalGeneration | from ...cache_utils import Cache, DynamicCache
import torch
from typing import Callable, Optional, Union
from ...processing_utils import Unpack
from .configuration_aria import AriaConfig, AriaTextConfig
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple
from ...generation import GenerationMixin
f... | @auto_docstring(custom_intro='\n Aria model for conditional generation tasks.\n\n This model combines a vision tower, a multi-modal projector, and a language model\n to perform tasks that involve both image and text inputs.\n ')
class AriaForConditionalGeneration(AriaPreTrainedModel, GenerationMixin):
... | 19 | 1 | 21 | 2 | 14 | 5 | 2 | 0.34 | 2 | 10 | 5 | 0 | 11 | 6 | 11 | 12 | 250 | 34 | 161 | 74 | 113 | 55 | 77 | 40 | 65 | 11 | 2 | 2 | 25 |
566 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaGroupedExpertsGemm | from torch import nn
import torch
class AriaGroupedExpertsGemm(nn.Module):
"""
Grouped GEMM (General Matrix Multiplication) module for efficient expert computation.
This module utilizes the grouped_gemm library (https://github.com/fanshiqing/grouped_gemm)
for optimized performance. If the grouped_gemm ... |
class AriaGroupedExpertsGemm(nn.Module):
'''
Grouped GEMM (General Matrix Multiplication) module for efficient expert computation.
This module utilizes the grouped_gemm library (https://github.com/fanshiqing/grouped_gemm)
for optimized performance. If the grouped_gemm library is not installed, it grace... | 3 | 2 | 12 | 1 | 6 | 5 | 1 | 1.85 | 1 | 1 | 0 | 0 | 2 | 4 | 2 | 12 | 42 | 5 | 13 | 7 | 10 | 24 | 9 | 7 | 6 | 1 | 1 | 0 | 2 |
567 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaGroupedExpertsMLP | from .configuration_aria import AriaConfig, AriaTextConfig
from torch import nn
import torch
class AriaGroupedExpertsMLP(nn.Module):
"""
Grouped MLP module for Mixture of Experts.
Args:
config (`AriaTextConfig`):
Configuration object for the model.
"""
def __init__(self, confi... |
class AriaGroupedExpertsMLP(nn.Module):
'''
Grouped MLP module for Mixture of Experts.
Args:
config (`AriaTextConfig`):
Configuration object for the model.
'''
def __init__(self, config: AriaTextConfig) -> None:
pass
def forward(self, permuted_tokens, tokens_per_ex... | 3 | 2 | 11 | 1 | 6 | 4 | 1 | 1.17 | 1 | 3 | 2 | 0 | 2 | 3 | 2 | 12 | 31 | 5 | 12 | 9 | 9 | 14 | 12 | 9 | 9 | 1 | 1 | 0 | 2 |
568 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaPreTrainedModel | from torch import nn
from .configuration_aria import AriaConfig, AriaTextConfig
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple
@auto_docstring
class AriaPreTrainedModel(PreTrainedModel):
config: AriaConfig
base_mo... | @auto_docstring
class AriaPreTrainedModel(PreTrainedModel):
def _init_weights(self, module):
pass | 3 | 0 | 12 | 0 | 12 | 0 | 6 | 0.04 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 26 | 1 | 25 | 15 | 23 | 1 | 23 | 15 | 21 | 6 | 1 | 2 | 6 |
569 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaProjector | from torch import nn
from typing import Callable, Optional, Union
import torch
from .configuration_aria import AriaConfig, AriaTextConfig
class AriaProjector(nn.Module):
"""
Aria Projector module.
This module projects vision features into the language model's embedding space, enabling interaction between ... |
class AriaProjector(nn.Module):
'''
Aria Projector module.
This module projects vision features into the language model's embedding space, enabling interaction between vision and language components.
Args:
config (`AriaConfig`):
Configuration object for the model.
'''
def _... | 3 | 2 | 26 | 6 | 15 | 5 | 2 | 0.57 | 1 | 6 | 3 | 0 | 2 | 10 | 2 | 12 | 63 | 16 | 30 | 21 | 24 | 17 | 25 | 18 | 22 | 3 | 1 | 1 | 4 |
570 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaProjectorMLP | from torch import nn
from ...activations import ACT2FN
class AriaProjectorMLP(nn.Module):
"""
Feed-Forward Network module for the Aria Projector.
Args:
in_features (`int`):
Input embedding dimension.
hidden_features (`int`):
Hidden dimension of the feed-forward netw... |
class AriaProjectorMLP(nn.Module):
'''
Feed-Forward Network module for the Aria Projector.
Args:
in_features (`int`):
Input embedding dimension.
hidden_features (`int`):
Hidden dimension of the feed-forward network.
output_dim (`int`):
Output dime... | 3 | 1 | 5 | 0 | 5 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 2 | 3 | 2 | 12 | 23 | 3 | 10 | 6 | 7 | 10 | 10 | 6 | 7 | 1 | 1 | 0 | 2 |
571 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaSharedExpertsMLP | from torch import nn
from .configuration_aria import AriaConfig, AriaTextConfig
from ...activations import ACT2FN
class AriaSharedExpertsMLP(nn.Module):
"""
Shared Expert MLP for shared experts.
Unlike routed experts, shared experts process all tokens without routing.
This class reconfigures the inter... |
class AriaSharedExpertsMLP(nn.Module):
'''
Shared Expert MLP for shared experts.
Unlike routed experts, shared experts process all tokens without routing.
This class reconfigures the intermediate size in comparison to the LlamaMLP.
Args:
config (`AriaTextConfig`): Configuration object for t... | 3 | 1 | 6 | 0 | 6 | 0 | 1 | 0.54 | 1 | 2 | 1 | 0 | 2 | 7 | 2 | 12 | 24 | 4 | 13 | 11 | 10 | 7 | 13 | 11 | 10 | 1 | 1 | 0 | 2 |
572 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaTextAttention | from ...processing_utils import Unpack
from torch import nn
from ...utils.deprecation import deprecate_kwarg
from typing import Callable, Optional, Union
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple
from .configuration_aria import AriaConfig, AriaTextConfig
from ...modeling_utils import ALL... |
class AriaTextAttention(nn.Module):
'''Multi-headed attention from 'Attention Is All You Need' paper'''
def __init__(self, config: AriaTextConfig, layer_idx: int):
pass
@deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58')
def forward(self, hidden_states: torch.Tensor,... | 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 |
573 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaTextDecoderLayer | from typing import Callable, Optional, Union
from ...utils.deprecation import deprecate_kwarg
from ...cache_utils import Cache, DynamicCache
import torch
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple
from .configuration_aria import AriaConfig, AriaTextConfig
from ...processing_utils import U... |
class AriaTextDecoderLayer(GradientCheckpointingLayer):
'''
Aria Text Decoder Layer.
This class defines a single decoder layer in the language model, incorporating self-attention and Mixture of Experts (MoE) feed-forward network.
Args:
config (`AriaTextConfig`):
Configuration object... | 4 | 1 | 25 | 3 | 21 | 2 | 2 | 0.29 | 1 | 10 | 6 | 0 | 2 | 5 | 2 | 12 | 63 | 10 | 42 | 22 | 28 | 12 | 21 | 11 | 18 | 2 | 1 | 1 | 3 |
574 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaTextForCausalLM | from torch import nn
from .configuration_aria import AriaConfig, AriaTextConfig
from typing import Callable, Optional, Union
from ...modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast, ModelOutput
from ...processing_utils import Unpack
from ...cache_utils import Cache, DynamicCache
from ...utils im... | @auto_docstring
class AriaTextForCausalLM(AriaTextPreTrainedModel, GenerationMixin):
def __init__(self, config: AriaTextConfig):
pass
@auto_docstring
def forward(self, input_ids: Optional[torch.LongTensor]=None, attention_mask: Optional[torch.Tensor]=None, position_ids: Optional[torch.LongTensor]=N... | 5 | 1 | 14 | 2 | 9 | 4 | 2 | 0.48 | 2 | 10 | 5 | 0 | 8 | 3 | 8 | 9 | 135 | 24 | 75 | 37 | 48 | 36 | 37 | 21 | 28 | 8 | 2 | 1 | 15 |
575 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaTextMoELayer | from .configuration_aria import AriaConfig, AriaTextConfig
from torch import nn
import torch
class AriaTextMoELayer(nn.Module):
"""
Aria Text Mixture of Experts (MoE) Layer.
This layer applies a gating mechanism to route input tokens to different experts.
Args:
config (`AriaTextConfig`):
... |
class AriaTextMoELayer(nn.Module):
'''
Aria Text Mixture of Experts (MoE) Layer.
This layer applies a gating mechanism to route input tokens to different experts.
Args:
config (`AriaTextConfig`):
Configuration object for the text component of the model.
'''
def __init__(sel... | 3 | 2 | 33 | 6 | 17 | 10 | 1 | 0.74 | 1 | 5 | 3 | 0 | 2 | 4 | 2 | 12 | 77 | 16 | 35 | 21 | 32 | 26 | 26 | 21 | 23 | 1 | 1 | 0 | 2 |
576 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaTextModel | from ...modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast, ModelOutput
from ...cache_utils import Cache, DynamicCache
from .configuration_aria import AriaConfig, AriaTextConfig
from torch import nn
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple
from ...utils.generic impo... | @auto_docstring
class AriaTextModel(AriaTextPreTrainedModel):
def __init__(self, config: AriaTextConfig):
pass
@check_model_inputs
@auto_docstring
def forward(self, input_ids: Optional[torch.LongTensor]=None, attention_mask: Optional[torch.Tensor]=None, position_ids: Optional[torch.LongTensor]=... | 6 | 0 | 40 | 5 | 30 | 6 | 6 | 0.22 | 1 | 16 | 10 | 0 | 5 | 7 | 6 | 7 | 257 | 34 | 184 | 65 | 146 | 40 | 89 | 34 | 82 | 21 | 2 | 2 | 37 |
577 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaTextPreTrainedModel | from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
from ...utils import TransformersKwargs, auto_docstring, can_return_tuple
from .configuration_aria import AriaConfig, AriaTextConfig
@auto_docstring
class AriaTextPreTrainedModel(PreTrainedModel):
config: AriaTextConfig
base_model_prefix = ... | @auto_docstring
class AriaTextPreTrainedModel(PreTrainedModel):
def _init_weights(self, module):
pass | 3 | 0 | 16 | 0 | 16 | 0 | 8 | 0.12 | 1 | 1 | 1 | 2 | 1 | 0 | 1 | 1 | 30 | 2 | 25 | 11 | 23 | 3 | 22 | 11 | 20 | 8 | 1 | 2 | 8 |
578 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaTextRMSNorm | import torch
from ...integrations import use_kernel_forward_from_hub
from torch import nn
@use_kernel_forward_from_hub('RMSNorm')
class AriaTextRMSNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-06):
"""
AriaTextRMSNorm is equivalent to T5LayerNorm
"""
super().__init__()
... | @use_kernel_forward_from_hub('RMSNorm')
class AriaTextRMSNorm(nn.Module):
def __init__(self, hidden_size, eps=1e-06):
'''
AriaTextRMSNorm 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 |
579 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modeling_aria.py | transformers.models.aria.modeling_aria.AriaTextRotaryEmbedding | from .configuration_aria import AriaConfig, AriaTextConfig
from ...modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
import torch
from torch import nn
class AriaTextRotaryEmbedding(nn.Module):
inv_freq: torch.Tensor
def __init__(self, config: AriaTextConfig, device=None):
super().__i... |
class AriaTextRotaryEmbedding(nn.Module):
def __init__(self, config: AriaTextConfig, 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 |
580 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaCausalLMOutputWithPast | from ..llava.modeling_llava import LlavaCausalLMOutputWithPast, LlavaForConditionalGeneration, LlavaModel, LlavaModelOutputWithPast
class AriaCausalLMOutputWithPast(LlavaCausalLMOutputWithPast):
pass |
class AriaCausalLMOutputWithPast(LlavaCausalLMOutputWithPast):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 2 | 0 | 0 |
581 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaConfig | from ...configuration_utils import PretrainedConfig
from typing import Optional, Union
from ..auto import CONFIG_MAPPING, AutoConfig, AutoTokenizer
class AriaConfig(PretrainedConfig):
"""
This class handles the configuration for both vision and text components of the Aria model,
as well as additional param... |
class AriaConfig(PretrainedConfig):
'''
This class handles the configuration for both vision and text components of the Aria model,
as well as additional parameters for image token handling and projector mapping.
Instantiating a configuration with the defaults will yield a similar configuration to that... | 2 | 1 | 39 | 5 | 32 | 2 | 6 | 0.97 | 1 | 5 | 1 | 0 | 1 | 7 | 1 | 33 | 79 | 10 | 35 | 20 | 24 | 34 | 21 | 11 | 19 | 6 | 2 | 1 | 6 |
582 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaCrossAttention | from torch import nn
class AriaCrossAttention(nn.Module):
"""
Aria Cross-Attention module.
Args:
config (`AriaConfig`):
The configuration to use.
"""
def __init__(self, config: AriaConfig, dropout_rate: float=0):
super().__init__()
hidden_size = config.vision_c... |
class AriaCrossAttention(nn.Module):
'''
Aria Cross-Attention module.
Args:
config (`AriaConfig`):
The configuration to use.
'''
def __init__(self, config: AriaConfig, dropout_rate: float=0):
pass
def forward(self, key_value_states, hidden_states, attn_mask=None):
... | 3 | 2 | 22 | 4 | 11 | 7 | 1 | 0.91 | 1 | 3 | 1 | 0 | 2 | 9 | 2 | 12 | 53 | 11 | 22 | 18 | 19 | 20 | 22 | 18 | 19 | 1 | 1 | 0 | 2 |
583 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaForConditionalGeneration | from ..llava.modeling_llava import LlavaCausalLMOutputWithPast, LlavaForConditionalGeneration, LlavaModel, LlavaModelOutputWithPast
from typing import Optional, Union
from ...processing_utils import MultiModalData, ProcessingKwargs, ProcessorMixin, Unpack
from ...utils import TensorType, TransformersKwargs, auto_docstr... | @auto_docstring(custom_intro='\n Aria model for conditional generation tasks.\n\n This model combines a vision tower, a multi-modal projector, and a language model\n to perform tasks that involve both image and text inputs.\n ')
class AriaForConditionalGeneration(LlavaForConditionalGeneration):
def get... | 7 | 1 | 21 | 2 | 14 | 5 | 2 | 0.34 | 2 | 10 | 5 | 0 | 11 | 6 | 11 | 51 | 250 | 34 | 161 | 74 | 113 | 55 | 77 | 40 | 65 | 11 | 3 | 2 | 25 |
584 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaGroupedExpertsGemm | import torch
from torch import nn
class AriaGroupedExpertsGemm(nn.Module):
"""
Grouped GEMM (General Matrix Multiplication) module for efficient expert computation.
This module utilizes the grouped_gemm library (https://github.com/fanshiqing/grouped_gemm)
for optimized performance. If the grouped_gemm ... |
class AriaGroupedExpertsGemm(nn.Module):
'''
Grouped GEMM (General Matrix Multiplication) module for efficient expert computation.
This module utilizes the grouped_gemm library (https://github.com/fanshiqing/grouped_gemm)
for optimized performance. If the grouped_gemm library is not installed, it grace... | 3 | 2 | 12 | 1 | 6 | 5 | 1 | 1.85 | 1 | 1 | 0 | 0 | 2 | 4 | 2 | 12 | 42 | 5 | 13 | 7 | 10 | 24 | 9 | 7 | 6 | 1 | 1 | 0 | 2 |
585 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaGroupedExpertsMLP | from torch import nn
import torch
class AriaGroupedExpertsMLP(nn.Module):
"""
Grouped MLP module for Mixture of Experts.
Args:
config (`AriaTextConfig`):
Configuration object for the model.
"""
def __init__(self, config: AriaTextConfig) -> None:
super().__init__()
... |
class AriaGroupedExpertsMLP(nn.Module):
'''
Grouped MLP module for Mixture of Experts.
Args:
config (`AriaTextConfig`):
Configuration object for the model.
'''
def __init__(self, config: AriaTextConfig) -> None:
pass
def forward(self, permuted_tokens, tokens_per_ex... | 3 | 2 | 11 | 1 | 6 | 4 | 1 | 1.17 | 1 | 3 | 2 | 0 | 2 | 3 | 2 | 12 | 31 | 5 | 12 | 9 | 9 | 14 | 12 | 9 | 9 | 1 | 1 | 0 | 2 |
586 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaImageProcessor | from ...image_utils import ChannelDimension, ImageInput, PILImageResampling, get_image_size, infer_channel_dimension_format, is_scaled_image, make_flat_list_of_images, to_numpy_array, valid_images, validate_preprocess_arguments
from typing import Optional, Union
from ..llava_next.image_processing_llava_next import divi... |
class AriaImageProcessor(BaseImageProcessor):
'''
A vision processor for the Aria model that handles image preprocessing.
Initialize the AriaImageProcessor.
Args:
image_mean (`list`, *optional*, defaults to [0.5, 0.5, 0.5]):
Mean values for normalization.
image_std (`list`, ... | 9 | 7 | 60 | 6 | 33 | 22 | 5 | 0.76 | 1 | 13 | 4 | 0 | 6 | 9 | 6 | 26 | 392 | 44 | 199 | 88 | 146 | 152 | 96 | 42 | 89 | 20 | 3 | 3 | 32 |
587 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaPreTrainedModel | from ..llama.modeling_llama import LlamaAttention, LlamaDecoderLayer, LlamaForCausalLM, LlamaMLP, LlamaModel, LlamaPreTrainedModel, LlamaRMSNorm
from torch import nn
from ...modeling_utils import PreTrainedModel
class AriaPreTrainedModel(LlamaPreTrainedModel):
config: AriaConfig
base_model_prefix = ''
_can... |
class AriaPreTrainedModel(LlamaPreTrainedModel):
def _init_weights(self, module):
pass | 2 | 0 | 12 | 0 | 12 | 0 | 6 | 0.07 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 2 | 16 | 1 | 15 | 5 | 13 | 1 | 13 | 5 | 11 | 6 | 2 | 2 | 6 |
588 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaProcessor | import numpy as np
from ..auto import CONFIG_MAPPING, AutoConfig, AutoTokenizer
from typing import Optional, Union
from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_patch_output_size, select_best_resolution
from ...processing_utils import MultiModalData, ProcessingKwargs, ProcessorMixin, Unpac... |
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 |
589 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaProcessorKwargs | from ...utils import TensorType, TransformersKwargs, auto_docstring, can_return_tuple, logging
from ...processing_utils import MultiModalData, ProcessingKwargs, ProcessorMixin, Unpack
class AriaProcessorKwargs(ProcessingKwargs, total=False):
_defaults = {'text_kwargs': {'padding': False, 'return_mm_token_type_ids'... |
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 |
590 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaProjector | import torch
from typing import Optional, Union
from torch import nn
class AriaProjector(nn.Module):
"""
Aria Projector module.
This module projects vision features into the language model's embedding space, enabling interaction between vision and language components.
Args:
config (`AriaConfi... |
class AriaProjector(nn.Module):
'''
Aria Projector module.
This module projects vision features into the language model's embedding space, enabling interaction between vision and language components.
Args:
config (`AriaConfig`):
Configuration object for the model.
'''
def _... | 3 | 2 | 26 | 6 | 15 | 5 | 2 | 0.57 | 1 | 6 | 3 | 0 | 2 | 10 | 2 | 12 | 63 | 16 | 30 | 21 | 24 | 17 | 25 | 18 | 22 | 3 | 1 | 1 | 4 |
591 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaProjectorMLP | from ...activations import ACT2FN
from torch import nn
class AriaProjectorMLP(nn.Module):
"""
Feed-Forward Network module for the Aria Projector.
Args:
in_features (`int`):
Input embedding dimension.
hidden_features (`int`):
Hidden dimension of the feed-forward netw... |
class AriaProjectorMLP(nn.Module):
'''
Feed-Forward Network module for the Aria Projector.
Args:
in_features (`int`):
Input embedding dimension.
hidden_features (`int`):
Hidden dimension of the feed-forward network.
output_dim (`int`):
Output dime... | 3 | 1 | 5 | 0 | 5 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 2 | 3 | 2 | 12 | 23 | 3 | 10 | 6 | 7 | 10 | 10 | 6 | 7 | 1 | 1 | 0 | 2 |
592 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaSharedExpertsMLP | from ..llama.modeling_llama import LlamaAttention, LlamaDecoderLayer, LlamaForCausalLM, LlamaMLP, LlamaModel, LlamaPreTrainedModel, LlamaRMSNorm
class AriaSharedExpertsMLP(LlamaMLP):
"""
Shared Expert MLP for shared experts.
Unlike routed experts, shared experts process all tokens without routing.
Thi... |
class AriaSharedExpertsMLP(LlamaMLP):
'''
Shared Expert MLP for shared experts.
Unlike routed experts, shared experts process all tokens without routing.
This class reconfigures the intermediate size in comparison to the LlamaMLP.
Args:
config (`AriaTextConfig`): Configuration object for th... | 2 | 1 | 3 | 0 | 3 | 0 | 1 | 1.75 | 1 | 2 | 1 | 0 | 1 | 1 | 1 | 13 | 14 | 3 | 4 | 3 | 2 | 7 | 4 | 3 | 2 | 1 | 2 | 0 | 1 |
593 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaTextConfig | from ..llama.configuration_llama import LlamaConfig
class AriaTextConfig(LlamaConfig):
"""
This class handles the configuration for the text component of the Aria model.
Instantiating a configuration with the defaults will yield a similar configuration to that of the model of the Aria
[rhymes-ai/Aria](... |
class AriaTextConfig(LlamaConfig):
'''
This class handles the configuration for the text component of the Aria model.
Instantiating a configuration with the defaults will yield a similar configuration to that of the model of the Aria
[rhymes-ai/Aria](https://huggingface.co/rhymes-ai/Aria) architecture.... | 2 | 1 | 14 | 0 | 14 | 0 | 1 | 6.12 | 1 | 2 | 0 | 0 | 1 | 4 | 1 | 2 | 124 | 3 | 17 | 16 | 7 | 104 | 9 | 8 | 7 | 1 | 2 | 0 | 1 |
594 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaTextDecoderLayer | from ..llama.modeling_llama import LlamaAttention, LlamaDecoderLayer, LlamaForCausalLM, LlamaMLP, LlamaModel, LlamaPreTrainedModel, LlamaRMSNorm
class AriaTextDecoderLayer(LlamaDecoderLayer):
"""
Aria Text Decoder Layer.
This class defines a single decoder layer in the language model, incorporating self-a... |
class AriaTextDecoderLayer(LlamaDecoderLayer):
'''
Aria Text Decoder Layer.
This class defines a single decoder layer in the language model, incorporating self-attention and Mixture of Experts (MoE) feed-forward network.
Args:
config (`AriaTextConfig`):
Configuration object for the ... | 2 | 1 | 3 | 0 | 3 | 0 | 1 | 2.25 | 1 | 4 | 2 | 0 | 1 | 1 | 1 | 13 | 16 | 3 | 4 | 3 | 2 | 9 | 4 | 3 | 2 | 1 | 2 | 0 | 1 |
595 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaTextForCausalLM | from torch import nn
from ...utils import TensorType, TransformersKwargs, auto_docstring, can_return_tuple, logging
from ..llama.modeling_llama import LlamaAttention, LlamaDecoderLayer, LlamaForCausalLM, LlamaMLP, LlamaModel, LlamaPreTrainedModel, LlamaRMSNorm
class AriaTextForCausalLM(AriaTextPreTrainedModel, LlamaFo... |
class AriaTextForCausalLM(AriaTextPreTrainedModel, LlamaForCausalLM):
def __init__(self, config: AriaTextConfig):
pass
@auto_docstring
def forward(self, **super_kwargs):
pass | 4 | 0 | 8 | 1 | 6 | 1 | 1 | 1 | 2 | 3 | 2 | 0 | 1 | 3 | 1 | 140 | 23 | 5 | 9 | 7 | 7 | 9 | 9 | 7 | 7 | 1 | 3 | 0 | 1 |
596 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaTextMoELayer | import torch
from torch import nn
class AriaTextMoELayer(nn.Module):
"""
Aria Text Mixture of Experts (MoE) Layer.
This layer applies a gating mechanism to route input tokens to different experts.
Args:
config (`AriaTextConfig`):
Configuration object for the text component of the ... |
class AriaTextMoELayer(nn.Module):
'''
Aria Text Mixture of Experts (MoE) Layer.
This layer applies a gating mechanism to route input tokens to different experts.
Args:
config (`AriaTextConfig`):
Configuration object for the text component of the model.
'''
def __init__(sel... | 3 | 2 | 33 | 6 | 17 | 10 | 1 | 0.74 | 1 | 5 | 3 | 0 | 2 | 4 | 2 | 12 | 77 | 16 | 35 | 21 | 32 | 26 | 26 | 21 | 23 | 1 | 1 | 0 | 2 |
597 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaTextModel | from ..llama.modeling_llama import LlamaAttention, LlamaDecoderLayer, LlamaForCausalLM, LlamaMLP, LlamaModel, LlamaPreTrainedModel, LlamaRMSNorm
from torch import nn
class AriaTextModel(LlamaModel):
def __init__(self, config: AriaTextConfig):
super().__init__(config)
self.layers = nn.ModuleList([A... |
class AriaTextModel(LlamaModel):
def __init__(self, config: AriaTextConfig):
pass | 2 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 4 | 2 | 0 | 1 | 2 | 1 | 8 | 8 | 0 | 8 | 4 | 6 | 0 | 6 | 4 | 4 | 1 | 3 | 0 | 1 |
598 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaTextPreTrainedModel | from ...utils import TensorType, TransformersKwargs, auto_docstring, can_return_tuple, logging
from ...modeling_utils import PreTrainedModel
@auto_docstring
class AriaTextPreTrainedModel(PreTrainedModel):
config: AriaTextConfig
base_model_prefix = 'model'
_no_split_modules = ['AriaTextDecoderLayer', 'AriaG... | @auto_docstring
class AriaTextPreTrainedModel(PreTrainedModel):
def _init_weights(self, module):
pass | 3 | 0 | 16 | 0 | 16 | 0 | 8 | 0.12 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 130 | 30 | 2 | 25 | 11 | 23 | 3 | 22 | 11 | 20 | 8 | 2 | 2 | 8 |
599 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/models/aria/modular_aria.py | transformers.models.aria.modular_aria.AriaTextRMSNorm | from ..llama.modeling_llama import LlamaAttention, LlamaDecoderLayer, LlamaForCausalLM, LlamaMLP, LlamaModel, LlamaPreTrainedModel, LlamaRMSNorm
class AriaTextRMSNorm(LlamaRMSNorm):
pass |
class AriaTextRMSNorm(LlamaRMSNorm):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 2 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.