import{S as ys,i as $s,s as Ss,e as a,k as m,w as b,t as n,M as xs,c as r,d as o,m as u,a as s,x as A,h as i,b as l,N as Es,G as t,g as f,y as w,q as y,o as $,B as S,v as ks,L as Ar}from"../../chunks/vendor-hf-doc-builder.js";import{T as ws}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ye}from"../../chunks/Docstring-hf-doc-builder.js";import{C as wr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Je}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as br}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Cs}from"../../chunks/PipelineTag-hf-doc-builder.js";function js(C){let p,v,_,h,T;return h=new wr({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"),v=n("Example:"),_=m(),b(h.$$.fragment)},l(d){p=r(d,"P",{});var g=s(p);v=i(g,"Example:"),g.forEach(o),_=u(d),A(h.$$.fragment,d)},m(d,g){f(d,p,g),t(p,v),f(d,_,g),w(h,d,g),T=!0},p:Ar,i(d){T||(y(h.$$.fragment,d),T=!0)},o(d){$(h.$$.fragment,d),T=!1},d(d){d&&o(p),d&&o(_),S(h,d)}}}function qs(C){let p,v,_,h,T;return{c(){p=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=n("Module"),T=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);v=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),T=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){f(d,p,g),t(p,v),t(p,_),t(_,h),t(p,T)},d(d){d&&o(p)}}}function Fs(C){let p,v,_,h,T;return h=new wr({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"),v=n("Example:"),_=m(),b(h.$$.fragment)},l(d){p=r(d,"P",{});var g=s(p);v=i(g,"Example:"),g.forEach(o),_=u(d),A(h.$$.fragment,d)},m(d,g){f(d,p,g),t(p,v),f(d,_,g),w(h,d,g),T=!0},p:Ar,i(d){T||(y(h.$$.fragment,d),T=!0)},o(d){$(h.$$.fragment,d),T=!1},d(d){d&&o(p),d&&o(_),S(h,d)}}}function Ms(C){let p,v,_,h,T;return{c(){p=a("p"),v=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=n("Module"),T=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);v=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),T=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){f(d,p,g),t(p,v),t(p,_),t(_,h),t(p,T)},d(d){d&&o(p)}}}function Ps(C){let p,v,_,h,T;return h=new wr({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"),v=n("Example:"),_=m(),b(h.$$.fragment)},l(d){p=r(d,"P",{});var g=s(p);v=i(g,"Example:"),g.forEach(o),_=u(d),A(h.$$.fragment,d)},m(d,g){f(d,p,g),t(p,v),f(d,_,g),w(h,d,g),T=!0},p:Ar,i(d){T||(y(h.$$.fragment,d),T=!0)},o(d){$(h.$$.fragment,d),T=!1},d(d){d&&o(p),d&&o(_),S(h,d)}}}function Ns(C){let p,v,_,h,T,d,g,F,xo,Ht,O,J,vt,he,Eo,bt,ko,Rt,P,Co,ge,jo,qo,Ke,Fo,Mo,Ut,Qe,Po,Vt,Xe,At,No,Bt,Ze,zo,Gt,K,L,Io,et,Oo,Lo,_e,wt,Do,Wo,Ho,Te,Ro,ve,Uo,Vo,Yt,Q,yr,Jt,X,Bo,tt,Go,Yo,Kt,N,Jo,be,Ko,Qo,Ae,Xo,Zo,Qt,D,Z,yt,we,ea,$t,ta,Xt,ot,oa,Zt,ye,eo,ee,$e,aa,Se,ra,sa,na,z,at,ia,la,xe,da,ca,Ee,ma,ua,to,rt,fa,oo,W,te,St,ke,pa,xt,ha,ao,E,Ce,ga,H,_a,st,Ta,va,je,ba,Aa,wa,R,ya,nt,$a,Sa,it,xa,Ea,ka,oe,ro,U,ae,Et,qe,Ca,kt,ja,so,x,Fe,qa,Ct,Fa,Ma,Me,Pa,lt,Na,za,Ia,jt,Oa,La,re,Pe,Da,qt,Wa,no,V,se,Ft,Ne,Ha,Mt,Ra,io,M,ze,Ua,Ie,Va,Oe,Ba,Ga,Ya,j,Le,Ja,B,Ka,dt,Qa,Xa,Pt,Za,er,tr,ne,or,ie,lo,G,le,Nt,De,ar,zt,rr,co,k,We,sr,It,nr,ir,He,lr,Re,dr,cr,mr,q,Ue,ur,Y,fr,ct,pr,hr,Ot,gr,_r,Tr,de,vr,ce,mo;return d=new Je({}),he=new Je({}),we=new Je({}),ye=new Cs({props:{pipeline:"audio-classification"}}),ke=new Je({}),Ce=new Ye({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/main/src/transformers/models/audio_spectrogram_transformer/configuration_audio_spectrogram_transformer.py#L31"}}),oe=new br({props:{anchor:"transformers.ASTConfig.example",$$slots:{default:[js]},$$scope:{ctx:C}}}),qe=new Je({}),Fe=new Ye({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/main/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/main/src/transformers/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.py#L33"}}),Pe=new Ye({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[transformers.utils.generic.TensorType, str, 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/main/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/main/src/transformers/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.py#L125"}}),Ne=new Je({}),ze=new Ye({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/main/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/main/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/main/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py#L444"}}),Le=new Ye({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/main/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py#L468",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new ws({props:{$$slots:{default:[qs]},$$scope:{ctx:C}}}),ie=new br({props:{anchor:"transformers.ASTModel.forward.example",$$slots:{default:[Fs]},$$scope:{ctx:C}}}),De=new Je({}),We=new Ye({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/main/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/main/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/main/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py#L544"}}),Ue=new Ye({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/main/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<a href="/docs/transformers/main/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/main/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/main/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py#L557",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new ws({props:{$$slots:{default:[Ms]},$$scope:{ctx:C}}}),ce=new br({props:{anchor:"transformers.ASTForAudioClassification.forward.example",$$slots:{default:[Ps]},$$scope:{ctx:C}}}),{c(){p=a("meta"),v=m(),_=a("h1"),h=a("a"),T=a("span"),b(d.$$.fragment),g=m(),F=a("span"),xo=n("Audio Spectrogram Transformer"),Ht=m(),O=a("h2"),J=a("a"),vt=a("span"),b(he.$$.fragment),Eo=m(),bt=a("span"),ko=n("Overview"),Rt=m(),P=a("p"),Co=n("The Audio Spectrogram Transformer model was proposed in "),ge=a("a"),jo=n("AST: Audio Spectrogram Transformer"),qo=n(` by Yuan Gong, Yu-An Chung, James Glass.
The Audio Spectrogram Transformer applies a `),Ke=a("a"),Fo=n("Vision Transformer"),Mo=n(` to audio, by turning audio into an image (spectrogram). The model obtains state-of-the-art results
for audio classification.`),Ut=m(),Qe=a("p"),Po=n("The abstract from the paper is the following:"),Vt=m(),Xe=a("p"),At=a("em"),No=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."),Bt=m(),Ze=a("p"),zo=n("Tips:"),Gt=m(),K=a("ul"),L=a("li"),Io=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). `),et=a("a"),Oo=n("ASTFeatureExtractor"),Lo=n(` takes care of this. Note that it uses the AudioSet
mean and std by default. You can check `),_e=a("a"),wt=a("code"),Do=n("ast/src/get_norm_stats.py"),Wo=n(` to see how
the authors compute the stats for a downstream dataset.`),Ho=m(),Te=a("li"),Ro=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
`),ve=a("a"),Uo=n("PSLA paper"),Vo=n(") and converges quickly, so please search for a suitable learning rate and learning rate scheduler for your task."),Yt=m(),Q=a("img"),Jt=m(),X=a("small"),Bo=n("Audio pectrogram Transformer architecture. Taken from the "),tt=a("a"),Go=n("original paper"),Yo=n("."),Kt=m(),N=a("p"),Jo=n("This model was contributed by "),be=a("a"),Ko=n("nielsr"),Qo=n(`.
The original code can be found `),Ae=a("a"),Xo=n("here"),Zo=n("."),Qt=m(),D=a("h2"),Z=a("a"),yt=a("span"),b(we.$$.fragment),ea=m(),$t=a("span"),ta=n("Resources"),Xt=m(),ot=a("p"),oa=n("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with the Audio Spectrogram Transformer."),Zt=m(),b(ye.$$.fragment),eo=m(),ee=a("ul"),$e=a("li"),aa=n("A notebook illustrating inference with AST for audio classification can be found "),Se=a("a"),ra=n("here"),sa=n("."),na=m(),z=a("li"),at=a("a"),ia=n("ASTForAudioClassification"),la=n(" is supported by this "),xe=a("a"),da=n("example script"),ca=n(" and "),Ee=a("a"),ma=n("notebook"),ua=n("."),to=m(),rt=a("p"),fa=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."),oo=m(),W=a("h2"),te=a("a"),St=a("span"),b(ke.$$.fragment),pa=m(),xt=a("span"),ha=n("ASTConfig"),ao=m(),E=a("div"),b(Ce.$$.fragment),ga=m(),H=a("p"),_a=n("This is the configuration class to store the configuration of a "),st=a("a"),Ta=n("ASTModel"),va=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
`),je=a("a"),ba=n("MIT/ast-finetuned-audioset-10-10-0.4593"),Aa=n(`
architecture.`),wa=m(),R=a("p"),ya=n("Configuration objects inherit from "),nt=a("a"),$a=n("PretrainedConfig"),Sa=n(` and can be used to control the model outputs. Read the
documentation from `),it=a("a"),xa=n("PretrainedConfig"),Ea=n(" for more information."),ka=m(),b(oe.$$.fragment),ro=m(),U=a("h2"),ae=a("a"),Et=a("span"),b(qe.$$.fragment),Ca=m(),kt=a("span"),ja=n("ASTFeatureExtractor"),so=m(),x=a("div"),b(Fe.$$.fragment),qa=m(),Ct=a("p"),Fa=n("Constructs a Audio Spectrogram Transformer (AST) feature extractor."),Ma=m(),Me=a("p"),Pa=n("This feature extractor inherits from "),lt=a("a"),Na=n("SequenceFeatureExtractor"),za=n(` which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`),Ia=m(),jt=a("p"),Oa=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.`),La=m(),re=a("div"),b(Pe.$$.fragment),Da=m(),qt=a("p"),Wa=n("Main method to featurize and prepare for the model one or several sequence(s)."),no=m(),V=a("h2"),se=a("a"),Ft=a("span"),b(Ne.$$.fragment),Ha=m(),Mt=a("span"),Ra=n("ASTModel"),io=m(),M=a("div"),b(ze.$$.fragment),Ua=m(),Ie=a("p"),Va=n(`The bare AST Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Oe=a("a"),Ba=n("torch.nn.Module"),Ga=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ya=m(),j=a("div"),b(Le.$$.fragment),Ja=m(),B=a("p"),Ka=n("The "),dt=a("a"),Qa=n("ASTModel"),Xa=n(" forward method, overrides the "),Pt=a("code"),Za=n("__call__"),er=n(" special method."),tr=m(),b(ne.$$.fragment),or=m(),b(ie.$$.fragment),lo=m(),G=a("h2"),le=a("a"),Nt=a("span"),b(De.$$.fragment),ar=m(),zt=a("span"),rr=n("ASTForAudioClassification"),co=m(),k=a("div"),b(We.$$.fragment),sr=m(),It=a("p"),nr=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.`),ir=m(),He=a("p"),lr=n("This model is a PyTorch "),Re=a("a"),dr=n("torch.nn.Module"),cr=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),mr=m(),q=a("div"),b(Ue.$$.fragment),ur=m(),Y=a("p"),fr=n("The "),ct=a("a"),pr=n("ASTForAudioClassification"),hr=n(" forward method, overrides the "),Ot=a("code"),gr=n("__call__"),_r=n(" special method."),Tr=m(),b(de.$$.fragment),vr=m(),b(ce.$$.fragment),this.h()},l(e){const c=xs('[data-svelte="svelte-1phssyn"]',document.head);p=r(c,"META",{name:!0,content:!0}),c.forEach(o),v=u(e),_=r(e,"H1",{class:!0});var Ve=s(_);h=r(Ve,"A",{id:!0,class:!0,href:!0});var Lt=s(h);T=r(Lt,"SPAN",{});var Dt=s(T);A(d.$$.fragment,Dt),Dt.forEach(o),Lt.forEach(o),g=u(Ve),F=r(Ve,"SPAN",{});var Wt=s(F);xo=i(Wt,"Audio Spectrogram Transformer"),Wt.forEach(o),Ve.forEach(o),Ht=u(e),O=r(e,"H2",{class:!0});var Be=s(O);J=r(Be,"A",{id:!0,class:!0,href:!0});var $r=s(J);vt=r($r,"SPAN",{});var Sr=s(vt);A(he.$$.fragment,Sr),Sr.forEach(o),$r.forEach(o),Eo=u(Be),bt=r(Be,"SPAN",{});var xr=s(bt);ko=i(xr,"Overview"),xr.forEach(o),Be.forEach(o),Rt=u(e),P=r(e,"P",{});var mt=s(P);Co=i(mt,"The Audio Spectrogram Transformer model was proposed in "),ge=r(mt,"A",{href:!0,rel:!0});var Er=s(ge);jo=i(Er,"AST: Audio Spectrogram Transformer"),Er.forEach(o),qo=i(mt,` by Yuan Gong, Yu-An Chung, James Glass.
The Audio Spectrogram Transformer applies a `),Ke=r(mt,"A",{href:!0});var kr=s(Ke);Fo=i(kr,"Vision Transformer"),kr.forEach(o),Mo=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),Ut=u(e),Qe=r(e,"P",{});var Cr=s(Qe);Po=i(Cr,"The abstract from the paper is the following:"),Cr.forEach(o),Vt=u(e),Xe=r(e,"P",{});var jr=s(Xe);At=r(jr,"EM",{});var qr=s(At);No=i(qr,"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."),qr.forEach(o),jr.forEach(o),Bt=u(e),Ze=r(e,"P",{});var Fr=s(Ze);zo=i(Fr,"Tips:"),Fr.forEach(o),Gt=u(e),K=r(e,"UL",{});var uo=s(K);L=r(uo,"LI",{});var ut=s(L);Io=i(ut,`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). `),et=r(ut,"A",{href:!0});var Mr=s(et);Oo=i(Mr,"ASTFeatureExtractor"),Mr.forEach(o),Lo=i(ut,` takes care of this. Note that it uses the AudioSet
mean and std by default. You can check `),_e=r(ut,"A",{href:!0,rel:!0});var Pr=s(_e);wt=r(Pr,"CODE",{});var Nr=s(wt);Do=i(Nr,"ast/src/get_norm_stats.py"),Nr.forEach(o),Pr.forEach(o),Wo=i(ut,` to see how
the authors compute the stats for a downstream dataset.`),ut.forEach(o),Ho=u(uo),Te=r(uo,"LI",{});var fo=s(Te);Ro=i(fo,`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
`),ve=r(fo,"A",{href:!0,rel:!0});var zr=s(ve);Uo=i(zr,"PSLA paper"),zr.forEach(o),Vo=i(fo,") and converges quickly, so please search for a suitable learning rate and learning rate scheduler for your task."),fo.forEach(o),uo.forEach(o),Yt=u(e),Q=r(e,"IMG",{src:!0,alt:!0,width:!0}),Jt=u(e),X=r(e,"SMALL",{});var po=s(X);Bo=i(po,"Audio pectrogram Transformer architecture. Taken from the "),tt=r(po,"A",{href:!0});var Ir=s(tt);Go=i(Ir,"original paper"),Ir.forEach(o),Yo=i(po,"."),po.forEach(o),Kt=u(e),N=r(e,"P",{});var ft=s(N);Jo=i(ft,"This model was contributed by "),be=r(ft,"A",{href:!0,rel:!0});var Or=s(be);Ko=i(Or,"nielsr"),Or.forEach(o),Qo=i(ft,`.
The original code can be found `),Ae=r(ft,"A",{href:!0,rel:!0});var Lr=s(Ae);Xo=i(Lr,"here"),Lr.forEach(o),Zo=i(ft,"."),ft.forEach(o),Qt=u(e),D=r(e,"H2",{class:!0});var ho=s(D);Z=r(ho,"A",{id:!0,class:!0,href:!0});var Dr=s(Z);yt=r(Dr,"SPAN",{});var Wr=s(yt);A(we.$$.fragment,Wr),Wr.forEach(o),Dr.forEach(o),ea=u(ho),$t=r(ho,"SPAN",{});var Hr=s($t);ta=i(Hr,"Resources"),Hr.forEach(o),ho.forEach(o),Xt=u(e),ot=r(e,"P",{});var Rr=s(ot);oa=i(Rr,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with the Audio Spectrogram Transformer."),Rr.forEach(o),Zt=u(e),A(ye.$$.fragment,e),eo=u(e),ee=r(e,"UL",{});var go=s(ee);$e=r(go,"LI",{});var _o=s($e);aa=i(_o,"A notebook illustrating inference with AST for audio classification can be found "),Se=r(_o,"A",{href:!0,rel:!0});var Ur=s(Se);ra=i(Ur,"here"),Ur.forEach(o),sa=i(_o,"."),_o.forEach(o),na=u(go),z=r(go,"LI",{});var Ge=s(z);at=r(Ge,"A",{href:!0});var Vr=s(at);ia=i(Vr,"ASTForAudioClassification"),Vr.forEach(o),la=i(Ge," is supported by this "),xe=r(Ge,"A",{href:!0,rel:!0});var Br=s(xe);da=i(Br,"example script"),Br.forEach(o),ca=i(Ge," and "),Ee=r(Ge,"A",{href:!0,rel:!0});var Gr=s(Ee);ma=i(Gr,"notebook"),Gr.forEach(o),ua=i(Ge,"."),Ge.forEach(o),go.forEach(o),to=u(e),rt=r(e,"P",{});var Yr=s(rt);fa=i(Yr,"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."),Yr.forEach(o),oo=u(e),W=r(e,"H2",{class:!0});var To=s(W);te=r(To,"A",{id:!0,class:!0,href:!0});var Jr=s(te);St=r(Jr,"SPAN",{});var Kr=s(St);A(ke.$$.fragment,Kr),Kr.forEach(o),Jr.forEach(o),pa=u(To),xt=r(To,"SPAN",{});var Qr=s(xt);ha=i(Qr,"ASTConfig"),Qr.forEach(o),To.forEach(o),ao=u(e),E=r(e,"DIV",{class:!0});var me=s(E);A(Ce.$$.fragment,me),ga=u(me),H=r(me,"P",{});var pt=s(H);_a=i(pt,"This is the configuration class to store the configuration of a "),st=r(pt,"A",{href:!0});var Xr=s(st);Ta=i(Xr,"ASTModel"),Xr.forEach(o),va=i(pt,`. 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
`),je=r(pt,"A",{href:!0,rel:!0});var Zr=s(je);ba=i(Zr,"MIT/ast-finetuned-audioset-10-10-0.4593"),Zr.forEach(o),Aa=i(pt,`
architecture.`),pt.forEach(o),wa=u(me),R=r(me,"P",{});var ht=s(R);ya=i(ht,"Configuration objects inherit from "),nt=r(ht,"A",{href:!0});var es=s(nt);$a=i(es,"PretrainedConfig"),es.forEach(o),Sa=i(ht,` and can be used to control the model outputs. Read the
documentation from `),it=r(ht,"A",{href:!0});var ts=s(it);xa=i(ts,"PretrainedConfig"),ts.forEach(o),Ea=i(ht," for more information."),ht.forEach(o),ka=u(me),A(oe.$$.fragment,me),me.forEach(o),ro=u(e),U=r(e,"H2",{class:!0});var vo=s(U);ae=r(vo,"A",{id:!0,class:!0,href:!0});var os=s(ae);Et=r(os,"SPAN",{});var as=s(Et);A(qe.$$.fragment,as),as.forEach(o),os.forEach(o),Ca=u(vo),kt=r(vo,"SPAN",{});var rs=s(kt);ja=i(rs,"ASTFeatureExtractor"),rs.forEach(o),vo.forEach(o),so=u(e),x=r(e,"DIV",{class:!0});var I=s(x);A(Fe.$$.fragment,I),qa=u(I),Ct=r(I,"P",{});var ss=s(Ct);Fa=i(ss,"Constructs a Audio Spectrogram Transformer (AST) feature extractor."),ss.forEach(o),Ma=u(I),Me=r(I,"P",{});var bo=s(Me);Pa=i(bo,"This feature extractor inherits from "),lt=r(bo,"A",{href:!0});var ns=s(lt);Na=i(ns,"SequenceFeatureExtractor"),ns.forEach(o),za=i(bo,` which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.`),bo.forEach(o),Ia=u(I),jt=r(I,"P",{});var is=s(jt);Oa=i(is,`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.`),is.forEach(o),La=u(I),re=r(I,"DIV",{class:!0});var Ao=s(re);A(Pe.$$.fragment,Ao),Da=u(Ao),qt=r(Ao,"P",{});var ls=s(qt);Wa=i(ls,"Main method to featurize and prepare for the model one or several sequence(s)."),ls.forEach(o),Ao.forEach(o),I.forEach(o),no=u(e),V=r(e,"H2",{class:!0});var wo=s(V);se=r(wo,"A",{id:!0,class:!0,href:!0});var ds=s(se);Ft=r(ds,"SPAN",{});var cs=s(Ft);A(Ne.$$.fragment,cs),cs.forEach(o),ds.forEach(o),Ha=u(wo),Mt=r(wo,"SPAN",{});var ms=s(Mt);Ra=i(ms,"ASTModel"),ms.forEach(o),wo.forEach(o),io=u(e),M=r(e,"DIV",{class:!0});var gt=s(M);A(ze.$$.fragment,gt),Ua=u(gt),Ie=r(gt,"P",{});var yo=s(Ie);Va=i(yo,`The bare AST Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Oe=r(yo,"A",{href:!0,rel:!0});var us=s(Oe);Ba=i(us,"torch.nn.Module"),us.forEach(o),Ga=i(yo,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),yo.forEach(o),Ya=u(gt),j=r(gt,"DIV",{class:!0});var ue=s(j);A(Le.$$.fragment,ue),Ja=u(ue),B=r(ue,"P",{});var _t=s(B);Ka=i(_t,"The "),dt=r(_t,"A",{href:!0});var fs=s(dt);Qa=i(fs,"ASTModel"),fs.forEach(o),Xa=i(_t," forward method, overrides the "),Pt=r(_t,"CODE",{});var ps=s(Pt);Za=i(ps,"__call__"),ps.forEach(o),er=i(_t," special method."),_t.forEach(o),tr=u(ue),A(ne.$$.fragment,ue),or=u(ue),A(ie.$$.fragment,ue),ue.forEach(o),gt.forEach(o),lo=u(e),G=r(e,"H2",{class:!0});var $o=s(G);le=r($o,"A",{id:!0,class:!0,href:!0});var hs=s(le);Nt=r(hs,"SPAN",{});var gs=s(Nt);A(De.$$.fragment,gs),gs.forEach(o),hs.forEach(o),ar=u($o),zt=r($o,"SPAN",{});var _s=s(zt);rr=i(_s,"ASTForAudioClassification"),_s.forEach(o),$o.forEach(o),co=u(e),k=r(e,"DIV",{class:!0});var fe=s(k);A(We.$$.fragment,fe),sr=u(fe),It=r(fe,"P",{});var Ts=s(It);nr=i(Ts,`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.`),Ts.forEach(o),ir=u(fe),He=r(fe,"P",{});var So=s(He);lr=i(So,"This model is a PyTorch "),Re=r(So,"A",{href:!0,rel:!0});var vs=s(Re);dr=i(vs,"torch.nn.Module"),vs.forEach(o),cr=i(So,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),So.forEach(o),mr=u(fe),q=r(fe,"DIV",{class:!0});var pe=s(q);A(Ue.$$.fragment,pe),ur=u(pe),Y=r(pe,"P",{});var Tt=s(Y);fr=i(Tt,"The "),ct=r(Tt,"A",{href:!0});var bs=s(ct);pr=i(bs,"ASTForAudioClassification"),bs.forEach(o),hr=i(Tt," forward method, overrides the "),Ot=r(Tt,"CODE",{});var As=s(Ot);gr=i(As,"__call__"),As.forEach(o),_r=i(Tt," special method."),Tt.forEach(o),Tr=u(pe),A(de.$$.fragment,pe),vr=u(pe),A(ce.$$.fragment,pe),pe.forEach(o),fe.forEach(o),this.h()},h(){l(p,"name","hf:doc:metadata"),l(p,"content",JSON.stringify(zs)),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(J,"id","overview"),l(J,"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(J,"href","#overview"),l(O,"class","relative group"),l(ge,"href","https://arxiv.org/abs/2104.01778"),l(ge,"rel","nofollow"),l(Ke,"href","vit"),l(et,"href","/docs/transformers/main/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(ve,"href","https://arxiv.org/abs/2102.01243"),l(ve,"rel","nofollow"),Es(Q.src,yr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/audio_spectogram_transformer_architecture.png")||l(Q,"src",yr),l(Q,"alt","drawing"),l(Q,"width","600"),l(tt,"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(Z,"id","resources"),l(Z,"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(Z,"href","#resources"),l(D,"class","relative group"),l(Se,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/AST"),l(Se,"rel","nofollow"),l(at,"href","/docs/transformers/main/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(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(W,"class","relative group"),l(st,"href","/docs/transformers/main/en/model_doc/audio-spectrogram-transformer#transformers.ASTModel"),l(je,"href","https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593"),l(je,"rel","nofollow"),l(nt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),l(it,"href","/docs/transformers/main/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(U,"class","relative group"),l(lt,"href","/docs/transformers/main/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(V,"class","relative group"),l(Oe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Oe,"rel","nofollow"),l(dt,"href","/docs/transformers/main/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(G,"class","relative group"),l(Re,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Re,"rel","nofollow"),l(ct,"href","/docs/transformers/main/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),f(e,v,c),f(e,_,c),t(_,h),t(h,T),w(d,T,null),t(_,g),t(_,F),t(F,xo),f(e,Ht,c),f(e,O,c),t(O,J),t(J,vt),w(he,vt,null),t(O,Eo),t(O,bt),t(bt,ko),f(e,Rt,c),f(e,P,c),t(P,Co),t(P,ge),t(ge,jo),t(P,qo),t(P,Ke),t(Ke,Fo),t(P,Mo),f(e,Ut,c),f(e,Qe,c),t(Qe,Po),f(e,Vt,c),f(e,Xe,c),t(Xe,At),t(At,No),f(e,Bt,c),f(e,Ze,c),t(Ze,zo),f(e,Gt,c),f(e,K,c),t(K,L),t(L,Io),t(L,et),t(et,Oo),t(L,Lo),t(L,_e),t(_e,wt),t(wt,Do),t(L,Wo),t(K,Ho),t(K,Te),t(Te,Ro),t(Te,ve),t(ve,Uo),t(Te,Vo),f(e,Yt,c),f(e,Q,c),f(e,Jt,c),f(e,X,c),t(X,Bo),t(X,tt),t(tt,Go),t(X,Yo),f(e,Kt,c),f(e,N,c),t(N,Jo),t(N,be),t(be,Ko),t(N,Qo),t(N,Ae),t(Ae,Xo),t(N,Zo),f(e,Qt,c),f(e,D,c),t(D,Z),t(Z,yt),w(we,yt,null),t(D,ea),t(D,$t),t($t,ta),f(e,Xt,c),f(e,ot,c),t(ot,oa),f(e,Zt,c),w(ye,e,c),f(e,eo,c),f(e,ee,c),t(ee,$e),t($e,aa),t($e,Se),t(Se,ra),t($e,sa),t(ee,na),t(ee,z),t(z,at),t(at,ia),t(z,la),t(z,xe),t(xe,da),t(z,ca),t(z,Ee),t(Ee,ma),t(z,ua),f(e,to,c),f(e,rt,c),t(rt,fa),f(e,oo,c),f(e,W,c),t(W,te),t(te,St),w(ke,St,null),t(W,pa),t(W,xt),t(xt,ha),f(e,ao,c),f(e,E,c),w(Ce,E,null),t(E,ga),t(E,H),t(H,_a),t(H,st),t(st,Ta),t(H,va),t(H,je),t(je,ba),t(H,Aa),t(E,wa),t(E,R),t(R,ya),t(R,nt),t(nt,$a),t(R,Sa),t(R,it),t(it,xa),t(R,Ea),t(E,ka),w(oe,E,null),f(e,ro,c),f(e,U,c),t(U,ae),t(ae,Et),w(qe,Et,null),t(U,Ca),t(U,kt),t(kt,ja),f(e,so,c),f(e,x,c),w(Fe,x,null),t(x,qa),t(x,Ct),t(Ct,Fa),t(x,Ma),t(x,Me),t(Me,Pa),t(Me,lt),t(lt,Na),t(Me,za),t(x,Ia),t(x,jt),t(jt,Oa),t(x,La),t(x,re),w(Pe,re,null),t(re,Da),t(re,qt),t(qt,Wa),f(e,no,c),f(e,V,c),t(V,se),t(se,Ft),w(Ne,Ft,null),t(V,Ha),t(V,Mt),t(Mt,Ra),f(e,io,c),f(e,M,c),w(ze,M,null),t(M,Ua),t(M,Ie),t(Ie,Va),t(Ie,Oe),t(Oe,Ba),t(Ie,Ga),t(M,Ya),t(M,j),w(Le,j,null),t(j,Ja),t(j,B),t(B,Ka),t(B,dt),t(dt,Qa),t(B,Xa),t(B,Pt),t(Pt,Za),t(B,er),t(j,tr),w(ne,j,null),t(j,or),w(ie,j,null),f(e,lo,c),f(e,G,c),t(G,le),t(le,Nt),w(De,Nt,null),t(G,ar),t(G,zt),t(zt,rr),f(e,co,c),f(e,k,c),w(We,k,null),t(k,sr),t(k,It),t(It,nr),t(k,ir),t(k,He),t(He,lr),t(He,Re),t(Re,dr),t(He,cr),t(k,mr),t(k,q),w(Ue,q,null),t(q,ur),t(q,Y),t(Y,fr),t(Y,ct),t(ct,pr),t(Y,hr),t(Y,Ot),t(Ot,gr),t(Y,_r),t(q,Tr),w(de,q,null),t(q,vr),w(ce,q,null),mo=!0},p(e,[c]){const Ve={};c&2&&(Ve.$$scope={dirty:c,ctx:e}),oe.$set(Ve);const Lt={};c&2&&(Lt.$$scope={dirty:c,ctx:e}),ne.$set(Lt);const Dt={};c&2&&(Dt.$$scope={dirty:c,ctx:e}),ie.$set(Dt);const Wt={};c&2&&(Wt.$$scope={dirty:c,ctx:e}),de.$set(Wt);const Be={};c&2&&(Be.$$scope={dirty:c,ctx:e}),ce.$set(Be)},i(e){mo||(y(d.$$.fragment,e),y(he.$$.fragment,e),y(we.$$.fragment,e),y(ye.$$.fragment,e),y(ke.$$.fragment,e),y(Ce.$$.fragment,e),y(oe.$$.fragment,e),y(qe.$$.fragment,e),y(Fe.$$.fragment,e),y(Pe.$$.fragment,e),y(Ne.$$.fragment,e),y(ze.$$.fragment,e),y(Le.$$.fragment,e),y(ne.$$.fragment,e),y(ie.$$.fragment,e),y(De.$$.fragment,e),y(We.$$.fragment,e),y(Ue.$$.fragment,e),y(de.$$.fragment,e),y(ce.$$.fragment,e),mo=!0)},o(e){$(d.$$.fragment,e),$(he.$$.fragment,e),$(we.$$.fragment,e),$(ye.$$.fragment,e),$(ke.$$.fragment,e),$(Ce.$$.fragment,e),$(oe.$$.fragment,e),$(qe.$$.fragment,e),$(Fe.$$.fragment,e),$(Pe.$$.fragment,e),$(Ne.$$.fragment,e),$(ze.$$.fragment,e),$(Le.$$.fragment,e),$(ne.$$.fragment,e),$(ie.$$.fragment,e),$(De.$$.fragment,e),$(We.$$.fragment,e),$(Ue.$$.fragment,e),$(de.$$.fragment,e),$(ce.$$.fragment,e),mo=!1},d(e){o(p),e&&o(v),e&&o(_),S(d),e&&o(Ht),e&&o(O),S(he),e&&o(Rt),e&&o(P),e&&o(Ut),e&&o(Qe),e&&o(Vt),e&&o(Xe),e&&o(Bt),e&&o(Ze),e&&o(Gt),e&&o(K),e&&o(Yt),e&&o(Q),e&&o(Jt),e&&o(X),e&&o(Kt),e&&o(N),e&&o(Qt),e&&o(D),S(we),e&&o(Xt),e&&o(ot),e&&o(Zt),S(ye,e),e&&o(eo),e&&o(ee),e&&o(to),e&&o(rt),e&&o(oo),e&&o(W),S(ke),e&&o(ao),e&&o(E),S(Ce),S(oe),e&&o(ro),e&&o(U),S(qe),e&&o(so),e&&o(x),S(Fe),S(Pe),e&&o(no),e&&o(V),S(Ne),e&&o(io),e&&o(M),S(ze),S(Le),S(ne),S(ie),e&&o(lo),e&&o(G),S(De),e&&o(co),e&&o(k),S(We),S(Ue),S(de),S(ce)}}}const zs={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 Is(C){return ks(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vs extends ys{constructor(p){super();$s(this,p,Is,Ns,Ss,{})}}export{Vs as default,zs as metadata};
