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
5,700
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.RelativePositionBiasVertical
from torch import Tensor, nn from typing import Any, Optional, Union class RelativePositionBiasVertical(RelativePositionBiasBase): def __init__(self, scaling_factor=100, max_distance=100, **kwargs): """ Represents in the bucket embeddings vertical distance between two tokens. Parameters are the sa...
class RelativePositionBiasVertical(RelativePositionBiasBase): def __init__(self, scaling_factor=100, max_distance=100, **kwargs): ''' Represents in the bucket embeddings vertical distance between two tokens. Parameters are the same as in base class ''' pass ...
3
1
8
1
5
3
2
0.5
1
5
0
0
2
0
2
37
17
2
10
4
7
5
10
4
7
3
5
1
4
5,701
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopAttention
from ...pytorch_utils import find_pruneable_heads_and_indices, prune_linear_layer import torch from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache import math from ...utils.deprecation import deprecate_kwarg from transformers import UdopConfig from torch import Tensor, nn from typing import Any, Optiona...
class UdopAttention(nn.Module): def __init__(self, config: UdopConfig, has_relative_attention_bias=False, layer_idx: Optional[int]=None): pass def prune_heads(self, heads): pass @staticmethod def _relative_position_bucket(relative_position, bidirectional=True, num_buckets=32, max_dist...
8
3
44
5
32
8
5
0.26
1
5
0
0
4
17
5
15
226
28
160
67
136
42
113
49
107
16
1
3
26
5,702
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopBlock
from ...utils.deprecation import deprecate_kwarg from torch import Tensor, nn from ...modeling_layers import GradientCheckpointingLayer from typing import Any, Optional, Union import torch class UdopBlock(GradientCheckpointingLayer): def __init__(self, config, has_relative_attention_bias=False, layer_idx: Optiona...
class UdopBlock(GradientCheckpointingLayer): def __init__(self, config, has_relative_attention_bias=False, layer_idx: Optional[int]=None): pass @deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58') def forward(self, hidden_states, attention_mask=None, position_bias=None, e...
4
0
49
5
42
4
4
0.08
1
5
3
0
2
2
2
12
100
11
84
26
66
7
33
11
30
6
1
2
8
5,703
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopCellEmbeddings
from torch import Tensor, nn import torch class UdopCellEmbeddings(nn.Module): def __init__(self, max_2d_position_embeddings=501, hidden_size=1024): super().__init__() self.max_2d_position_embeddings = max_2d_position_embeddings self.x_position_embeddings = nn.Embedding(max_2d_position_emb...
class UdopCellEmbeddings(nn.Module): def __init__(self, max_2d_position_embeddings=501, hidden_size=1024): pass def forward(self, bbox): pass
3
0
11
2
10
0
1
0
1
1
0
0
2
3
2
12
24
4
20
11
17
0
15
11
12
1
1
0
2
5,704
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopDenseActDense
from ...activations import ACT2FN import torch from torch import Tensor, nn from transformers import UdopConfig class UdopDenseActDense(nn.Module): def __init__(self, config: UdopConfig): super().__init__() self.wi = nn.Linear(config.d_model, config.d_ff, bias=False) self.wo = nn.Linear(co...
class UdopDenseActDense(nn.Module): def __init__(self, config: UdopConfig): pass def forward(self, hidden_states): pass
3
0
9
0
9
0
2
0
1
3
0
0
2
4
2
12
20
1
19
7
16
0
15
7
12
2
1
1
3
5,705
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopDenseGatedActDense
from ...activations import ACT2FN import torch from torch import Tensor, nn from transformers import UdopConfig class UdopDenseGatedActDense(nn.Module): def __init__(self, config: UdopConfig): super().__init__() self.wi_0 = nn.Linear(config.d_model, config.d_ff, bias=False) self.wi_1 = nn....
class UdopDenseGatedActDense(nn.Module): def __init__(self, config: UdopConfig): pass def forward(self, hidden_states): pass
3
0
13
1
10
2
2
0.14
1
3
0
0
2
5
2
12
27
3
21
10
18
3
17
10
14
2
1
1
3
5,706
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopEncoderModel
from typing import Any, Optional, Union from torch import Tensor, nn from copy import deepcopy from transformers import UdopConfig import torch from ...utils import ModelOutput, auto_docstring, is_torch_flex_attn_available, is_torchdynamo_compiling @auto_docstring class UdopEncoderModel(UdopPreTrainedModel): _tied...
@auto_docstring class UdopEncoderModel(UdopPreTrainedModel): def __init__(self, config: UdopConfig): pass def get_input_embeddings(self): pass def set_input_embeddings(self, new_embeddings): pass def get_encoder(self): pass def _prune_heads(self, heads_to_prune):...
9
2
15
2
9
5
2
0.48
1
9
3
0
6
3
6
8
105
16
60
27
39
29
28
14
21
4
2
1
10
5,707
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopForConditionalGeneration
from ...generation import GenerationMixin from copy import deepcopy from torch import Tensor, nn from torch.nn import CrossEntropyLoss import torch from transformers.modeling_outputs import Seq2SeqLMOutput, Seq2SeqModelOutput from ...utils import ModelOutput, auto_docstring, is_torch_flex_attn_available, is_torchdynamo...
@auto_docstring(custom_intro='\n The UDOP encoder-decoder Transformer with a language modeling head on top, enabling to generate text given document\n images and an optional prompt.\n\n This class is based on [`T5ForConditionalGeneration`], extended to deal with images and layout (2D) data.\n ') class UdopF...
8
1
22
3
14
5
3
0.31
2
9
2
0
9
5
9
11
221
35
142
53
108
44
69
30
59
10
2
2
23
5,708
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopLayerCrossAttention
from typing import Any, Optional, Union from ...utils.deprecation import deprecate_kwarg from torch import Tensor, nn class UdopLayerCrossAttention(nn.Module): def __init__(self, config, layer_idx: Optional[int]=None): super().__init__() self.EncDecAttention = UdopAttention(config, has_relative_at...
class UdopLayerCrossAttention(nn.Module): def __init__(self, config, layer_idx: Optional[int]=None): pass @deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58') def forward(self, hidden_states, key_value_states, attention_mask=None, position_bias=None, layer_head_mask=None,...
4
0
17
0
17
1
1
0.03
1
4
2
0
2
3
2
12
36
1
35
22
20
1
12
10
9
1
1
0
2
5,709
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopLayerFF
from torch import Tensor, nn from transformers import UdopConfig class UdopLayerFF(nn.Module): def __init__(self, config: UdopConfig): super().__init__() if config.is_gated_act: self.DenseReluDense = UdopDenseGatedActDense(config) else: self.DenseReluDense = UdopDen...
class UdopLayerFF(nn.Module): def __init__(self, config: UdopConfig): pass def forward(self, hidden_states): pass
3
0
7
1
7
0
2
0
1
5
3
0
2
3
2
12
16
2
14
7
11
0
13
7
10
2
1
1
3
5,710
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopLayerNorm
import torch from torch import Tensor, nn class UdopLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-06): """ Construct a layernorm module in the Udop style. No bias and no subtraction of mean. """ super().__init__() self.weight = nn.Parameter(torch.ones(hidden_...
class UdopLayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-06): ''' Construct a layernorm module in the Udop style. No bias and no subtraction of mean. ''' pass def forward(self, hidden_states): pass
3
1
11
2
5
4
2
0.73
1
1
0
0
2
2
2
12
23
4
11
6
8
8
11
6
8
2
1
1
3
5,711
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopLayerSelfAttention
from ...utils.deprecation import deprecate_kwarg from typing import Any, Optional, Union from torch import Tensor, nn class UdopLayerSelfAttention(nn.Module): def __init__(self, config, has_relative_attention_bias=False, layer_idx: Optional[int]=None): super().__init__() self.SelfAttention = UdopA...
class UdopLayerSelfAttention(nn.Module): def __init__(self, config, has_relative_attention_bias=False, layer_idx: Optional[int]=None): pass @deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58') def forward(self, hidden_states, attention_mask=None, position_bias=None, layer...
4
0
16
0
16
1
1
0.03
1
4
2
0
2
3
2
12
34
1
33
19
20
1
12
9
9
1
1
0
2
5,712
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopModel
from torch import Tensor, nn from copy import deepcopy import torch from transformers.modeling_outputs import Seq2SeqLMOutput, Seq2SeqModelOutput from typing import Any, Optional, Union from ...utils import ModelOutput, auto_docstring, is_torch_flex_attn_available, is_torchdynamo_compiling from ...cache_utils import Ca...
@auto_docstring class UdopModel(UdopPreTrainedModel): def __init__(self, config): pass def get_input_embeddings(self): pass def set_input_embeddings(self, new_embeddings): pass def get_encoder(self): pass @auto_docstring def forward(self, input_ids: Optional[T...
8
1
23
3
16
5
2
0.31
1
10
2
0
6
4
6
8
157
21
104
40
74
32
40
17
33
6
2
1
11
5,713
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopPatchEmbeddings
import collections from torch import Tensor, nn class UdopPatchEmbeddings(nn.Module): """2D Image to Patch Embeddings""" def __init__(self, config): super().__init__() image_size, patch_size = (config.image_size, config.patch_size) num_channels, hidden_size = (config.num_channels, conf...
class UdopPatchEmbeddings(nn.Module): '''2D Image to Patch Embeddings''' def __init__(self, config): pass def forward(self, pixel_values): pass
3
1
12
1
11
0
3
0.04
1
2
0
0
2
5
2
12
28
4
23
13
20
1
20
13
17
3
1
1
5
5,714
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopPreTrainedModel
import torch from torch import Tensor, nn from ...modeling_utils import PreTrainedModel from transformers import UdopConfig from ...utils import ModelOutput, auto_docstring, is_torch_flex_attn_available, is_torchdynamo_compiling @auto_docstring class UdopPreTrainedModel(PreTrainedModel): config: UdopConfig bas...
@auto_docstring class UdopPreTrainedModel(PreTrainedModel): def _init_weights(self, module): '''Initialize the weights''' pass def _shift_right(self, input_ids): pass
4
1
41
3
32
7
10
0.25
1
7
7
4
2
0
2
2
96
8
71
16
68
18
58
16
55
19
1
2
20
5,715
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/modeling_udop.py
transformers.models.udop.modeling_udop.UdopStack
from transformers import UdopConfig from ...modeling_attn_mask_utils import AttentionMaskConverter from ...utils import ModelOutput, auto_docstring, is_torch_flex_attn_available, is_torchdynamo_compiling from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache from typing import Any, Optional, Union import t...
class UdopStack(UdopPreTrainedModel): ''' This class is based on `T5Stack`, but modified to take into account the image modality as well as 2D position embeddings. ''' def __init__(self, config, embed_tokens=None, embed_patches=None): pass def _tie_weights(self): pass @sta...
11
2
42
4
32
5
7
0.19
1
20
11
0
7
10
9
11
395
49
295
90
247
55
159
52
149
44
2
3
66
5,716
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/processing_udop.py
transformers.models.udop.processing_udop.UdopProcessor
from ...image_processing_utils import BatchFeature from ...processing_utils import ProcessingKwargs, ProcessorMixin, TextKwargs, Unpack from ...tokenization_utils_base import PreTokenizedInput, TextInput from ...image_utils import ImageInput from typing import Optional, Union class UdopProcessor(ProcessorMixin): "...
class UdopProcessor(ProcessorMixin): ''' Constructs a UDOP processor which combines a LayoutLMv3 image processor and a UDOP tokenizer into a single processor. [`UdopProcessor`] offers all the functionalities you need to prepare data for the model. It first uses [`LayoutLMv3ImageProcessor`] to resize, r...
6
2
20
3
13
5
3
0.63
1
5
2
0
6
0
6
23
159
26
82
33
66
52
53
24
46
10
2
3
17
5,717
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/processing_udop.py
transformers.models.udop.processing_udop.UdopProcessorKwargs
from ...processing_utils import ProcessingKwargs, ProcessorMixin, TextKwargs, Unpack class UdopProcessorKwargs(ProcessingKwargs, total=False): text_kwargs: UdopTextKwargs _defaults = {'text_kwargs': {'add_special_tokens': True, 'padding': False, 'truncation': False, 'stride': 0, 'return_overflowing_tokens': Fa...
class UdopProcessorKwargs(ProcessingKwargs, total=False): pass
1
0
0
0
0
0
0
0
2
0
0
0
0
0
0
0
16
0
16
2
15
0
3
2
2
0
3
0
0
5,718
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/processing_udop.py
transformers.models.udop.processing_udop.UdopTextKwargs
from typing import Optional, Union from ...processing_utils import ProcessingKwargs, ProcessorMixin, TextKwargs, Unpack class UdopTextKwargs(TextKwargs, total=False): word_labels: Optional[Union[list[int], list[list[int]]]] boxes: Union[list[list[int]], list[list[list[int]]]]
class UdopTextKwargs(TextKwargs, total=False): pass
1
0
0
0
0
0
0
0
2
0
0
0
0
0
0
0
3
0
3
1
2
0
3
1
2
0
2
0
0
5,719
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/tokenization_udop.py
transformers.models.udop.tokenization_udop.UdopTokenizer
import warnings import sentencepiece as spm import os from ...tokenization_utils_base import AddedToken, BatchEncoding, EncodedInput, PreTokenizedInput, TextInput, TextInputPair, TruncationStrategy from ...tokenization_utils import PreTrainedTokenizer from shutil import copyfile from ...utils.import_utils import requir...
@requires(backends=('sentencepiece',)) class UdopTokenizer(PreTrainedTokenizer): ''' Adapted from [`LayoutXLMTokenizer`] and [`T5Tokenizer`]. Based on [SentencePiece](https://github.com/google/sentencepiece). This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. U...
35
18
42
3
31
8
5
0.35
1
17
2
0
28
9
28
117
1,336
131
896
331
635
317
355
98
325
29
3
4
143
5,720
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/udop/tokenization_udop_fast.py
transformers.models.udop.tokenization_udop_fast.UdopTokenizerFast
import os from ...tokenization_utils_base import BatchEncoding, EncodedInput, PreTokenizedInput, TextInput, TextInputPair, TruncationStrategy from ...tokenization_utils_fast import PreTrainedTokenizerFast from shutil import copyfile from typing import Optional, Union from ...utils import PaddingStrategy, TensorType, ad...
class UdopTokenizerFast(PreTrainedTokenizerFast): ''' Construct a "fast" UDOP tokenizer (backed by HuggingFace's *tokenizers* library). Adapted from [`LayoutXLMTokenizer`] and [`T5Tokenizer`]. Based on [BPE](https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models). ...
17
8
55
4
41
10
6
0.3
1
15
2
0
14
5
14
102
881
84
613
237
424
186
210
64
194
24
3
6
94
5,721
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/configuration_umt5.py
transformers.models.umt5.configuration_umt5.UMT5Config
from ...configuration_utils import PretrainedConfig class UMT5Config(PretrainedConfig): """ This is the configuration class to store the configuration of a [`UMT5Model`]. It is used to instantiate a UMT5 model according to the specified arguments, defining the model architecture. Instantiating a configurat...
class UMT5Config(PretrainedConfig): ''' This is the configuration class to store the configuration of a [`UMT5Model`]. It is used to instantiate a UMT5 model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar confi...
2
1
66
4
62
1
4
0.61
1
2
0
0
1
17
1
1
121
8
71
47
45
43
28
23
26
4
1
1
4
5,722
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/configuration_umt5.py
transformers.models.umt5.configuration_umt5.UMT5OnnxConfig
from ...onnx import OnnxSeq2SeqConfigWithPast from collections.abc import Mapping class UMT5OnnxConfig(OnnxSeq2SeqConfigWithPast): @property def inputs(self) -> Mapping[str, Mapping[int, str]]: common_inputs = {'input_ids': {0: 'batch', 1: 'encoder_sequence'}, 'attention_mask': {0: 'batch', 1: 'encode...
class UMT5OnnxConfig(OnnxSeq2SeqConfigWithPast): @property def inputs(self) -> Mapping[str, Mapping[int, str]]: pass @property def default_onnx_opset(self) -> int: pass @property def atol_for_validation(self) -> float: pass
7
0
7
1
6
0
2
0.09
1
3
0
0
3
0
3
3
29
4
23
8
16
2
16
5
12
3
1
1
5
5,723
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5Attention
from typing import Optional, Union from ...utils.deprecation import deprecate_kwarg import math from torch import nn import torch from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache class UMT5Attention(nn.Module): """ T5's attention using relative_attention_bias. """ def __init__(self,...
class UMT5Attention(nn.Module): ''' T5's attention using relative_attention_bias. ''' def __init__(self, config, has_relative_attention_bias=False, layer_idx: Optional[int]=None): pass def _shape(self, projection: torch.Tensor) -> torch.Tensor: pass def _relative_position_buc...
7
3
37
5
26
7
4
0.29
1
5
0
0
5
16
5
15
192
28
129
61
115
38
103
53
97
13
1
3
22
5,724
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5Block
from torch import nn import torch from typing import Optional, Union from ...modeling_layers import GradientCheckpointingLayer from ...utils.deprecation import deprecate_kwarg class UMT5Block(GradientCheckpointingLayer): def __init__(self, config, layer_idx: Optional[int]=None): super().__init__() ...
class UMT5Block(GradientCheckpointingLayer): def __init__(self, config, layer_idx: Optional[int]=None): pass @deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58') def forward(self, hidden_states, attention_mask=None, encoder_hidden_states=None, encoder_attention_mask=None,...
4
0
36
4
30
3
4
0.08
1
5
3
0
2
2
2
12
74
9
60
23
45
5
32
11
29
6
1
2
8
5,725
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5ClassificationHead
import torch from torch import nn from .configuration_umt5 import UMT5Config class UMT5ClassificationHead(nn.Module): """Head for sentence-level classification tasks.""" def __init__(self, config: UMT5Config): super().__init__() self.dense = nn.Linear(config.d_model, config.d_model) se...
class UMT5ClassificationHead(nn.Module): '''Head for sentence-level classification tasks.''' def __init__(self, config: UMT5Config): pass def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: pass
3
1
6
0
6
0
1
0.08
1
3
1
0
2
3
2
12
16
2
13
6
10
1
13
6
10
1
1
0
2
5,726
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5DenseActDense
from ...activations import ACT2FN import torch from torch import nn from .configuration_umt5 import UMT5Config class UMT5DenseActDense(nn.Module): def __init__(self, config: UMT5Config): super().__init__() self.wi = nn.Linear(config.d_model, config.d_ff, bias=False) self.wo = nn.Linear(con...
class UMT5DenseActDense(nn.Module): def __init__(self, config: UMT5Config): pass def forward(self, hidden_states): pass
3
0
9
0
9
0
2
0
1
3
1
0
2
4
2
12
20
1
19
7
16
0
15
7
12
2
1
1
3
5,727
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5DenseGatedActDense
import torch from torch import nn from .configuration_umt5 import UMT5Config from ...activations import ACT2FN class UMT5DenseGatedActDense(nn.Module): def __init__(self, config: UMT5Config): super().__init__() self.wi_0 = nn.Linear(config.d_model, config.d_ff, bias=False) self.wi_1 = nn.L...
class UMT5DenseGatedActDense(nn.Module): def __init__(self, config: UMT5Config): pass def forward(self, hidden_states): pass
3
0
13
1
10
2
2
0.14
1
3
1
0
2
5
2
12
27
3
21
10
18
3
17
10
14
2
1
1
3
5,728
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5EncoderModel
from torch import nn import torch from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Seq2SeqLMOutput, Seq2SeqModelOutput, Seq2SeqQuestionAnsweringModelOutput, Seq2SeqSequenceClassifierOutput, TokenClassifierOutput from ...utils import DUMMY_INPUTS, DUMMY_MASK, auto_docstring, is...
@auto_docstring class UMT5EncoderModel(UMT5PreTrainedModel): ''' Examples: ```python >>> from transformers import UMT5EncoderModel, AutoTokenizer >>> model = UMT5EncoderModel.from_pretrained("google/umt5-small") >>> tokenizer = AutoTokenizer.from_pretrained("google/umt5-small") >>> article =...
10
3
10
1
6
3
1
0.77
1
4
2
0
7
2
7
10
100
17
47
25
28
36
28
15
20
2
2
1
10
5,729
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5ForConditionalGeneration
from torch import nn import torch from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Seq2SeqLMOutput, Seq2SeqModelOutput, Seq2SeqQuestionAnsweringModelOutput, Seq2SeqSequenceClassifierOutput, TokenClassifierOutp...
@auto_docstring(custom_intro='\n UMT5 Model with a `language modeling` head on top.\n ') class UMT5ForConditionalGeneration(UMT5PreTrainedModel, GenerationMixin): ''' Examples: ```python >>> from transformers import UMT5ForConditionalGeneration, AutoTokenizer >>> model = UMT5ForConditionalGene...
10
2
16
2
11
3
2
0.39
2
7
3
0
10
5
11
14
214
36
128
51
94
50
67
30
55
12
2
1
24
5,730
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5ForQuestionAnswering
from ...utils import DUMMY_INPUTS, DUMMY_MASK, auto_docstring, is_torch_flex_attn_available, is_torch_fx_proxy, is_torchdynamo_compiling, logging from typing import Optional, Union from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss import copy from torch import nn import torch from ...modeling_outputs im...
@auto_docstring class UMT5ForQuestionAnswering(UMT5PreTrainedModel): def __init__(self, config): pass def get_input_embeddings(self): pass def set_input_embeddings(self, new_embeddings): pass def _tie_weights(self): pass def get_encoder(self): pass @a...
9
1
23
2
18
3
3
0.18
1
7
3
0
7
6
7
10
179
23
132
47
104
24
71
28
63
17
2
2
24
5,731
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5ForSequenceClassification
import torch from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Seq2SeqLMOutput, Seq2SeqModelOutput, Seq2SeqQuestionAnsweringModelOutput, Seq2SeqSequenceClassifierOutput, TokenClassifierOutput from ...utils import DUMMY_INPUTS, DUMMY_MASK, auto_docstring, is_torch_flex_attn_avai...
@auto_docstring(custom_intro='\n UMT5 model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE\n tasks.\n ') class UMT5ForSequenceClassification(UMT5PreTrainedModel): def __init__(self, config: UMT5Config): pass @auto_docstring def forward...
5
1
59
5
49
5
9
0.1
1
10
4
0
2
3
2
5
125
12
103
35
81
10
48
17
45
17
2
3
18
5,732
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5ForTokenClassification
from torch import nn import torch from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Seq2SeqLMOutput, Seq2SeqModelOutput, Seq2SeqQuestionAnsweringModelOutput, Seq2SeqSequenceClassifierOutput, TokenClassifierOutput from ...utils import DUMMY_INPUTS, DUMMY_MASK, auto_docstring, is...
@auto_docstring class UMT5ForTokenClassification(UMT5PreTrainedModel): def __init__(self, config: UMT5Config): pass @auto_docstring def forward(self, input_ids: Optional[torch.Tensor]=None, attention_mask: Optional[torch.Tensor]=None, head_mask: Optional[torch.Tensor]=None, inputs_embeds: Optional[...
5
1
29
4
22
3
3
0.16
1
6
3
0
2
4
2
5
66
9
49
26
34
8
24
15
21
5
2
1
6
5,733
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5LayerCrossAttention
from ...utils.deprecation import deprecate_kwarg from typing import Optional, Union from torch import nn class UMT5LayerCrossAttention(nn.Module): def __init__(self, config, layer_idx: Optional[int]=None): super().__init__() self.EncDecAttention = UMT5Attention(config, has_relative_attention_bias=...
class UMT5LayerCrossAttention(nn.Module): def __init__(self, config, layer_idx: Optional[int]=None): pass @deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58') def forward(self, hidden_states, encoder_hidden_states=None, attention_mask=None, layer_head_mask=None, past_key_...
4
0
13
0
13
1
1
0.04
1
4
2
0
2
3
2
12
28
1
27
18
16
1
12
10
9
1
1
0
2
5,734
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5LayerFF
from .configuration_umt5 import UMT5Config from torch import nn class UMT5LayerFF(nn.Module): def __init__(self, config: UMT5Config): super().__init__() if config.is_gated_act: self.DenseReluDense = UMT5DenseGatedActDense(config) else: self.DenseReluDense = UMT5Dens...
class UMT5LayerFF(nn.Module): def __init__(self, config: UMT5Config): pass def forward(self, hidden_states): pass
3
0
7
1
7
0
2
0
1
5
4
0
2
3
2
12
16
2
14
7
11
0
13
7
10
2
1
1
3
5,735
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5LayerNorm
import torch from torch import nn class UMT5LayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-06): """ Construct a layernorm module in the UMT5 style. No bias and no subtraction of mean. """ super().__init__() self.weight = nn.Parameter(torch.ones(hidden_size)) ...
class UMT5LayerNorm(nn.Module): def __init__(self, hidden_size, eps=1e-06): ''' Construct a layernorm module in the UMT5 style. No bias and no subtraction of mean. ''' pass def forward(self, hidden_states): pass
3
1
11
2
5
4
2
0.73
1
1
0
0
2
2
2
12
23
4
11
6
8
8
11
6
8
2
1
1
3
5,736
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5LayerSelfAttention
from ...utils.deprecation import deprecate_kwarg from typing import Optional, Union from torch import nn class UMT5LayerSelfAttention(nn.Module): def __init__(self, config, layer_idx: Optional[int]=None): super().__init__() self.SelfAttention = UMT5Attention(config, has_relative_attention_bias=Tru...
class UMT5LayerSelfAttention(nn.Module): def __init__(self, config, layer_idx: Optional[int]=None): pass @deprecate_kwarg('past_key_value', new_name='past_key_values', version='4.58') def forward(self, hidden_states, attention_mask=None, layer_head_mask=None, past_key_values=None, cache_position=N...
4
0
12
0
12
1
1
0.04
1
4
2
0
2
3
2
12
26
1
25
16
15
1
12
9
9
1
1
0
2
5,737
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5Model
from torch import nn import torch from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Seq2SeqLMOutput, Seq2SeqModelOutput, Seq2SeqQuestionAnsweringModelOutput, Seq2SeqSequenceClassifierOutput, TokenClassifierOutp...
@auto_docstring class UMT5Model(UMT5PreTrainedModel): ''' Examples: ```python >>> from transformers import UMT5Model, AutoTokenizer >>> model = UMT5Model.from_pretrained("google/umt5-small") >>> tokenizer = AutoTokenizer.from_pretrained("google/umt5-small") >>> noisy_text = "UN Offizier sagt...
10
3
17
2
12
3
2
0.43
1
6
3
0
8
3
8
11
172
26
102
39
73
44
46
20
37
8
2
1
17
5,738
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5PreTrainedModel
import torch from ...modeling_utils import PreTrainedModel from ...utils import DUMMY_INPUTS, DUMMY_MASK, auto_docstring, is_torch_flex_attn_available, is_torch_fx_proxy, is_torchdynamo_compiling, logging from .configuration_umt5 import UMT5Config @auto_docstring class UMT5PreTrainedModel(PreTrainedModel): config:...
@auto_docstring class UMT5PreTrainedModel(PreTrainedModel): @property def dummy_inputs(self): pass def _init_weights(self, module): '''Initialize the weights''' pass def _shift_right(self, input_ids): pass
6
1
33
1
28
4
8
0.17
1
11
10
7
3
0
3
3
117
8
94
22
89
16
71
21
67
19
1
2
24
5,739
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/umt5/modeling_umt5.py
transformers.models.umt5.modeling_umt5.UMT5Stack
from torch import nn import torch from ...cache_utils import Cache, DynamicCache, EncoderDecoderCache from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Seq2SeqLMOutput, Seq2SeqModelOutput, Seq2SeqQuestionAnsweringModelOutput, Seq2SeqSequenceClassifierOutput, TokenClassifierOutp...
class UMT5Stack(UMT5PreTrainedModel): def __init__(self, config, embed_tokens=None): pass def set_input_embeddings(self, new_embeddings): pass def forward(self, input_ids=None, attention_mask=None, encoder_hidden_states=None, encoder_attention_mask=None, inputs_embeds=None, head_mask=Non...
7
1
56
5
44
7
10
0.16
1
16
8
0
5
6
6
9
342
36
265
77
226
43
138
45
131
43
2
3
59
5,740
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/configuration_unispeech.py
transformers.models.unispeech.configuration_unispeech.UniSpeechConfig
import operator import functools from ...configuration_utils import PretrainedConfig class UniSpeechConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`UniSpeechModel`]. It is used to instantiate an UniSpeech model according to the specified arguments, defining t...
null
4
1
60
3
55
2
2
1.34
1
3
0
0
2
45
2
2
280
16
113
100
59
151
53
49
50
2
1
1
3
5,741
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechAttention
from .configuration_unispeech import UniSpeechConfig import torch.nn as nn from typing import Callable, Optional, Union import torch from ...processing_utils import Unpack from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel from ...modeling_flash_attention_utils import FlashAttentionKwargs class Uni...
class UniSpeechAttention(nn.Module): '''Multi-headed attention from 'Attention Is All You Need' paper''' def __init__(self, embed_dim: int, num_heads: int, dropout: float=0.0, is_decoder: bool=False, bias: bool=True, is_causal: bool=False, config: Optional[UniSpeechConfig]=None): pass def forward...
3
2
50
7
35
8
5
0.24
1
7
1
2
3
12
3
13
156
23
107
44
86
26
68
27
64
12
1
2
15
5,742
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechAttnAdapterLayer
import torch import torch.nn as nn class UniSpeechAttnAdapterLayer(nn.Module): def __init__(self, config): """ Implements adapter modules directly with 3D tensor weight as parameters and without using ModuleList to speed up training throughput. """ super().__init__() ...
class UniSpeechAttnAdapterLayer(nn.Module): def __init__(self, config): ''' Implements adapter modules directly with 3D tensor weight as parameters and without using ModuleList to speed up training throughput. ''' pass def forward(self, hidden_states: torch.FloatTensor...
3
1
11
2
7
2
1
0.27
1
1
0
0
2
6
2
12
23
4
15
9
12
4
15
9
12
1
1
0
2
5,743
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechEncoder
from ...integrations.fsdp import is_fsdp_managed_module from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, Wav2Vec2BaseModelOutput from ...integrations.deepspeed import is_deepspeed_zero3_enabled from typing import Callable, Optional, Union import torch.nn as nn from...
class UniSpeechEncoder(nn.Module): def __init__(self, config): pass def forward(self, hidden_states: torch.tensor, attention_mask: Optional[torch.Tensor]=None, output_attentions: bool=False, output_hidden_states: bool=False, return_dict: bool=True): pass def _update_full_mask(self, atten...
4
0
41
5
33
3
8
0.07
1
8
3
0
2
7
2
12
83
11
67
26
57
5
45
19
42
15
1
3
16
5,744
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechEncoderLayer
from ...modeling_layers import GradientCheckpointingLayer import torch.nn as nn class UniSpeechEncoderLayer(GradientCheckpointingLayer): def __init__(self, config): super().__init__() self.attention = UniSpeechAttention(embed_dim=config.hidden_size, num_heads=config.num_attention_heads, dropout=co...
class UniSpeechEncoderLayer(GradientCheckpointingLayer): def __init__(self, config): pass def forward(self, hidden_states, attention_mask=None, output_attentions=False): pass
3
0
16
3
13
0
2
0
1
2
1
0
2
5
2
12
33
6
27
11
24
0
20
11
17
2
1
1
3
5,745
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechEncoderLayerStableLayerNorm
from ...modeling_layers import GradientCheckpointingLayer import torch.nn as nn import torch from typing import Callable, Optional, Union class UniSpeechEncoderLayerStableLayerNorm(GradientCheckpointingLayer): def __init__(self, config): super().__init__() self.attention = UniSpeechAttention(embed...
class UniSpeechEncoderLayerStableLayerNorm(GradientCheckpointingLayer): def __init__(self, config): pass def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor]=None, output_attentions: bool=False): pass
3
0
21
3
18
0
3
0
1
5
2
0
2
6
2
12
43
6
37
17
29
0
24
12
21
3
1
1
5
5,746
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechEncoderStableLayerNorm
from ...integrations.fsdp import is_fsdp_managed_module from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, Wav2Vec2BaseModelOutput from ...integrations.deepspeed import is_deepspeed_zero3_enabled from typing import Callable, Optional, Union import torch.nn as nn from...
class UniSpeechEncoderStableLayerNorm(nn.Module): def __init__(self, config): pass def forward(self, hidden_states, attention_mask=None, output_attentions=False, output_hidden_states=False, return_dict=True): pass def _update_full_mask(self, attention_mask: Union[torch.Tensor, None], inp...
4
0
43
6
34
3
8
0.09
1
6
3
0
2
7
2
12
87
12
69
27
59
6
45
19
42
15
1
3
16
5,747
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechFeatureEncoder
import torch.nn as nn class UniSpeechFeatureEncoder(nn.Module): """Construct the features from raw audio waveform""" def __init__(self, config): super().__init__() if config.feat_extract_norm == 'group': conv_layers = [UniSpeechGroupNormConvLayer(config, layer_id=0)] + [UniSpeechNo...
class UniSpeechFeatureEncoder(nn.Module): '''Construct the features from raw audio waveform''' def __init__(self, config): pass def _freeze_parameters(self): pass def forward(self, input_values): pass
4
1
13
1
12
0
3
0.06
1
6
3
1
3
3
3
13
45
7
36
11
32
2
23
11
19
4
1
2
9
5,748
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechFeatureProjection
import torch.nn as nn class UniSpeechFeatureProjection(nn.Module): def __init__(self, config): super().__init__() self.layer_norm = nn.LayerNorm(config.conv_dim[-1], eps=config.layer_norm_eps) self.projection = nn.Linear(config.conv_dim[-1], config.hidden_size) self.dropout = nn.Dr...
class UniSpeechFeatureProjection(nn.Module): def __init__(self, config): pass def forward(self, hidden_states): pass
3
0
6
0
5
1
1
0.09
1
1
0
0
2
3
2
12
13
1
11
7
8
1
11
7
8
1
1
0
2
5,749
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechFeedForward
import torch.nn as nn from ...activations import ACT2FN class UniSpeechFeedForward(nn.Module): def __init__(self, config): super().__init__() self.intermediate_dropout = nn.Dropout(config.activation_dropout) self.intermediate_dense = nn.Linear(config.hidden_size, config.intermediate_size) ...
class UniSpeechFeedForward(nn.Module): def __init__(self, config): pass def forward(self, hidden_states): pass
3
0
10
2
9
0
2
0
1
2
0
0
2
5
2
12
22
4
18
8
15
0
17
8
14
2
1
1
3
5,750
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechForCTC
from ...utils import auto_docstring, is_torch_flex_attn_available, logging from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, Wav2Vec2BaseModelOutput from typing import Callable, Optional, Union import torch.nn as nn import warnings import torch @auto_docstring(cust...
@auto_docstring(custom_intro='\n UniSpeech Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n ') class UniSpeechForCTC(UniSpeechPreTrainedModel): def __init__(self, config, target_lang: Optional[str]=None): ''' target_lang (`str`, *optional*): ...
9
6
23
3
14
6
3
0.35
1
8
2
0
6
4
6
9
149
22
94
33
71
33
47
24
40
7
2
2
18
5,751
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechForPreTraining
from .configuration_unispeech import UniSpeechConfig import torch.nn as nn import warnings import torch from ...utils import auto_docstring, is_torch_flex_attn_available, logging from typing import Callable, Optional, Union @auto_docstring(custom_intro='\n UniSpeech Model with a vector-quantization module and ctc l...
@auto_docstring(custom_intro='\n UniSpeech Model with a vector-quantization module and ctc loss for pre-training.\n ') class UniSpeechForPreTraining(UniSpeechPreTrainedModel): def __init__(self, config: UniSpeechConfig): pass def set_gumbel_temperature(self, temperature: int): ''' ...
10
5
22
3
13
6
2
0.45
1
9
4
0
5
7
6
9
141
22
82
37
60
37
46
23
39
4
2
2
9
5,752
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechForPreTrainingOutput
from dataclasses import dataclass import torch.nn as nn import torch from ...utils import auto_docstring, is_torch_flex_attn_available, logging from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, Wav2Vec2BaseModelOutput from typing import Callable, Optional, Union @d...
@dataclass @auto_docstring(custom_intro='\n Output type of [`UniSpeechForPreTrainingOutput`], with potential hidden states and attentions.\n ') class UniSpeechForPreTrainingOutput(ModelOutput): ''' loss (*optional*, returned when model is in train mode, `torch.FloatTensor` of shape `(1,)`): Total ...
3
1
0
0
0
0
0
3.14
1
0
0
0
0
0
0
0
33
4
7
7
6
22
7
7
6
0
1
0
0
5,753
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechForSequenceClassification
from torch.nn import CrossEntropyLoss import torch.nn as nn import warnings import torch from ...utils import auto_docstring, is_torch_flex_attn_available, logging from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, Wav2Vec2BaseModelOutput from typing import Callable,...
@auto_docstring(custom_intro='\n UniSpeech Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like\n SUPERB Keyword Spotting.\n ') class UniSpeechForSequenceClassification(UniSpeechPreTrainedModel): def __init__(self, config): pass def freeze_fe...
8
4
20
2
14
4
3
0.3
1
7
2
0
5
4
5
8
117
14
80
31
59
24
46
22
40
8
2
1
15
5,754
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechGroupNormConvLayer
from ...modeling_layers import GradientCheckpointingLayer from ...activations import ACT2FN import torch.nn as nn class UniSpeechGroupNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): super().__init__() self.in_conv_dim = config.conv_dim[layer_id - 1] if layer_id >...
class UniSpeechGroupNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): pass def forward(self, hidden_states): pass
3
0
10
1
9
0
2
0
1
1
0
0
2
5
2
12
22
3
19
8
16
0
13
8
10
2
1
0
3
5,755
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechGumbelVectorQuantizer
import torch.nn as nn import torch class UniSpeechGumbelVectorQuantizer(nn.Module): """ Vector quantization using gumbel softmax. See `[CATEGORICAL REPARAMETERIZATION WITH GUMBEL-SOFTMAX](https://huggingface.co/papers/1611.01144) for more information. """ def __init__(self, config): super(...
class UniSpeechGumbelVectorQuantizer(nn.Module): ''' Vector quantization using gumbel softmax. See `[CATEGORICAL REPARAMETERIZATION WITH GUMBEL-SOFTMAX](https://huggingface.co/papers/1611.01144) for more information. ''' def __init__(self, config): pass @staticmethod def _compute_p...
5
1
20
3
14
3
2
0.27
1
2
0
0
2
5
3
13
68
12
44
19
39
12
31
18
27
2
1
1
5
5,756
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechLayerNormConvLayer
from ...modeling_layers import GradientCheckpointingLayer from ...activations import ACT2FN import torch.nn as nn class UniSpeechLayerNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): super().__init__() self.in_conv_dim = config.conv_dim[layer_id - 1] if layer_id >...
class UniSpeechLayerNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): pass def forward(self, hidden_states): pass
3
0
12
2
10
0
2
0
1
1
0
0
2
5
2
12
25
4
21
8
18
0
15
8
12
2
1
0
3
5,757
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechModel
from .configuration_unispeech import UniSpeechConfig import torch.nn as nn import torch from ...utils import auto_docstring, is_torch_flex_attn_available, logging from typing import Callable, Optional, Union @auto_docstring class UniSpeechModel(UniSpeechPreTrainedModel): def __init__(self, config: UniSpeechConfig...
@auto_docstring class UniSpeechModel(UniSpeechPreTrainedModel): def __init__(self, config: UniSpeechConfig): pass def _mask_hidden_states(self, hidden_states: torch.FloatTensor, mask_time_indices: Optional[torch.FloatTensor]=None, attention_mask: Optional[torch.LongTensor]=None): ''' M...
6
2
36
5
27
3
5
0.12
1
9
6
0
3
5
3
6
119
17
91
28
66
11
42
14
38
6
2
1
14
5,758
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechNoLayerNormConvLayer
import torch.nn as nn from ...modeling_layers import GradientCheckpointingLayer from ...activations import ACT2FN class UniSpeechNoLayerNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): super().__init__() self.in_conv_dim = config.conv_dim[layer_id - 1] if layer_id...
class UniSpeechNoLayerNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): pass def forward(self, hidden_states): pass
3
0
9
1
8
0
2
0
1
1
0
0
2
4
2
12
19
2
17
7
14
0
11
7
8
2
1
0
3
5,759
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechPositionalConvEmbedding
from ...activations import ACT2FN from ...integrations.deepspeed import is_deepspeed_zero3_enabled import torch.nn as nn class UniSpeechPositionalConvEmbedding(nn.Module): def __init__(self, config): super().__init__() self.conv = nn.Conv1d(config.hidden_size, config.hidden_size, kernel_size=confi...
class UniSpeechPositionalConvEmbedding(nn.Module): def __init__(self, config): pass def forward(self, hidden_states): pass
3
0
21
3
18
0
3
0
1
2
1
0
2
3
2
12
43
7
36
10
32
0
28
10
24
4
1
2
5
5,760
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechPreTrainedModel
from .configuration_unispeech import UniSpeechConfig import torch.nn as nn import torch from ...utils import auto_docstring, is_torch_flex_attn_available, logging import math from typing import Callable, Optional, Union from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel @auto_docstring class UniSpe...
@auto_docstring class UniSpeechPreTrainedModel(PreTrainedModel): def _init_weights(self, module): '''Initialize the weights''' pass def _get_feat_extract_output_lengths(self, input_lengths: Union[torch.LongTensor, int]): ''' Computes the output length of the convolutional layer...
6
2
16
2
12
3
3
0.27
1
5
3
4
3
0
3
3
75
10
51
16
46
14
40
16
35
9
1
2
13
5,761
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech/modeling_unispeech.py
transformers.models.unispeech.modeling_unispeech.UniSpeechSamePadLayer
import torch.nn as nn class UniSpeechSamePadLayer(nn.Module): def __init__(self, num_conv_pos_embeddings): super().__init__() self.num_pad_remove = 1 if num_conv_pos_embeddings % 2 == 0 else 0 def forward(self, hidden_states): if self.num_pad_remove > 0: hidden_states = hi...
class UniSpeechSamePadLayer(nn.Module): def __init__(self, num_conv_pos_embeddings): pass def forward(self, hidden_states): pass
3
0
4
0
4
0
2
0
1
1
0
0
2
1
2
12
9
1
8
4
5
0
8
4
5
2
1
1
4
5,762
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/configuration_unispeech_sat.py
transformers.models.unispeech_sat.configuration_unispeech_sat.UniSpeechSatConfig
import functools from ...configuration_utils import PretrainedConfig import operator class UniSpeechSatConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`UniSpeechSatModel`]. It is used to instantiate an UniSpeechSat model according to the specified arguments, d...
null
4
1
64
3
58
3
2
1.36
1
3
0
0
2
48
2
2
298
17
119
106
62
162
56
52
53
2
1
1
3
5,763
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.AMSoftmaxLoss
import torch import torch.nn as nn class AMSoftmaxLoss(nn.Module): def __init__(self, input_dim, num_labels, scale=30.0, margin=0.4): super().__init__() self.scale = scale self.margin = margin self.num_labels = num_labels self.weight = nn.Parameter(torch.randn(input_dim, nu...
class AMSoftmaxLoss(nn.Module): def __init__(self, input_dim, num_labels, scale=30.0, margin=0.4): pass def forward(self, hidden_states, labels): pass
3
0
10
1
9
0
1
0
1
1
0
0
2
5
2
12
21
3
18
14
15
0
18
14
15
1
1
0
2
5,764
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.TDNNLayer
import warnings from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging import torch import torch.nn as nn class TDNNLayer(nn.Module): def __init__(self, config, layer_id=0): super().__init__() self.in_conv_dim = config.tdnn_dim[layer_id - 1] if layer_id > 0 e...
class TDNNLayer(nn.Module): def __init__(self, config, layer_id=0): pass def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: pass
3
0
14
2
11
1
3
0.04
1
2
0
0
2
6
2
12
29
5
23
11
19
1
20
11
16
3
1
2
5
5,765
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatAttention
import torch from ...processing_utils import Unpack from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel from .configuration_unispeech_sat import UniSpeechSatConfig from typing import Callable, Optional, Union from ...modeling_flash_attention_utils import FlashAttentionKwargs import torch.nn as nn cl...
class UniSpeechSatAttention(nn.Module): '''Multi-headed attention from 'Attention Is All You Need' paper''' def __init__(self, embed_dim: int, num_heads: int, dropout: float=0.0, is_decoder: bool=False, bias: bool=True, is_causal: bool=False, config: Optional[UniSpeechSatConfig]=None): pass def f...
3
2
50
7
35
8
5
0.24
1
7
1
2
3
12
3
13
156
23
107
44
86
26
68
27
64
12
1
2
15
5,766
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatAttnAdapterLayer
import torch import torch.nn as nn class UniSpeechSatAttnAdapterLayer(nn.Module): def __init__(self, config): """ Implements adapter modules directly with 3D tensor weight as parameters and without using ModuleList to speed up training throughput. """ super().__init__() ...
class UniSpeechSatAttnAdapterLayer(nn.Module): def __init__(self, config): ''' Implements adapter modules directly with 3D tensor weight as parameters and without using ModuleList to speed up training throughput. ''' pass def forward(self, hidden_states: torch.FloatTen...
3
1
11
2
7
2
1
0.27
1
1
0
0
2
6
2
12
23
4
15
9
12
4
15
9
12
1
1
0
2
5,767
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatEncoder
import torch from ...integrations.fsdp import is_fsdp_managed_module from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, Wav2Vec2BaseModelOutput, XVectorOutput from ...integrations.deepspeed import is_deepspeed_zero3_enabled from typing import C...
class UniSpeechSatEncoder(nn.Module): def __init__(self, config): pass def forward(self, hidden_states: torch.tensor, attention_mask: Optional[torch.Tensor]=None, output_attentions: bool=False, output_hidden_states: bool=False, return_dict: bool=True): pass def _update_full_mask(self, at...
4
0
41
5
33
3
8
0.07
1
8
3
0
2
7
2
12
83
11
67
26
57
5
45
19
42
15
1
3
16
5,768
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatEncoderLayer
import torch.nn as nn from ...modeling_layers import GradientCheckpointingLayer class UniSpeechSatEncoderLayer(GradientCheckpointingLayer): def __init__(self, config): super().__init__() self.attention = UniSpeechSatAttention(embed_dim=config.hidden_size, num_heads=config.num_attention_heads, drop...
class UniSpeechSatEncoderLayer(GradientCheckpointingLayer): def __init__(self, config): pass def forward(self, hidden_states, attention_mask=None, output_attentions=False): pass
3
0
16
3
13
0
2
0
1
2
1
0
2
5
2
12
33
6
27
11
24
0
20
11
17
2
1
1
3
5,769
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatEncoderLayerStableLayerNorm
from ...modeling_layers import GradientCheckpointingLayer import torch.nn as nn import torch from typing import Callable, Optional, Union class UniSpeechSatEncoderLayerStableLayerNorm(GradientCheckpointingLayer): def __init__(self, config): super().__init__() self.attention = UniSpeechSatAttention...
class UniSpeechSatEncoderLayerStableLayerNorm(GradientCheckpointingLayer): def __init__(self, config): pass def forward(self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor]=None, output_attentions: bool=False): pass
3
0
21
3
18
0
3
0
1
5
2
0
2
6
2
12
43
6
37
17
29
0
24
12
21
3
1
1
5
5,770
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatEncoderStableLayerNorm
import torch from ...integrations.fsdp import is_fsdp_managed_module from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, Wav2Vec2BaseModelOutput, XVectorOutput from ...integrations.deepspeed import is_deepspeed_zero3_enabled from typing import C...
class UniSpeechSatEncoderStableLayerNorm(nn.Module): def __init__(self, config): pass def forward(self, hidden_states, attention_mask=None, output_attentions=False, output_hidden_states=False, return_dict=True): pass def _update_full_mask(self, attention_mask: Union[torch.Tensor, None], ...
4
0
43
6
34
3
8
0.09
1
6
3
0
2
7
2
12
87
12
69
27
59
6
45
19
42
15
1
3
16
5,771
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatFeatureEncoder
import torch.nn as nn class UniSpeechSatFeatureEncoder(nn.Module): """Construct the features from raw audio waveform""" def __init__(self, config): super().__init__() if config.feat_extract_norm == 'group': conv_layers = [UniSpeechSatGroupNormConvLayer(config, layer_id=0)] + [UniSp...
class UniSpeechSatFeatureEncoder(nn.Module): '''Construct the features from raw audio waveform''' def __init__(self, config): pass def _freeze_parameters(self): pass def forward(self, input_values): pass
4
1
13
1
12
0
3
0.06
1
6
3
1
3
3
3
13
45
7
36
11
32
2
23
11
19
4
1
2
9
5,772
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatFeatureProjection
import torch.nn as nn class UniSpeechSatFeatureProjection(nn.Module): def __init__(self, config): super().__init__() self.layer_norm = nn.LayerNorm(config.conv_dim[-1], eps=config.layer_norm_eps) self.projection = nn.Linear(config.conv_dim[-1], config.hidden_size) self.dropout = nn...
class UniSpeechSatFeatureProjection(nn.Module): def __init__(self, config): pass def forward(self, hidden_states): pass
3
0
6
0
5
1
1
0.09
1
1
0
0
2
3
2
12
13
1
11
7
8
1
11
7
8
1
1
0
2
5,773
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatFeedForward
from ...activations import ACT2FN import torch.nn as nn class UniSpeechSatFeedForward(nn.Module): def __init__(self, config): super().__init__() self.intermediate_dropout = nn.Dropout(config.activation_dropout) self.intermediate_dense = nn.Linear(config.hidden_size, config.intermediate_siz...
class UniSpeechSatFeedForward(nn.Module): def __init__(self, config): pass def forward(self, hidden_states): pass
3
0
10
2
9
0
2
0
1
2
0
0
2
5
2
12
22
4
18
8
15
0
17
8
14
2
1
1
3
5,774
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatForAudioFrameClassification
import warnings import torch from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, Wav2Vec2BaseModelOutput, XVectorOutput from typing import Callable, Op...
@auto_docstring class UniSpeechSatForAudioFrameClassification(UniSpeechSatPreTrainedModel): def __init__(self, config): pass def freeze_feature_extractor(self): ''' Calling this function will disable the gradient computation for the feature encoder so that its parameter will no...
8
4
18
2
13
4
3
0.26
1
7
2
0
5
4
5
8
104
13
73
28
51
19
39
19
33
6
2
1
13
5,775
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatForCTC
import warnings import torch from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, Wav2Vec2BaseModelOutput, XVectorOutput from typing import Callable, Op...
@auto_docstring(custom_intro='\n UniSpeechSat Model with a `language modeling` head on top for Connectionist Temporal Classification (CTC).\n ') class UniSpeechSatForCTC(UniSpeechSatPreTrainedModel): def __init__(self, config, target_lang: Optional[str]=None): ''' target_lang (`str`, *optiona...
9
6
23
3
14
6
3
0.35
1
8
2
0
6
4
6
9
149
22
94
33
71
33
47
24
40
7
2
2
18
5,776
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatForPreTraining
import warnings from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging import torch from .configuration_unispeech_sat import UniSpeechSatConfig from typing import Callable, Optional, Union import torch.nn as nn @auto_docstring(custom_intro='\n UniSpeechSat Model with a vector-...
@auto_docstring(custom_intro='\n UniSpeechSat Model with a vector-quantization module and ctc loss for pre-training.\n ') class UniSpeechSatForPreTraining(UniSpeechSatPreTrainedModel): def __init__(self, config: UniSpeechSatConfig): pass def set_gumbel_temperature(self, temperature: int): ...
10
5
21
3
12
7
2
0.54
1
9
4
0
5
9
6
9
135
21
74
36
52
40
41
22
34
4
2
2
10
5,777
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatForPreTrainingOutput
import torch from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, Wav2Vec2BaseModelOutput, XVectorOutput from typing import Callable, Optional, Union fr...
@dataclass @auto_docstring(custom_intro='\n Output type of [`UniSpeechSatForPreTrainingOutput`], with potential hidden states and attentions.\n ') class UniSpeechSatForPreTrainingOutput(ModelOutput): ''' loss (*optional*, returned when model is in train mode, `torch.FloatTensor` of shape `(1,)`): ...
3
1
0
0
0
0
0
2.75
1
0
0
0
0
0
0
0
34
4
8
8
7
22
8
8
7
0
1
0
0
5,778
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatForSequenceClassification
import warnings import torch from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, Wav2Vec2BaseModelOutput, XVectorOutput from typing import Callable, Op...
@auto_docstring(custom_intro='\n UniSpeechSat Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like\n SUPERB Keyword Spotting.\n ') class UniSpeechSatForSequenceClassification(UniSpeechSatPreTrainedModel): def __init__(self, config): pass def ...
8
4
20
2
14
4
3
0.3
1
7
2
0
5
4
5
8
117
14
80
31
59
24
46
22
40
8
2
1
15
5,779
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatForXVector
import warnings import torch from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging from ...modeling_outputs import BaseModelOutput, CausalLMOutput, ModelOutput, SequenceClassifierOutput, TokenClassifierOutput, Wav2Vec2BaseModelOutput, XVectorOutput from typing import Callable, Op...
@auto_docstring(custom_intro='\n UniSpeechSat Model with an XVector feature extraction head on top for tasks like Speaker Verification.\n ') class UniSpeechSatForXVector(UniSpeechSatPreTrainedModel): def __init__(self, config): pass def freeze_feature_extractor(self): ''' Calling...
10
5
19
3
13
4
3
0.26
1
11
4
0
6
7
6
9
144
23
97
42
73
25
63
33
55
10
2
2
19
5,780
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatGroupNormConvLayer
from ...activations import ACT2FN import torch.nn as nn from ...modeling_layers import GradientCheckpointingLayer class UniSpeechSatGroupNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): super().__init__() self.in_conv_dim = config.conv_dim[layer_id - 1] if layer_i...
class UniSpeechSatGroupNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): pass def forward(self, hidden_states): pass
3
0
10
1
9
0
2
0
1
1
0
0
2
5
2
12
22
3
19
8
16
0
13
8
10
2
1
0
3
5,781
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatGumbelVectorQuantizer
import torch import torch.nn as nn class UniSpeechSatGumbelVectorQuantizer(nn.Module): """ Vector quantization using gumbel softmax. See `[CATEGORICAL REPARAMETERIZATION WITH GUMBEL-SOFTMAX](https://huggingface.co/papers/1611.01144) for more information. """ def __init__(self, config): sup...
class UniSpeechSatGumbelVectorQuantizer(nn.Module): ''' Vector quantization using gumbel softmax. See `[CATEGORICAL REPARAMETERIZATION WITH GUMBEL-SOFTMAX](https://huggingface.co/papers/1611.01144) for more information. ''' def __init__(self, config): pass @staticmethod def _comput...
5
1
20
3
14
3
2
0.27
1
2
0
0
2
5
3
13
68
12
44
19
39
12
31
18
27
2
1
1
5
5,782
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatLayerNormConvLayer
from ...activations import ACT2FN import torch.nn as nn from ...modeling_layers import GradientCheckpointingLayer class UniSpeechSatLayerNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): super().__init__() self.in_conv_dim = config.conv_dim[layer_id - 1] if layer_i...
class UniSpeechSatLayerNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): pass def forward(self, hidden_states): pass
3
0
12
2
10
0
2
0
1
1
0
0
2
5
2
12
25
4
21
8
18
0
15
8
12
2
1
0
3
5,783
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatModel
from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging import torch from .configuration_unispeech_sat import UniSpeechSatConfig from typing import Callable, Optional, Union import torch.nn as nn @auto_docstring class UniSpeechSatModel(UniSpeechSatPreTrainedModel): def __init...
@auto_docstring class UniSpeechSatModel(UniSpeechSatPreTrainedModel): def __init__(self, config: UniSpeechSatConfig): pass def _mask_hidden_states(self, hidden_states: torch.FloatTensor, mask_time_indices: Optional[torch.FloatTensor]=None, attention_mask: Optional[torch.LongTensor]=None): ''' ...
6
2
35
5
27
3
4
0.12
1
9
6
0
3
5
3
6
118
17
90
28
65
11
41
14
37
6
2
1
13
5,784
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatNoLayerNormConvLayer
from ...activations import ACT2FN import torch.nn as nn from ...modeling_layers import GradientCheckpointingLayer class UniSpeechSatNoLayerNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): super().__init__() self.in_conv_dim = config.conv_dim[layer_id - 1] if layer...
class UniSpeechSatNoLayerNormConvLayer(GradientCheckpointingLayer): def __init__(self, config, layer_id=0): pass def forward(self, hidden_states): pass
3
0
9
1
8
0
2
0
1
1
0
0
2
4
2
12
19
2
17
7
14
0
11
7
8
2
1
0
3
5,785
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatPositionalConvEmbedding
from ...activations import ACT2FN from ...integrations.deepspeed import is_deepspeed_zero3_enabled import torch.nn as nn class UniSpeechSatPositionalConvEmbedding(nn.Module): def __init__(self, config): super().__init__() self.conv = nn.Conv1d(config.hidden_size, config.hidden_size, kernel_size=co...
class UniSpeechSatPositionalConvEmbedding(nn.Module): def __init__(self, config): pass def forward(self, hidden_states): pass
3
0
21
3
18
0
3
0
1
2
1
0
2
3
2
12
43
7
36
10
32
0
28
10
24
4
1
2
5
5,786
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatPreTrainedModel
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel from .configuration_unispeech_sat import UniSpeechSatConfig from typing import Callable, Optional, Union import torch.nn as nn import torch from ...utils import auto_docstring, is_peft_available, is_torch_flex_attn_available, logging import math @a...
@auto_docstring class UniSpeechSatPreTrainedModel(PreTrainedModel): def _init_weights(self, module): '''Initialize the weights''' pass def _get_feat_extract_output_lengths(self, input_lengths: Union[torch.LongTensor, int]): ''' Computes the output length of the convolutional la...
6
2
16
2
12
3
3
0.27
1
5
3
6
3
0
3
3
75
10
51
16
46
14
40
16
35
9
1
2
13
5,787
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py
transformers.models.unispeech_sat.modeling_unispeech_sat.UniSpeechSatSamePadLayer
import torch.nn as nn class UniSpeechSatSamePadLayer(nn.Module): def __init__(self, num_conv_pos_embeddings): super().__init__() self.num_pad_remove = 1 if num_conv_pos_embeddings % 2 == 0 else 0 def forward(self, hidden_states): if self.num_pad_remove > 0: hidden_states =...
class UniSpeechSatSamePadLayer(nn.Module): def __init__(self, num_conv_pos_embeddings): pass def forward(self, hidden_states): pass
3
0
4
0
4
0
2
0
1
1
0
0
2
1
2
12
9
1
8
4
5
0
8
4
5
2
1
1
4
5,788
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/univnet/configuration_univnet.py
transformers.models.univnet.configuration_univnet.UnivNetConfig
from ...configuration_utils import PretrainedConfig class UnivNetConfig(PretrainedConfig): """ This is the configuration class to store the configuration of a [`UnivNetModel`]. It is used to instantiate a UnivNet vocoder model according to the specified arguments, defining the model architecture. Instantia...
class UnivNetConfig(PretrainedConfig): ''' This is the configuration class to store the configuration of a [`UnivNetModel`]. It is used to instantiate a UnivNet vocoder model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yiel...
2
1
35
1
34
0
2
1.5
1
2
0
0
1
12
1
1
100
10
36
30
19
54
18
15
16
2
1
1
2
5,789
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/univnet/feature_extraction_univnet.py
transformers.models.univnet.feature_extraction_univnet.UnivNetFeatureExtractor
from typing import Any, Optional, Union import numpy as np from ...feature_extraction_sequence_utils import SequenceFeatureExtractor from ...utils import PaddingStrategy, TensorType, logging from ...feature_extraction_utils import BatchFeature from ...audio_utils import mel_filter_bank, optimal_fft_length, spectrogram,...
class UnivNetFeatureExtractor(SequenceFeatureExtractor): ''' Constructs a UnivNet feature extractor. This class extracts log-mel-filter bank features from raw speech using the short time Fourier Transform (STFT). The STFT implementation follows that of TacoTron 2 and Hifi-GAN. This feature extracto...
9
5
44
6
25
13
4
0.85
1
11
1
0
8
23
8
25
428
57
200
94
148
171
96
49
87
17
3
2
30
5,790
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/univnet/modeling_univnet.py
transformers.models.univnet.modeling_univnet.UnivNetKernelPredictor
from torch import nn import torch from .configuration_univnet import UnivNetConfig class UnivNetKernelPredictor(nn.Module): """ Implementation of the kernel predictor network which supplies the kernel and bias for the location variable convolutional layers (LVCs) in each UnivNet LVCBlock. Based on the...
class UnivNetKernelPredictor(nn.Module): ''' Implementation of the kernel predictor network which supplies the kernel and bias for the location variable convolutional layers (LVCs) in each UnivNet LVCBlock. Based on the KernelPredictor implementation in [maum-ai/univnet](https://github.com/maum-ai/...
5
2
25
4
17
4
2
0.41
1
5
2
0
4
15
4
14
118
22
68
36
58
28
45
31
40
3
1
1
8
5,791
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/univnet/modeling_univnet.py
transformers.models.univnet.modeling_univnet.UnivNetKernelPredictorResidualBlock
from .configuration_univnet import UnivNetConfig from torch import nn import torch class UnivNetKernelPredictorResidualBlock(nn.Module): """ Implementation of the residual block for the kernel predictor network inside each location variable convolution block (LVCBlock). Parameters: config: (`U...
class UnivNetKernelPredictorResidualBlock(nn.Module): ''' Implementation of the residual block for the kernel predictor network inside each location variable convolution block (LVCBlock). Parameters: config: (`UnivNetConfig`): Config for the `UnivNetModel` model. ''' def __...
5
1
9
1
8
0
1
0.26
1
2
1
0
4
7
4
14
47
8
31
18
23
8
28
15
23
2
1
1
5
5,792
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/univnet/modeling_univnet.py
transformers.models.univnet.modeling_univnet.UnivNetLvcBlock
from .configuration_univnet import UnivNetConfig import torch from torch import nn class UnivNetLvcBlock(nn.Module): """ Implementation of the location variable convolution (LVC) residual block of the UnivNet residual block. Includes a `UnivNetKernelPredictor` inside to predict the kernels and biases of th...
class UnivNetLvcBlock(nn.Module): ''' Implementation of the location variable convolution (LVC) residual block of the UnivNet residual block. Includes a `UnivNetKernelPredictor` inside to predict the kernels and biases of the LVC layers. Based on LVCBlock in [maum-ai/univnet](https://github.com/mau...
5
1
14
2
12
1
2
0.33
1
7
3
0
4
10
4
14
78
13
49
27
39
16
35
22
30
3
1
1
8
5,793
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/univnet/modeling_univnet.py
transformers.models.univnet.modeling_univnet.UnivNetLvcResidualBlock
from torch import nn from .configuration_univnet import UnivNetConfig import torch class UnivNetLvcResidualBlock(nn.Module): """ Implementation of the location variable convolution (LVC) residual block for the UnivNet residual network. Parameters: config: (`UnivNetConfig`): Config for ...
class UnivNetLvcResidualBlock(nn.Module): ''' Implementation of the location variable convolution (LVC) residual block for the UnivNet residual network. Parameters: config: (`UnivNetConfig`): Config for the `UnivNetModel` model. kernel_size (`int`): The kernel size f...
6
2
21
2
13
6
2
0.57
1
4
1
0
5
5
5
15
125
18
68
30
50
39
45
18
39
3
1
1
8
5,794
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/univnet/modeling_univnet.py
transformers.models.univnet.modeling_univnet.UnivNetModel
from typing import Optional, Union import torch from .configuration_univnet import UnivNetConfig from torch import nn from ...modeling_utils import PreTrainedModel from ...utils import auto_docstring, logging @auto_docstring class UnivNetModel(PreTrainedModel): config: UnivNetConfig main_input_name = 'input_fe...
@auto_docstring class UnivNetModel(PreTrainedModel): def __init__(self, config: UnivNetConfig): pass @auto_docstring def forward(self, input_features: torch.FloatTensor, noise_sequence: Optional[torch.FloatTensor]=None, padding_mask: Optional[torch.FloatTensor]=None, generator: Optional[torch.Gener...
8
2
33
5
22
6
5
0.27
1
7
3
0
5
5
5
5
173
29
113
39
98
31
75
31
69
14
1
2
24
5,795
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/upernet/configuration_upernet.py
transformers.models.upernet.configuration_upernet.UperNetConfig
from ...utils.backbone_utils import verify_backbone_config_arguments from ..auto.configuration_auto import CONFIG_MAPPING from ...configuration_utils import PretrainedConfig class UperNetConfig(PretrainedConfig): """ This is the configuration class to store the configuration of an [`UperNetForSemanticSegmentat...
class UperNetConfig(PretrainedConfig): ''' This is the configuration class to store the configuration of an [`UperNetForSemanticSegmentation`]. It is used to instantiate an UperNet model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaul...
4
1
51
2
49
0
3
0.98
1
2
0
0
1
15
1
1
112
11
51
38
31
50
26
20
24
3
1
1
3
5,796
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/upernet/modeling_upernet.py
transformers.models.upernet.modeling_upernet.UperNetConvModule
import torch from torch import nn from typing import Optional, Union class UperNetConvModule(nn.Module): """ A convolutional block that bundles conv/norm/activation layers. This block simplifies the usage of convolution layers, which are commonly used with a norm layer (e.g., BatchNorm) and activation laye...
class UperNetConvModule(nn.Module): ''' A convolutional block that bundles conv/norm/activation layers. This block simplifies the usage of convolution layers, which are commonly used with a norm layer (e.g., BatchNorm) and activation layer (e.g., ReLU). ''' def __init__(self, in_channels: int, out...
3
1
13
1
13
0
1
0.15
1
5
0
0
2
3
2
12
33
3
26
15
15
4
11
7
8
1
1
0
2
5,797
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/upernet/modeling_upernet.py
transformers.models.upernet.modeling_upernet.UperNetFCNHead
from torch import nn from typing import Optional, Union import torch class UperNetFCNHead(nn.Module): """ Fully Convolution Networks for Semantic Segmentation. This head is the implementation of [FCNNet](https://huggingface.co/papers/1411.4038>). Args: config: Configuration. ...
class UperNetFCNHead(nn.Module): ''' Fully Convolution Networks for Semantic Segmentation. This head is the implementation of [FCNNet](https://huggingface.co/papers/1411.4038>). Args: config: Configuration. in_channels (int): Number of input channels. ker...
3
1
13
1
12
0
3
0.3
1
5
1
0
4
9
4
14
69
8
47
21
40
14
34
19
29
4
1
2
10
5,798
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/upernet/modeling_upernet.py
transformers.models.upernet.modeling_upernet.UperNetForSemanticSegmentation
from ...modeling_outputs import SemanticSegmenterOutput import torch from ...utils.backbone_utils import load_backbone from typing import Optional, Union from torch.nn import CrossEntropyLoss from torch import nn from ...utils import auto_docstring @auto_docstring(custom_intro='\n UperNet framework leveraging any v...
@auto_docstring(custom_intro='\n UperNet framework leveraging any vision backbone e.g. for ADE20k, CityScapes.\n ') class UperNetForSemanticSegmentation(UperNetPreTrainedModel): def __init__(self, config): pass @auto_docstring def forward(self, pixel_values: Optional[torch.Tensor]=None, outpu...
5
1
47
9
26
13
7
0.45
1
8
3
0
2
3
2
4
98
18
55
22
43
25
34
14
31
11
2
2
13
5,799
huggingface/pytorch-pretrained-BERT
huggingface_pytorch-pretrained-BERT/src/transformers/models/upernet/modeling_upernet.py
transformers.models.upernet.modeling_upernet.UperNetHead
import torch from torch import nn class UperNetHead(nn.Module): """ Unified Perceptual Parsing for Scene Understanding. This head is the implementation of [UPerNet](https://huggingface.co/papers/1807.10221). """ def __init__(self, config, in_channels): super().__init__() self.confi...
class UperNetHead(nn.Module): ''' Unified Perceptual Parsing for Scene Understanding. This head is the implementation of [UPerNet](https://huggingface.co/papers/1807.10221). ''' def __init__(self, config, in_channels): pass def psp_forward(self, inputs): pass def forward(...
4
1
16
2
13
2
2
0.18
1
6
2
0
5
11
5
15
91
14
67
27
61
12
48
27
42
3
1
2
10