import{S as qs,i as Fs,s as Ms,e as a,k as u,w as b,t as n,M as Ps,c as r,d as o,m as f,a as s,x as A,h as i,b as l,N as Ns,G as t,g as m,y as w,q as y,o as $,B as S,v as zs,L as kr}from"../../chunks/vendor-hf-doc-builder.js";import{T as js}from"../../chunks/Tip-hf-doc-builder.js";import{D as Je}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Cr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ke}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Er}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Is}from"../../chunks/PipelineTag-hf-doc-builder.js";function Os(C){let p,T,_,h,v;return h=new Cr({props:{code:`from transformers import ASTConfig, ASTModel

# Initializing a AST MIT/ast-finetuned-audioset-10-10-0.4593 style configuration
configuration = ASTConfig()

# Initializing a model (with random weights) from the MIT/ast-finetuned-audioset-10-10-0.4593 style configuration
model = ASTModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ASTConfig, ASTModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a AST MIT/ast-finetuned-audioset-10-10-0.4593 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ASTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the MIT/ast-finetuned-audioset-10-10-0.4593 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ASTModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){p=a("p"),T=n("Example:"),_=u(),b(h.$$.fragment)},l(d){p=r(d,"P",{});var g=s(p);T=i(g,"Example:"),g.forEach(o),_=f(d),A(h.$$.fragment,d)},m(d,g){m(d,p,g),t(p,T),m(d,_,g),w(h,d,g),v=!0},p:kr,i(d){v||(y(h.$$.fragment,d),v=!0)},o(d){$(h.$$.fragment,d),v=!1},d(d){d&&o(p),d&&o(_),S(h,d)}}}function Ls(C){let p,T,_,h,v;return{c(){p=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){p=r(d,"P",{});var g=s(p);T=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(g,"CODE",{});var F=s(_);h=i(F,"Module"),F.forEach(o),v=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(d,g){m(d,p,g),t(p,T),t(p,_),t(_,h),t(p,v)},d(d){d&&o(p)}}}function Ds(C){let p,T,_,h,v;return h=new Cr({props:{code:`from transformers import AutoProcessor, ASTModel
import torch
from datasets import load_dataset

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

processor = AutoProcessor.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")
model = ASTModel.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")

# audio file is decoded on the fly
inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, ASTModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;MIT/ast-finetuned-audioset-10-10-0.4593&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ASTModel.from_pretrained(<span class="hljs-string">&quot;MIT/ast-finetuned-audioset-10-10-0.4593&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">1214</span>, <span class="hljs-number">768</span>]`}}),{c(){p=a("p"),T=n("Example:"),_=u(),b(h.$$.fragment)},l(d){p=r(d,"P",{});var g=s(p);T=i(g,"Example:"),g.forEach(o),_=f(d),A(h.$$.fragment,d)},m(d,g){m(d,p,g),t(p,T),m(d,_,g),w(h,d,g),v=!0},p:kr,i(d){v||(y(h.$$.fragment,d),v=!0)},o(d){$(h.$$.fragment,d),v=!1},d(d){d&&o(p),d&&o(_),S(h,d)}}}function Ws(C){let p,T,_,h,v;return{c(){p=a("p"),T=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=n("Module"),v=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){p=r(d,"P",{});var g=s(p);T=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(g,"CODE",{});var F=s(_);h=i(F,"Module"),F.forEach(o),v=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(d,g){m(d,p,g),t(p,T),t(p,_),t(_,h),t(p,v)},d(d){d&&o(p)}}}function Hs(C){let p,T,_,h,v;return h=new Cr({props:{code:`from transformers import AutoFeatureExtractor, ASTForAudioClassification
from datasets import load_dataset
import torch

dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

feature_extractor = AutoFeatureExtractor.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")
model = ASTForAudioClassification.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")

# audio file is decoded on the fly
inputs = feature_extractor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.argmax(logits, dim=-1).item()
predicted_label = model.config.id2label[predicted_class_ids]
predicted_label

# compute loss - target_label is e.g. "down"
target_label = model.config.id2label[0]
inputs["labels"] = torch.tensor([model.config.label2id[target_label]])
loss = model(**inputs).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor, ASTForAudioClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_demo&quot;</span>, <span class="hljs-string">&quot;clean&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.sort(<span class="hljs-string">&quot;id&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;MIT/ast-finetuned-audioset-10-10-0.4593&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ASTForAudioClassification.from_pretrained(<span class="hljs-string">&quot;MIT/ast-finetuned-audioset-10-10-0.4593&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># audio file is decoded on the fly</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = model.config.id2label[predicted_class_ids]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label
<span class="hljs-string">&#x27;Speech&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss - target_label is e.g. &quot;down&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_label = model.config.id2label[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = torch.tensor([model.config.label2id[target_label]])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">0.17</span>`}}),{c(){p=a("p"),T=n("Example:"),_=u(),b(h.$$.fragment)},l(d){p=r(d,"P",{});var g=s(p);T=i(g,"Example:"),g.forEach(o),_=f(d),A(h.$$.fragment,d)},m(d,g){m(d,p,g),t(p,T),m(d,_,g),w(h,d,g),v=!0},p:kr,i(d){v||(y(h.$$.fragment,d),v=!0)},o(d){$(h.$$.fragment,d),v=!1},d(d){d&&o(p),d&&o(_),S(h,d)}}}function Rs(C){let p,T,_,h,v,d,g,F,Co,Vt,L,K,wt,he,jo,yt,qo,Bt,P,Fo,ge,Mo,Po,Qe,No,zo,Gt,Xe,Io,Yt,Ze,$t,Oo,Jt,et,Lo,Kt,Q,D,Do,tt,Wo,Ho,_e,St,Ro,Uo,Vo,ve,Bo,Te,Go,Yo,Qt,X,jr,Xt,Z,Jo,ot,Ko,Qo,Zt,N,Xo,be,Zo,ea,Ae,ta,oa,eo,W,ee,xt,we,aa,Et,ra,to,at,sa,oo,ye,ao,z,$e,na,Se,ia,la,da,I,rt,ca,ua,xe,fa,ma,Ee,pa,ha,ga,ke,_a,st,va,Ta,ro,nt,ba,so,H,te,kt,Ce,Aa,Ct,wa,no,E,je,ya,R,$a,it,Sa,xa,qe,Ea,ka,Ca,U,ja,lt,qa,Fa,dt,Ma,Pa,Na,oe,io,V,ae,jt,Fe,za,qt,Ia,lo,x,Me,Oa,Ft,La,Da,Pe,Wa,ct,Ha,Ra,Ua,Mt,Va,Ba,re,Ne,Ga,Pt,Ya,co,B,se,Nt,ze,Ja,zt,Ka,uo,M,Ie,Qa,Oe,Xa,Le,Za,er,tr,j,De,or,G,ar,ut,rr,sr,It,nr,ir,lr,ne,dr,ie,fo,Y,le,Ot,We,cr,Lt,ur,mo,k,He,fr,Dt,mr,pr,Re,hr,Ue,gr,_r,vr,q,Ve,Tr,J,br,ft,Ar,wr,Wt,yr,$r,Sr,de,xr,ce,po;return d=new Ke({}),he=new Ke({}),we=new Ke({}),ye=new Is({props:{pipeline:"audio-classification"}}),Ce=new Ke({}),je=new Je({props:{name:"class transformers.ASTConfig",anchor:"transformers.ASTConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"patch_size",val:" = 16"},{name:"qkv_bias",val:" = True"},{name:"frequency_stride",val:" = 10"},{name:"time_stride",val:" = 10"},{name:"max_length",val:" = 1024"},{name:"num_mel_bins",val:" = 128"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ASTConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.ASTConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.ASTConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.ASTConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ASTConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.ASTConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ASTConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ASTConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.ASTConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ASTConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>16</code>) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.ASTConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.ASTConfig.frequency_stride",description:`<strong>frequency_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Frequency stride to use when patchifying the spectrograms.`,name:"frequency_stride"},{anchor:"transformers.ASTConfig.time_stride",description:`<strong>time_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Temporal stride to use when patchifying the spectrograms.`,name:"time_stride"},{anchor:"transformers.ASTConfig.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Temporal dimension of the spectrograms.`,name:"max_length"},{anchor:"transformers.ASTConfig.num_mel_bins",description:`<strong>num_mel_bins</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Frequency dimension of the spectrograms (number of Mel-frequency bins).`,name:"num_mel_bins"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py#L31"}}),oe=new Er({props:{anchor:"transformers.ASTConfig.example",$$slots:{default:[Os]},$$scope:{ctx:C}}}),Fe=new Ke({}),Me=new Je({props:{name:"class transformers.ASTFeatureExtractor",anchor:"transformers.ASTFeatureExtractor",parameters:[{name:"feature_size",val:" = 1"},{name:"sampling_rate",val:" = 16000"},{name:"num_mel_bins",val:" = 128"},{name:"max_length",val:" = 1024"},{name:"padding_value",val:" = 0.0"},{name:"do_normalize",val:" = True"},{name:"mean",val:" = -4.2677393"},{name:"std",val:" = 4.5689974"},{name:"return_attention_mask",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ASTFeatureExtractor.feature_size",description:`<strong>feature_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The feature dimension of the extracted features.`,name:"feature_size"},{anchor:"transformers.ASTFeatureExtractor.sampling_rate",description:`<strong>sampling_rate</strong> (<code>int</code>, <em>optional</em>, defaults to 16000) &#x2014;
The sampling rate at which the audio files should be digitalized expressed in hertz (Hz).`,name:"sampling_rate"},{anchor:"transformers.ASTFeatureExtractor.num_mel_bins",description:`<strong>num_mel_bins</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Number of Mel-frequency bins.`,name:"num_mel_bins"},{anchor:"transformers.ASTFeatureExtractor.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Maximum length to which to pad/truncate the extracted features.`,name:"max_length"},{anchor:"transformers.ASTFeatureExtractor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the log-Mel features using <code>mean</code> and <code>std</code>.`,name:"do_normalize"},{anchor:"transformers.ASTFeatureExtractor.mean",description:`<strong>mean</strong> (<code>float</code>, <em>optional</em>, defaults to -4.2677393) &#x2014;
The mean value used to normalize the log-Mel features. Uses the AudioSet mean by default.`,name:"mean"},{anchor:"transformers.ASTFeatureExtractor.std",description:`<strong>std</strong> (<code>float</code>, <em>optional</em>, defaults to 4.5689974) &#x2014;
The standard deviation value used to normalize the log-Mel features. Uses the AudioSet standard deviation
by default.`,name:"std"},{anchor:"transformers.ASTFeatureExtractor.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not <a href="/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor.__call__"><strong>call</strong>()</a> should return <code>attention_mask</code>.`,name:"return_attention_mask"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.py#L33"}}),Ne=new Je({props:{name:"__call__",anchor:"transformers.ASTFeatureExtractor.__call__",parameters:[{name:"raw_speech",val:": typing.Union[numpy.ndarray, typing.List[float], typing.List[numpy.ndarray], typing.List[typing.List[float]]]"},{name:"sampling_rate",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ASTFeatureExtractor.__call__.raw_speech",description:`<strong>raw_speech</strong> (<code>np.ndarray</code>, <code>List[float]</code>, <code>List[np.ndarray]</code>, <code>List[List[float]]</code>) &#x2014;
The sequence or batch of sequences to be padded. Each sequence can be a numpy array, a list of float
values, a list of numpy arrays or a list of list of float values.`,name:"raw_speech"},{anchor:"transformers.ASTFeatureExtractor.__call__.sampling_rate",description:`<strong>sampling_rate</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The sampling rate at which the <code>raw_speech</code> input was sampled. It is strongly recommended to pass
<code>sampling_rate</code> at the forward call to prevent silent errors.`,name:"sampling_rate"},{anchor:"transformers.ASTFeatureExtractor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.27.1/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.py#L125"}}),ze=new Ke({}),Ie=new Je({props:{name:"class transformers.ASTModel",anchor:"transformers.ASTModel",parameters:[{name:"config",val:": ASTConfig"}],parametersDescription:[{anchor:"transformers.ASTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTConfig">ASTConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py#L442"}}),De=new Je({props:{name:"forward",anchor:"transformers.ASTModel.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ASTModel.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor.__call__">ASTFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.ASTModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ASTModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ASTModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ASTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py#L466",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTConfig"
>ASTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new js({props:{$$slots:{default:[Ls]},$$scope:{ctx:C}}}),ie=new Er({props:{anchor:"transformers.ASTModel.forward.example",$$slots:{default:[Ds]},$$scope:{ctx:C}}}),We=new Ke({}),He=new Je({props:{name:"class transformers.ASTForAudioClassification",anchor:"transformers.ASTForAudioClassification",parameters:[{name:"config",val:": ASTConfig"}],parametersDescription:[{anchor:"transformers.ASTForAudioClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTConfig">ASTConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py#L542"}}),Ve=new Je({props:{name:"forward",anchor:"transformers.ASTForAudioClassification.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ASTForAudioClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor.__call__">ASTFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.ASTForAudioClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ASTForAudioClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.ASTForAudioClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ASTForAudioClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ASTForAudioClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the audio classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py#L555",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTConfig"
>ASTConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new js({props:{$$slots:{default:[Ws]},$$scope:{ctx:C}}}),ce=new Er({props:{anchor:"transformers.ASTForAudioClassification.forward.example",$$slots:{default:[Hs]},$$scope:{ctx:C}}}),{c(){p=a("meta"),T=u(),_=a("h1"),h=a("a"),v=a("span"),b(d.$$.fragment),g=u(),F=a("span"),Co=n("Audio Spectrogram Transformer"),Vt=u(),L=a("h2"),K=a("a"),wt=a("span"),b(he.$$.fragment),jo=u(),yt=a("span"),qo=n("Overview"),Bt=u(),P=a("p"),Fo=n("The Audio Spectrogram Transformer model was proposed in "),ge=a("a"),Mo=n("AST: Audio Spectrogram Transformer"),Po=n(` by Yuan Gong, Yu-An Chung, James Glass.
The Audio Spectrogram Transformer applies a `),Qe=a("a"),No=n("Vision Transformer"),zo=n(` to audio, by turning audio into an image (spectrogram). The model obtains state-of-the-art results
for audio classification.`),Gt=u(),Xe=a("p"),Io=n("The abstract from the paper is the following:"),Yt=u(),Ze=a("p"),$t=a("em"),Oo=n("In the past decade, convolutional neural networks (CNNs) have been widely adopted as the main building block for end-to-end audio classification models, which aim to learn a direct mapping from audio spectrograms to corresponding labels. To better capture long-range global context, a recent trend is to add a self-attention mechanism on top of the CNN, forming a CNN-attention hybrid model. However, it is unclear whether the reliance on a CNN is necessary, and if neural networks purely based on attention are sufficient to obtain good performance in audio classification. In this paper, we answer the question by introducing the Audio Spectrogram Transformer (AST), the first convolution-free, purely attention-based model for audio classification. We evaluate AST on various audio classification benchmarks, where it achieves new state-of-the-art results of 0.485 mAP on AudioSet, 95.6% accuracy on ESC-50, and 98.1% accuracy on Speech Commands V2."),Jt=u(),et=a("p"),Lo=n("Tips:"),Kt=u(),Q=a("ul"),D=a("li"),Do=n(`When fine-tuning the Audio Spectrogram Transformer (AST) on your own dataset, it\u2019s recommended to take care of the input normalization (to make
sure the input has mean of 0 and std of 0.5). `),tt=a("a"),Wo=n("ASTFeatureExtractor"),Ho=n(` takes care of this. Note that it uses the AudioSet
mean and std by default. You can check `),_e=a("a"),St=a("code"),Ro=n("ast/src/get_norm_stats.py"),Uo=n(` to see how
the authors compute the stats for a downstream dataset.`),Vo=u(),ve=a("li"),Bo=n(`Note that the AST needs a low learning rate (the authors use a 10 times smaller learning rate compared to their CNN model proposed in the
`),Te=a("a"),Go=n("PSLA paper"),Yo=n(") and converges quickly, so please search for a suitable learning rate and learning rate scheduler for your task."),Qt=u(),X=a("img"),Xt=u(),Z=a("small"),Jo=n("Audio pectrogram Transformer architecture. Taken from the "),ot=a("a"),Ko=n("original paper"),Qo=n("."),Zt=u(),N=a("p"),Xo=n("This model was contributed by "),be=a("a"),Zo=n("nielsr"),ea=n(`.
The original code can be found `),Ae=a("a"),ta=n("here"),oa=n("."),eo=u(),W=a("h2"),ee=a("a"),xt=a("span"),b(we.$$.fragment),aa=u(),Et=a("span"),ra=n("Resources"),to=u(),at=a("p"),sa=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with the Audio Spectrogram Transformer."),oo=u(),b(ye.$$.fragment),ao=u(),z=a("ul"),$e=a("li"),na=n("A notebook illustrating inference with AST for audio classification can be found "),Se=a("a"),ia=n("here"),la=n("."),da=u(),I=a("li"),rt=a("a"),ca=n("ASTForAudioClassification"),ua=n(" is supported by this "),xe=a("a"),fa=n("example script"),ma=n(" and "),Ee=a("a"),pa=n("notebook"),ha=n("."),ga=u(),ke=a("li"),_a=n("See also: "),st=a("a"),va=n("Audio classification"),Ta=n("."),ro=u(),nt=a("p"),ba=n("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),so=u(),H=a("h2"),te=a("a"),kt=a("span"),b(Ce.$$.fragment),Aa=u(),Ct=a("span"),wa=n("ASTConfig"),no=u(),E=a("div"),b(je.$$.fragment),ya=u(),R=a("p"),$a=n("This is the configuration class to store the configuration of a "),it=a("a"),Sa=n("ASTModel"),xa=n(`. It is used to instantiate an AST
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the AST
`),qe=a("a"),Ea=n("MIT/ast-finetuned-audioset-10-10-0.4593"),ka=n(`
architecture.`),Ca=u(),U=a("p"),ja=n("Configuration objects inherit from "),lt=a("a"),qa=n("PretrainedConfig"),Fa=n(` and can be used to control the model outputs. Read the
documentation from `),dt=a("a"),Ma=n("PretrainedConfig"),Pa=n(" for more information."),Na=u(),b(oe.$$.fragment),io=u(),V=a("h2"),ae=a("a"),jt=a("span"),b(Fe.$$.fragment),za=u(),qt=a("span"),Ia=n("ASTFeatureExtractor"),lo=u(),x=a("div"),b(Me.$$.fragment),Oa=u(),Ft=a("p"),La=n("Constructs a Audio Spectrogram Transformer (AST) feature extractor."),Da=u(),Pe=a("p"),Wa=n("This feature extractor inherits from "),ct=a("a"),Ha=n("SequenceFeatureExtractor"),Ra=n(` which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`),Ua=u(),Mt=a("p"),Va=n(`This class extracts mel-filter bank features from raw speech using TorchAudio, pads/truncates them to a fixed
length and normalizes them using a mean and standard deviation.`),Ba=u(),re=a("div"),b(Ne.$$.fragment),Ga=u(),Pt=a("p"),Ya=n("Main method to featurize and prepare for the model one or several sequence(s)."),co=u(),B=a("h2"),se=a("a"),Nt=a("span"),b(ze.$$.fragment),Ja=u(),zt=a("span"),Ka=n("ASTModel"),uo=u(),M=a("div"),b(Ie.$$.fragment),Qa=u(),Oe=a("p"),Xa=n(`The bare AST Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Le=a("a"),Za=n("torch.nn.Module"),er=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tr=u(),j=a("div"),b(De.$$.fragment),or=u(),G=a("p"),ar=n("The "),ut=a("a"),rr=n("ASTModel"),sr=n(" forward method, overrides the "),It=a("code"),nr=n("__call__"),ir=n(" special method."),lr=u(),b(ne.$$.fragment),dr=u(),b(ie.$$.fragment),fo=u(),Y=a("h2"),le=a("a"),Ot=a("span"),b(We.$$.fragment),cr=u(),Lt=a("span"),ur=n("ASTForAudioClassification"),mo=u(),k=a("div"),b(He.$$.fragment),fr=u(),Dt=a("p"),mr=n(`Audio Spectrogram Transformer model with an audio classification head on top (a linear layer on top of the pooled
output) e.g. for datasets like AudioSet, Speech Commands v2.`),pr=u(),Re=a("p"),hr=n("This model is a PyTorch "),Ue=a("a"),gr=n("torch.nn.Module"),_r=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vr=u(),q=a("div"),b(Ve.$$.fragment),Tr=u(),J=a("p"),br=n("The "),ft=a("a"),Ar=n("ASTForAudioClassification"),wr=n(" forward method, overrides the "),Wt=a("code"),yr=n("__call__"),$r=n(" special method."),Sr=u(),b(de.$$.fragment),xr=u(),b(ce.$$.fragment),this.h()},l(e){const c=Ps('[data-svelte="svelte-1phssyn"]',document.head);p=r(c,"META",{name:!0,content:!0}),c.forEach(o),T=f(e),_=r(e,"H1",{class:!0});var Be=s(_);h=r(Be,"A",{id:!0,class:!0,href:!0});var Ht=s(h);v=r(Ht,"SPAN",{});var Rt=s(v);A(d.$$.fragment,Rt),Rt.forEach(o),Ht.forEach(o),g=f(Be),F=r(Be,"SPAN",{});var Ut=s(F);Co=i(Ut,"Audio Spectrogram Transformer"),Ut.forEach(o),Be.forEach(o),Vt=f(e),L=r(e,"H2",{class:!0});var Ge=s(L);K=r(Ge,"A",{id:!0,class:!0,href:!0});var qr=s(K);wt=r(qr,"SPAN",{});var Fr=s(wt);A(he.$$.fragment,Fr),Fr.forEach(o),qr.forEach(o),jo=f(Ge),yt=r(Ge,"SPAN",{});var Mr=s(yt);qo=i(Mr,"Overview"),Mr.forEach(o),Ge.forEach(o),Bt=f(e),P=r(e,"P",{});var mt=s(P);Fo=i(mt,"The Audio Spectrogram Transformer model was proposed in "),ge=r(mt,"A",{href:!0,rel:!0});var Pr=s(ge);Mo=i(Pr,"AST: Audio Spectrogram Transformer"),Pr.forEach(o),Po=i(mt,` by Yuan Gong, Yu-An Chung, James Glass.
The Audio Spectrogram Transformer applies a `),Qe=r(mt,"A",{href:!0});var Nr=s(Qe);No=i(Nr,"Vision Transformer"),Nr.forEach(o),zo=i(mt,` to audio, by turning audio into an image (spectrogram). The model obtains state-of-the-art results
for audio classification.`),mt.forEach(o),Gt=f(e),Xe=r(e,"P",{});var zr=s(Xe);Io=i(zr,"The abstract from the paper is the following:"),zr.forEach(o),Yt=f(e),Ze=r(e,"P",{});var Ir=s(Ze);$t=r(Ir,"EM",{});var Or=s($t);Oo=i(Or,"In the past decade, convolutional neural networks (CNNs) have been widely adopted as the main building block for end-to-end audio classification models, which aim to learn a direct mapping from audio spectrograms to corresponding labels. To better capture long-range global context, a recent trend is to add a self-attention mechanism on top of the CNN, forming a CNN-attention hybrid model. However, it is unclear whether the reliance on a CNN is necessary, and if neural networks purely based on attention are sufficient to obtain good performance in audio classification. In this paper, we answer the question by introducing the Audio Spectrogram Transformer (AST), the first convolution-free, purely attention-based model for audio classification. We evaluate AST on various audio classification benchmarks, where it achieves new state-of-the-art results of 0.485 mAP on AudioSet, 95.6% accuracy on ESC-50, and 98.1% accuracy on Speech Commands V2."),Or.forEach(o),Ir.forEach(o),Jt=f(e),et=r(e,"P",{});var Lr=s(et);Lo=i(Lr,"Tips:"),Lr.forEach(o),Kt=f(e),Q=r(e,"UL",{});var ho=s(Q);D=r(ho,"LI",{});var pt=s(D);Do=i(pt,`When fine-tuning the Audio Spectrogram Transformer (AST) on your own dataset, it\u2019s recommended to take care of the input normalization (to make
sure the input has mean of 0 and std of 0.5). `),tt=r(pt,"A",{href:!0});var Dr=s(tt);Wo=i(Dr,"ASTFeatureExtractor"),Dr.forEach(o),Ho=i(pt,` takes care of this. Note that it uses the AudioSet
mean and std by default. You can check `),_e=r(pt,"A",{href:!0,rel:!0});var Wr=s(_e);St=r(Wr,"CODE",{});var Hr=s(St);Ro=i(Hr,"ast/src/get_norm_stats.py"),Hr.forEach(o),Wr.forEach(o),Uo=i(pt,` to see how
the authors compute the stats for a downstream dataset.`),pt.forEach(o),Vo=f(ho),ve=r(ho,"LI",{});var go=s(ve);Bo=i(go,`Note that the AST needs a low learning rate (the authors use a 10 times smaller learning rate compared to their CNN model proposed in the
`),Te=r(go,"A",{href:!0,rel:!0});var Rr=s(Te);Go=i(Rr,"PSLA paper"),Rr.forEach(o),Yo=i(go,") and converges quickly, so please search for a suitable learning rate and learning rate scheduler for your task."),go.forEach(o),ho.forEach(o),Qt=f(e),X=r(e,"IMG",{src:!0,alt:!0,width:!0}),Xt=f(e),Z=r(e,"SMALL",{});var _o=s(Z);Jo=i(_o,"Audio pectrogram Transformer architecture. Taken from the "),ot=r(_o,"A",{href:!0});var Ur=s(ot);Ko=i(Ur,"original paper"),Ur.forEach(o),Qo=i(_o,"."),_o.forEach(o),Zt=f(e),N=r(e,"P",{});var ht=s(N);Xo=i(ht,"This model was contributed by "),be=r(ht,"A",{href:!0,rel:!0});var Vr=s(be);Zo=i(Vr,"nielsr"),Vr.forEach(o),ea=i(ht,`.
The original code can be found `),Ae=r(ht,"A",{href:!0,rel:!0});var Br=s(Ae);ta=i(Br,"here"),Br.forEach(o),oa=i(ht,"."),ht.forEach(o),eo=f(e),W=r(e,"H2",{class:!0});var vo=s(W);ee=r(vo,"A",{id:!0,class:!0,href:!0});var Gr=s(ee);xt=r(Gr,"SPAN",{});var Yr=s(xt);A(we.$$.fragment,Yr),Yr.forEach(o),Gr.forEach(o),aa=f(vo),Et=r(vo,"SPAN",{});var Jr=s(Et);ra=i(Jr,"Resources"),Jr.forEach(o),vo.forEach(o),to=f(e),at=r(e,"P",{});var Kr=s(at);sa=i(Kr,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with the Audio Spectrogram Transformer."),Kr.forEach(o),oo=f(e),A(ye.$$.fragment,e),ao=f(e),z=r(e,"UL",{});var gt=s(z);$e=r(gt,"LI",{});var To=s($e);na=i(To,"A notebook illustrating inference with AST for audio classification can be found "),Se=r(To,"A",{href:!0,rel:!0});var Qr=s(Se);ia=i(Qr,"here"),Qr.forEach(o),la=i(To,"."),To.forEach(o),da=f(gt),I=r(gt,"LI",{});var Ye=s(I);rt=r(Ye,"A",{href:!0});var Xr=s(rt);ca=i(Xr,"ASTForAudioClassification"),Xr.forEach(o),ua=i(Ye," is supported by this "),xe=r(Ye,"A",{href:!0,rel:!0});var Zr=s(xe);fa=i(Zr,"example script"),Zr.forEach(o),ma=i(Ye," and "),Ee=r(Ye,"A",{href:!0,rel:!0});var es=s(Ee);pa=i(es,"notebook"),es.forEach(o),ha=i(Ye,"."),Ye.forEach(o),ga=f(gt),ke=r(gt,"LI",{});var bo=s(ke);_a=i(bo,"See also: "),st=r(bo,"A",{href:!0});var ts=s(st);va=i(ts,"Audio classification"),ts.forEach(o),Ta=i(bo,"."),bo.forEach(o),gt.forEach(o),ro=f(e),nt=r(e,"P",{});var os=s(nt);ba=i(os,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),os.forEach(o),so=f(e),H=r(e,"H2",{class:!0});var Ao=s(H);te=r(Ao,"A",{id:!0,class:!0,href:!0});var as=s(te);kt=r(as,"SPAN",{});var rs=s(kt);A(Ce.$$.fragment,rs),rs.forEach(o),as.forEach(o),Aa=f(Ao),Ct=r(Ao,"SPAN",{});var ss=s(Ct);wa=i(ss,"ASTConfig"),ss.forEach(o),Ao.forEach(o),no=f(e),E=r(e,"DIV",{class:!0});var ue=s(E);A(je.$$.fragment,ue),ya=f(ue),R=r(ue,"P",{});var _t=s(R);$a=i(_t,"This is the configuration class to store the configuration of a "),it=r(_t,"A",{href:!0});var ns=s(it);Sa=i(ns,"ASTModel"),ns.forEach(o),xa=i(_t,`. It is used to instantiate an AST
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the AST
`),qe=r(_t,"A",{href:!0,rel:!0});var is=s(qe);Ea=i(is,"MIT/ast-finetuned-audioset-10-10-0.4593"),is.forEach(o),ka=i(_t,`
architecture.`),_t.forEach(o),Ca=f(ue),U=r(ue,"P",{});var vt=s(U);ja=i(vt,"Configuration objects inherit from "),lt=r(vt,"A",{href:!0});var ls=s(lt);qa=i(ls,"PretrainedConfig"),ls.forEach(o),Fa=i(vt,` and can be used to control the model outputs. Read the
documentation from `),dt=r(vt,"A",{href:!0});var ds=s(dt);Ma=i(ds,"PretrainedConfig"),ds.forEach(o),Pa=i(vt," for more information."),vt.forEach(o),Na=f(ue),A(oe.$$.fragment,ue),ue.forEach(o),io=f(e),V=r(e,"H2",{class:!0});var wo=s(V);ae=r(wo,"A",{id:!0,class:!0,href:!0});var cs=s(ae);jt=r(cs,"SPAN",{});var us=s(jt);A(Fe.$$.fragment,us),us.forEach(o),cs.forEach(o),za=f(wo),qt=r(wo,"SPAN",{});var fs=s(qt);Ia=i(fs,"ASTFeatureExtractor"),fs.forEach(o),wo.forEach(o),lo=f(e),x=r(e,"DIV",{class:!0});var O=s(x);A(Me.$$.fragment,O),Oa=f(O),Ft=r(O,"P",{});var ms=s(Ft);La=i(ms,"Constructs a Audio Spectrogram Transformer (AST) feature extractor."),ms.forEach(o),Da=f(O),Pe=r(O,"P",{});var yo=s(Pe);Wa=i(yo,"This feature extractor inherits from "),ct=r(yo,"A",{href:!0});var ps=s(ct);Ha=i(ps,"SequenceFeatureExtractor"),ps.forEach(o),Ra=i(yo,` which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`),yo.forEach(o),Ua=f(O),Mt=r(O,"P",{});var hs=s(Mt);Va=i(hs,`This class extracts mel-filter bank features from raw speech using TorchAudio, pads/truncates them to a fixed
length and normalizes them using a mean and standard deviation.`),hs.forEach(o),Ba=f(O),re=r(O,"DIV",{class:!0});var $o=s(re);A(Ne.$$.fragment,$o),Ga=f($o),Pt=r($o,"P",{});var gs=s(Pt);Ya=i(gs,"Main method to featurize and prepare for the model one or several sequence(s)."),gs.forEach(o),$o.forEach(o),O.forEach(o),co=f(e),B=r(e,"H2",{class:!0});var So=s(B);se=r(So,"A",{id:!0,class:!0,href:!0});var _s=s(se);Nt=r(_s,"SPAN",{});var vs=s(Nt);A(ze.$$.fragment,vs),vs.forEach(o),_s.forEach(o),Ja=f(So),zt=r(So,"SPAN",{});var Ts=s(zt);Ka=i(Ts,"ASTModel"),Ts.forEach(o),So.forEach(o),uo=f(e),M=r(e,"DIV",{class:!0});var Tt=s(M);A(Ie.$$.fragment,Tt),Qa=f(Tt),Oe=r(Tt,"P",{});var xo=s(Oe);Xa=i(xo,`The bare AST Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Le=r(xo,"A",{href:!0,rel:!0});var bs=s(Le);Za=i(bs,"torch.nn.Module"),bs.forEach(o),er=i(xo,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),xo.forEach(o),tr=f(Tt),j=r(Tt,"DIV",{class:!0});var fe=s(j);A(De.$$.fragment,fe),or=f(fe),G=r(fe,"P",{});var bt=s(G);ar=i(bt,"The "),ut=r(bt,"A",{href:!0});var As=s(ut);rr=i(As,"ASTModel"),As.forEach(o),sr=i(bt," forward method, overrides the "),It=r(bt,"CODE",{});var ws=s(It);nr=i(ws,"__call__"),ws.forEach(o),ir=i(bt," special method."),bt.forEach(o),lr=f(fe),A(ne.$$.fragment,fe),dr=f(fe),A(ie.$$.fragment,fe),fe.forEach(o),Tt.forEach(o),fo=f(e),Y=r(e,"H2",{class:!0});var Eo=s(Y);le=r(Eo,"A",{id:!0,class:!0,href:!0});var ys=s(le);Ot=r(ys,"SPAN",{});var $s=s(Ot);A(We.$$.fragment,$s),$s.forEach(o),ys.forEach(o),cr=f(Eo),Lt=r(Eo,"SPAN",{});var Ss=s(Lt);ur=i(Ss,"ASTForAudioClassification"),Ss.forEach(o),Eo.forEach(o),mo=f(e),k=r(e,"DIV",{class:!0});var me=s(k);A(He.$$.fragment,me),fr=f(me),Dt=r(me,"P",{});var xs=s(Dt);mr=i(xs,`Audio Spectrogram Transformer model with an audio classification head on top (a linear layer on top of the pooled
output) e.g. for datasets like AudioSet, Speech Commands v2.`),xs.forEach(o),pr=f(me),Re=r(me,"P",{});var ko=s(Re);hr=i(ko,"This model is a PyTorch "),Ue=r(ko,"A",{href:!0,rel:!0});var Es=s(Ue);gr=i(Es,"torch.nn.Module"),Es.forEach(o),_r=i(ko,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ko.forEach(o),vr=f(me),q=r(me,"DIV",{class:!0});var pe=s(q);A(Ve.$$.fragment,pe),Tr=f(pe),J=r(pe,"P",{});var At=s(J);br=i(At,"The "),ft=r(At,"A",{href:!0});var ks=s(ft);Ar=i(ks,"ASTForAudioClassification"),ks.forEach(o),wr=i(At," forward method, overrides the "),Wt=r(At,"CODE",{});var Cs=s(Wt);yr=i(Cs,"__call__"),Cs.forEach(o),$r=i(At," special method."),At.forEach(o),Sr=f(pe),A(de.$$.fragment,pe),xr=f(pe),A(ce.$$.fragment,pe),pe.forEach(o),me.forEach(o),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(Us)),l(h,"id","audio-spectrogram-transformer"),l(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(h,"href","#audio-spectrogram-transformer"),l(_,"class","relative group"),l(K,"id","overview"),l(K,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(K,"href","#overview"),l(L,"class","relative group"),l(ge,"href","https://arxiv.org/abs/2104.01778"),l(ge,"rel","nofollow"),l(Qe,"href","vit"),l(tt,"href","/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor"),l(_e,"href","https://github.com/YuanGongND/ast/blob/master/src/get_norm_stats.py"),l(_e,"rel","nofollow"),l(Te,"href","https://arxiv.org/abs/2102.01243"),l(Te,"rel","nofollow"),Ns(X.src,jr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/audio_spectogram_transformer_architecture.png")||l(X,"src",jr),l(X,"alt","drawing"),l(X,"width","600"),l(ot,"href","https://arxiv.org/abs/2104.01778"),l(be,"href","https://huggingface.co/nielsr"),l(be,"rel","nofollow"),l(Ae,"href","https://github.com/YuanGongND/ast"),l(Ae,"rel","nofollow"),l(ee,"id","resources"),l(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ee,"href","#resources"),l(W,"class","relative group"),l(Se,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/AST"),l(Se,"rel","nofollow"),l(rt,"href","/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTForAudioClassification"),l(xe,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/audio-classification"),l(xe,"rel","nofollow"),l(Ee,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb"),l(Ee,"rel","nofollow"),l(st,"href","./tasks/audio_classification"),l(te,"id","transformers.ASTConfig"),l(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(te,"href","#transformers.ASTConfig"),l(H,"class","relative group"),l(it,"href","/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTModel"),l(qe,"href","https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593"),l(qe,"rel","nofollow"),l(lt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(dt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ae,"id","transformers.ASTFeatureExtractor"),l(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ae,"href","#transformers.ASTFeatureExtractor"),l(V,"class","relative group"),l(ct,"href","/docs/transformers/v4.27.1/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor"),l(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(se,"id","transformers.ASTModel"),l(se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(se,"href","#transformers.ASTModel"),l(B,"class","relative group"),l(Le,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Le,"rel","nofollow"),l(ut,"href","/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTModel"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(le,"id","transformers.ASTForAudioClassification"),l(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(le,"href","#transformers.ASTForAudioClassification"),l(Y,"class","relative group"),l(Ue,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ue,"rel","nofollow"),l(ft,"href","/docs/transformers/v4.27.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTForAudioClassification"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,c){t(document.head,p),m(e,T,c),m(e,_,c),t(_,h),t(h,v),w(d,v,null),t(_,g),t(_,F),t(F,Co),m(e,Vt,c),m(e,L,c),t(L,K),t(K,wt),w(he,wt,null),t(L,jo),t(L,yt),t(yt,qo),m(e,Bt,c),m(e,P,c),t(P,Fo),t(P,ge),t(ge,Mo),t(P,Po),t(P,Qe),t(Qe,No),t(P,zo),m(e,Gt,c),m(e,Xe,c),t(Xe,Io),m(e,Yt,c),m(e,Ze,c),t(Ze,$t),t($t,Oo),m(e,Jt,c),m(e,et,c),t(et,Lo),m(e,Kt,c),m(e,Q,c),t(Q,D),t(D,Do),t(D,tt),t(tt,Wo),t(D,Ho),t(D,_e),t(_e,St),t(St,Ro),t(D,Uo),t(Q,Vo),t(Q,ve),t(ve,Bo),t(ve,Te),t(Te,Go),t(ve,Yo),m(e,Qt,c),m(e,X,c),m(e,Xt,c),m(e,Z,c),t(Z,Jo),t(Z,ot),t(ot,Ko),t(Z,Qo),m(e,Zt,c),m(e,N,c),t(N,Xo),t(N,be),t(be,Zo),t(N,ea),t(N,Ae),t(Ae,ta),t(N,oa),m(e,eo,c),m(e,W,c),t(W,ee),t(ee,xt),w(we,xt,null),t(W,aa),t(W,Et),t(Et,ra),m(e,to,c),m(e,at,c),t(at,sa),m(e,oo,c),w(ye,e,c),m(e,ao,c),m(e,z,c),t(z,$e),t($e,na),t($e,Se),t(Se,ia),t($e,la),t(z,da),t(z,I),t(I,rt),t(rt,ca),t(I,ua),t(I,xe),t(xe,fa),t(I,ma),t(I,Ee),t(Ee,pa),t(I,ha),t(z,ga),t(z,ke),t(ke,_a),t(ke,st),t(st,va),t(ke,Ta),m(e,ro,c),m(e,nt,c),t(nt,ba),m(e,so,c),m(e,H,c),t(H,te),t(te,kt),w(Ce,kt,null),t(H,Aa),t(H,Ct),t(Ct,wa),m(e,no,c),m(e,E,c),w(je,E,null),t(E,ya),t(E,R),t(R,$a),t(R,it),t(it,Sa),t(R,xa),t(R,qe),t(qe,Ea),t(R,ka),t(E,Ca),t(E,U),t(U,ja),t(U,lt),t(lt,qa),t(U,Fa),t(U,dt),t(dt,Ma),t(U,Pa),t(E,Na),w(oe,E,null),m(e,io,c),m(e,V,c),t(V,ae),t(ae,jt),w(Fe,jt,null),t(V,za),t(V,qt),t(qt,Ia),m(e,lo,c),m(e,x,c),w(Me,x,null),t(x,Oa),t(x,Ft),t(Ft,La),t(x,Da),t(x,Pe),t(Pe,Wa),t(Pe,ct),t(ct,Ha),t(Pe,Ra),t(x,Ua),t(x,Mt),t(Mt,Va),t(x,Ba),t(x,re),w(Ne,re,null),t(re,Ga),t(re,Pt),t(Pt,Ya),m(e,co,c),m(e,B,c),t(B,se),t(se,Nt),w(ze,Nt,null),t(B,Ja),t(B,zt),t(zt,Ka),m(e,uo,c),m(e,M,c),w(Ie,M,null),t(M,Qa),t(M,Oe),t(Oe,Xa),t(Oe,Le),t(Le,Za),t(Oe,er),t(M,tr),t(M,j),w(De,j,null),t(j,or),t(j,G),t(G,ar),t(G,ut),t(ut,rr),t(G,sr),t(G,It),t(It,nr),t(G,ir),t(j,lr),w(ne,j,null),t(j,dr),w(ie,j,null),m(e,fo,c),m(e,Y,c),t(Y,le),t(le,Ot),w(We,Ot,null),t(Y,cr),t(Y,Lt),t(Lt,ur),m(e,mo,c),m(e,k,c),w(He,k,null),t(k,fr),t(k,Dt),t(Dt,mr),t(k,pr),t(k,Re),t(Re,hr),t(Re,Ue),t(Ue,gr),t(Re,_r),t(k,vr),t(k,q),w(Ve,q,null),t(q,Tr),t(q,J),t(J,br),t(J,ft),t(ft,Ar),t(J,wr),t(J,Wt),t(Wt,yr),t(J,$r),t(q,Sr),w(de,q,null),t(q,xr),w(ce,q,null),po=!0},p(e,[c]){const Be={};c&2&&(Be.$$scope={dirty:c,ctx:e}),oe.$set(Be);const Ht={};c&2&&(Ht.$$scope={dirty:c,ctx:e}),ne.$set(Ht);const Rt={};c&2&&(Rt.$$scope={dirty:c,ctx:e}),ie.$set(Rt);const Ut={};c&2&&(Ut.$$scope={dirty:c,ctx:e}),de.$set(Ut);const Ge={};c&2&&(Ge.$$scope={dirty:c,ctx:e}),ce.$set(Ge)},i(e){po||(y(d.$$.fragment,e),y(he.$$.fragment,e),y(we.$$.fragment,e),y(ye.$$.fragment,e),y(Ce.$$.fragment,e),y(je.$$.fragment,e),y(oe.$$.fragment,e),y(Fe.$$.fragment,e),y(Me.$$.fragment,e),y(Ne.$$.fragment,e),y(ze.$$.fragment,e),y(Ie.$$.fragment,e),y(De.$$.fragment,e),y(ne.$$.fragment,e),y(ie.$$.fragment,e),y(We.$$.fragment,e),y(He.$$.fragment,e),y(Ve.$$.fragment,e),y(de.$$.fragment,e),y(ce.$$.fragment,e),po=!0)},o(e){$(d.$$.fragment,e),$(he.$$.fragment,e),$(we.$$.fragment,e),$(ye.$$.fragment,e),$(Ce.$$.fragment,e),$(je.$$.fragment,e),$(oe.$$.fragment,e),$(Fe.$$.fragment,e),$(Me.$$.fragment,e),$(Ne.$$.fragment,e),$(ze.$$.fragment,e),$(Ie.$$.fragment,e),$(De.$$.fragment,e),$(ne.$$.fragment,e),$(ie.$$.fragment,e),$(We.$$.fragment,e),$(He.$$.fragment,e),$(Ve.$$.fragment,e),$(de.$$.fragment,e),$(ce.$$.fragment,e),po=!1},d(e){o(p),e&&o(T),e&&o(_),S(d),e&&o(Vt),e&&o(L),S(he),e&&o(Bt),e&&o(P),e&&o(Gt),e&&o(Xe),e&&o(Yt),e&&o(Ze),e&&o(Jt),e&&o(et),e&&o(Kt),e&&o(Q),e&&o(Qt),e&&o(X),e&&o(Xt),e&&o(Z),e&&o(Zt),e&&o(N),e&&o(eo),e&&o(W),S(we),e&&o(to),e&&o(at),e&&o(oo),S(ye,e),e&&o(ao),e&&o(z),e&&o(ro),e&&o(nt),e&&o(so),e&&o(H),S(Ce),e&&o(no),e&&o(E),S(je),S(oe),e&&o(io),e&&o(V),S(Fe),e&&o(lo),e&&o(x),S(Me),S(Ne),e&&o(co),e&&o(B),S(ze),e&&o(uo),e&&o(M),S(Ie),S(De),S(ne),S(ie),e&&o(fo),e&&o(Y),S(We),e&&o(mo),e&&o(k),S(He),S(Ve),S(de),S(ce)}}}const Us={local:"audio-spectrogram-transformer",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.ASTConfig",title:"ASTConfig"},{local:"transformers.ASTFeatureExtractor",title:"ASTFeatureExtractor"},{local:"transformers.ASTModel",title:"ASTModel"},{local:"transformers.ASTForAudioClassification",title:"ASTForAudioClassification"}],title:"Audio Spectrogram Transformer"};function Vs(C){return zs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zs extends qs{constructor(p){super();Fs(this,p,Vs,Rs,Ms,{})}}export{Zs as default,Us as metadata};
