import{S as Bi,i as Ri,s as Wi,e as a,k as p,w as T,t as s,M as Ui,c as r,d as t,m as u,a as i,x as k,h as n,b as h,G as e,g,y as $,q as C,o as H,B as E,v as Vi,L as ts}from"../../chunks/vendor-hf-doc-builder.js";import{T as Po}from"../../chunks/Tip-hf-doc-builder.js";import{D as ot}from"../../chunks/Docstring-hf-doc-builder.js";import{C as os}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as wt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as es}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ki(M){let d,y,f,m,v;return m=new os({props:{code:`from transformers import HubertModel, HubertConfig

# Initializing a Hubert facebook/hubert-base-ls960 style configuration
configuration = HubertConfig()

# Initializing a model from the facebook/hubert-base-ls960 style configuration
model = HubertModel(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> HubertModel, HubertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Hubert facebook/hubert-base-ls960 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = HubertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the facebook/hubert-base-ls960 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = HubertModel(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(){d=a("p"),y=s("Example:"),f=p(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),f=u(l),k(m.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,f,c),$(m,l,c),v=!0},p:ts,i(l){v||(C(m.$$.fragment,l),v=!0)},o(l){H(m.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(f),E(m,l)}}}function Yi(M){let d,y,f,m,v;return{c(){d=a("p"),y=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=s("Module"),v=s(`
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(l){d=r(l,"P",{});var c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=i(f);m=n(F,"Module"),F.forEach(t),v=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,y),e(d,f),e(f,m),e(d,v)},d(l){l&&t(d)}}}function Gi(M){let d,y,f,m,v;return m=new os({props:{code:`from transformers import AutoProcessor, HubertModel
from datasets import load_dataset
import soundfile as sf

processor = AutoProcessor.from_pretrained("facebook/hubert-large-ls960-ft")
model = HubertModel.from_pretrained("facebook/hubert-large-ls960-ft")


def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch


ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)

input_values = processor(ds["speech"][0], return_tensors="pt").input_values  # Batch size 1
hidden_states = model(input_values).last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, HubertModel
<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> soundfile <span class="hljs-keyword">as</span> sf

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/hubert-large-ls960-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = HubertModel.from_pretrained(<span class="hljs-string">&quot;facebook/hubert-large-ls960-ft&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    speech, _ = sf.read(batch[<span class="hljs-string">&quot;file&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = speech
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_values  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = model(input_values).last_hidden_state`}}),{c(){d=a("p"),y=s("Example:"),f=p(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),f=u(l),k(m.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,f,c),$(m,l,c),v=!0},p:ts,i(l){v||(C(m.$$.fragment,l),v=!0)},o(l){H(m.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(f),E(m,l)}}}function Xi(M){let d,y,f,m,v;return{c(){d=a("p"),y=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=s("Module"),v=s(`
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(l){d=r(l,"P",{});var c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=i(f);m=n(F,"Module"),F.forEach(t),v=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,y),e(d,f),e(f,m),e(d,v)},d(l){l&&t(d)}}}function Ji(M){let d,y,f,m,v;return m=new os({props:{code:`from transformers import AutoProcessor, HubertForCTC
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

processor = AutoProcessor.from_pretrained("facebook/hubert-large-ls960-ft")
model = HubertForCTC.from_pretrained("facebook/hubert-large-ls960-ft")

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

# transcribe speech
transcription = processor.batch_decode(predicted_ids)
transcription[0]

inputs["labels"] = processor(text=dataset[0]["text"], return_tensors="pt").input_ids

# compute loss
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> AutoProcessor, HubertForCTC
<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>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/hubert-large-ls960-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = HubertForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/hubert-large-ls960-ft&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>    logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># transcribe speech</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(predicted_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;MISTER QUILTER IS THE APOSTLE OF THE MIDDLE CLASSES AND WE ARE GLAD TO WELCOME HIS GOSPEL&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs[<span class="hljs-string">&quot;labels&quot;</span>] = processor(text=dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;text&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss</span>
<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">22.68</span>`}}),{c(){d=a("p"),y=s("Example:"),f=p(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),f=u(l),k(m.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,f,c),$(m,l,c),v=!0},p:ts,i(l){v||(C(m.$$.fragment,l),v=!0)},o(l){H(m.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(f),E(m,l)}}}function Qi(M){let d,y,f,m,v;return{c(){d=a("p"),y=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=s("Module"),v=s(`
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(l){d=r(l,"P",{});var c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=i(f);m=n(F,"Module"),F.forEach(t),v=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,y),e(d,f),e(f,m),e(d,v)},d(l){l&&t(d)}}}function Zi(M){let d,y,f,m,v;return m=new os({props:{code:`from transformers import AutoFeatureExtractor, HubertForSequenceClassification
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("superb/hubert-base-superb-ks")
model = HubertForSequenceClassification.from_pretrained("superb/hubert-base-superb-ks")

# 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, HubertForSequenceClassification
<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;superb/hubert-base-superb-ks&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = HubertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;superb/hubert-base-superb-ks&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;_unknown_&#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">8.53</span>`}}),{c(){d=a("p"),y=s("Example:"),f=p(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),f=u(l),k(m.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,f,c),$(m,l,c),v=!0},p:ts,i(l){v||(C(m.$$.fragment,l),v=!0)},o(l){H(m.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(f),E(m,l)}}}function el(M){let d,y,f,m,v,l,c,F,Ie,we,S,X,ee,w,Le,U,Ne,Te,L,Be,te,oe,Re,ke,R,We,$e,W,ge,Ue,me,q,O,Ce,N,_e,Ve,se,ne,Ke,A,Ye,ae,He,J,re,ie,Ge,V,Ee,D,Q,le,P,Xe,z,Je,je;return{c(){d=a("p"),y=s("TensorFlow models and layers in "),f=a("code"),m=s("transformers"),v=s(" accept two formats as input:"),l=p(),c=a("ul"),F=a("li"),Ie=s("having all inputs as keyword arguments (like PyTorch models), or"),we=p(),S=a("li"),X=s("having all inputs as a list, tuple or dict in the first positional argument."),ee=p(),w=a("p"),Le=s(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),U=a("code"),Ne=s("model.fit()"),Te=s(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a("code"),Be=s("model.fit()"),te=s(` supports! If, however, you want to use the second
format outside of Keras methods like `),oe=a("code"),Re=s("fit()"),ke=s(" and "),R=a("code"),We=s("predict()"),$e=s(`, such as when creating your own layers or models with
the Keras `),W=a("code"),ge=s("Functional"),Ue=s(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),me=p(),q=a("ul"),O=a("li"),Ce=s("a single Tensor with "),N=a("code"),_e=s("input_values"),Ve=s(" only and nothing else: "),se=a("code"),ne=s("model(input_values)"),Ke=p(),A=a("li"),Ye=s(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ae=a("code"),He=s("model([input_values, attention_mask])"),J=s(" or "),re=a("code"),ie=s("model([input_values, attention_mask, token_type_ids])"),Ge=p(),V=a("li"),Ee=s(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=a("code"),Q=s('model({"input_values": input_values, "token_type_ids": token_type_ids})'),le=p(),P=a("p"),Xe=s(`Note that when creating models and layers with
`),z=a("a"),Je=s("subclassing"),je=s(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(b){d=r(b,"P",{});var j=i(d);y=n(j,"TensorFlow models and layers in "),f=r(j,"CODE",{});var Fe=i(f);m=n(Fe,"transformers"),Fe.forEach(t),v=n(j," accept two formats as input:"),j.forEach(t),l=u(b),c=r(b,"UL",{});var be=i(c);F=r(be,"LI",{});var rt=i(F);Ie=n(rt,"having all inputs as keyword arguments (like PyTorch models), or"),rt.forEach(t),we=u(be),S=r(be,"LI",{});var Qe=i(S);X=n(Qe,"having all inputs as a list, tuple or dict in the first positional argument."),Qe.forEach(t),be.forEach(t),ee=u(b),w=r(b,"P",{});var x=i(w);Le=n(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),U=r(x,"CODE",{});var it=i(U);Ne=n(it,"model.fit()"),it.forEach(t),Te=n(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=r(x,"CODE",{});var st=i(L);Be=n(st,"model.fit()"),st.forEach(t),te=n(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),oe=r(x,"CODE",{});var de=i(oe);Re=n(de,"fit()"),de.forEach(t),ke=n(x," and "),R=r(x,"CODE",{});var fe=i(R);We=n(fe,"predict()"),fe.forEach(t),$e=n(x,`, such as when creating your own layers or models with
the Keras `),W=r(x,"CODE",{});var Ze=i(W);ge=n(Ze,"Functional"),Ze.forEach(t),Ue=n(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),me=u(b),q=r(b,"UL",{});var I=i(q);O=r(I,"LI",{});var ce=i(O);Ce=n(ce,"a single Tensor with "),N=r(ce,"CODE",{});var et=i(N);_e=n(et,"input_values"),et.forEach(t),Ve=n(ce," only and nothing else: "),se=r(ce,"CODE",{});var lt=i(se);ne=n(lt,"model(input_values)"),lt.forEach(t),ce.forEach(t),Ke=u(I),A=r(I,"LI",{});var Z=i(A);Ye=n(Z,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ae=r(Z,"CODE",{});var B=i(ae);He=n(B,"model([input_values, attention_mask])"),B.forEach(t),J=n(Z," or "),re=r(Z,"CODE",{});var ve=i(re);ie=n(ve,"model([input_values, attention_mask, token_type_ids])"),ve.forEach(t),Z.forEach(t),Ge=u(I),V=r(I,"LI",{});var tt=i(V);Ee=n(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=r(tt,"CODE",{});var pe=i(D);Q=n(pe,'model({"input_values": input_values, "token_type_ids": token_type_ids})'),pe.forEach(t),tt.forEach(t),I.forEach(t),le=u(b),P=r(b,"P",{});var ye=i(P);Xe=n(ye,`Note that when creating models and layers with
`),z=r(ye,"A",{href:!0,rel:!0});var xe=i(z);Je=n(xe,"subclassing"),xe.forEach(t),je=n(ye,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ye.forEach(t),this.h()},h(){h(z,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(z,"rel","nofollow")},m(b,j){g(b,d,j),e(d,y),e(d,f),e(f,m),e(d,v),g(b,l,j),g(b,c,j),e(c,F),e(F,Ie),e(c,we),e(c,S),e(S,X),g(b,ee,j),g(b,w,j),e(w,Le),e(w,U),e(U,Ne),e(w,Te),e(w,L),e(L,Be),e(w,te),e(w,oe),e(oe,Re),e(w,ke),e(w,R),e(R,We),e(w,$e),e(w,W),e(W,ge),e(w,Ue),g(b,me,j),g(b,q,j),e(q,O),e(O,Ce),e(O,N),e(N,_e),e(O,Ve),e(O,se),e(se,ne),e(q,Ke),e(q,A),e(A,Ye),e(A,ae),e(ae,He),e(A,J),e(A,re),e(re,ie),e(q,Ge),e(q,V),e(V,Ee),e(V,D),e(D,Q),g(b,le,j),g(b,P,j),e(P,Xe),e(P,z),e(z,Je),e(P,je)},d(b){b&&t(d),b&&t(l),b&&t(c),b&&t(ee),b&&t(w),b&&t(me),b&&t(q),b&&t(le),b&&t(P)}}}function tl(M){let d,y,f,m,v;return{c(){d=a("p"),y=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=s("Module"),v=s(`
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(l){d=r(l,"P",{});var c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=i(f);m=n(F,"Module"),F.forEach(t),v=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,y),e(d,f),e(f,m),e(d,v)},d(l){l&&t(d)}}}function ol(M){let d,y,f,m,v;return m=new os({props:{code:`from transformers import AutoProcessor, TFHubertModel
from datasets import load_dataset
import soundfile as sf

processor = AutoProcessor.from_pretrained("facebook/hubert-large-ls960-ft")
model = TFHubertModel.from_pretrained("facebook/hubert-large-ls960-ft")


def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch


ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)

input_values = processor(ds["speech"][0], return_tensors="tf").input_values  # Batch size 1
hidden_states = model(input_values).last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFHubertModel
<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> soundfile <span class="hljs-keyword">as</span> sf

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/hubert-large-ls960-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFHubertModel.from_pretrained(<span class="hljs-string">&quot;facebook/hubert-large-ls960-ft&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    speech, _ = sf.read(batch[<span class="hljs-string">&quot;file&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = speech
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_values  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>hidden_states = model(input_values).last_hidden_state`}}),{c(){d=a("p"),y=s("Example:"),f=p(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),f=u(l),k(m.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,f,c),$(m,l,c),v=!0},p:ts,i(l){v||(C(m.$$.fragment,l),v=!0)},o(l){H(m.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(f),E(m,l)}}}function sl(M){let d,y,f,m,v,l,c,F,Ie,we,S,X,ee,w,Le,U,Ne,Te,L,Be,te,oe,Re,ke,R,We,$e,W,ge,Ue,me,q,O,Ce,N,_e,Ve,se,ne,Ke,A,Ye,ae,He,J,re,ie,Ge,V,Ee,D,Q,le,P,Xe,z,Je,je;return{c(){d=a("p"),y=s("TensorFlow models and layers in "),f=a("code"),m=s("transformers"),v=s(" accept two formats as input:"),l=p(),c=a("ul"),F=a("li"),Ie=s("having all inputs as keyword arguments (like PyTorch models), or"),we=p(),S=a("li"),X=s("having all inputs as a list, tuple or dict in the first positional argument."),ee=p(),w=a("p"),Le=s(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),U=a("code"),Ne=s("model.fit()"),Te=s(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a("code"),Be=s("model.fit()"),te=s(` supports! If, however, you want to use the second
format outside of Keras methods like `),oe=a("code"),Re=s("fit()"),ke=s(" and "),R=a("code"),We=s("predict()"),$e=s(`, such as when creating your own layers or models with
the Keras `),W=a("code"),ge=s("Functional"),Ue=s(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),me=p(),q=a("ul"),O=a("li"),Ce=s("a single Tensor with "),N=a("code"),_e=s("input_values"),Ve=s(" only and nothing else: "),se=a("code"),ne=s("model(input_values)"),Ke=p(),A=a("li"),Ye=s(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ae=a("code"),He=s("model([input_values, attention_mask])"),J=s(" or "),re=a("code"),ie=s("model([input_values, attention_mask, token_type_ids])"),Ge=p(),V=a("li"),Ee=s(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=a("code"),Q=s('model({"input_values": input_values, "token_type_ids": token_type_ids})'),le=p(),P=a("p"),Xe=s(`Note that when creating models and layers with
`),z=a("a"),Je=s("subclassing"),je=s(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(b){d=r(b,"P",{});var j=i(d);y=n(j,"TensorFlow models and layers in "),f=r(j,"CODE",{});var Fe=i(f);m=n(Fe,"transformers"),Fe.forEach(t),v=n(j," accept two formats as input:"),j.forEach(t),l=u(b),c=r(b,"UL",{});var be=i(c);F=r(be,"LI",{});var rt=i(F);Ie=n(rt,"having all inputs as keyword arguments (like PyTorch models), or"),rt.forEach(t),we=u(be),S=r(be,"LI",{});var Qe=i(S);X=n(Qe,"having all inputs as a list, tuple or dict in the first positional argument."),Qe.forEach(t),be.forEach(t),ee=u(b),w=r(b,"P",{});var x=i(w);Le=n(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),U=r(x,"CODE",{});var it=i(U);Ne=n(it,"model.fit()"),it.forEach(t),Te=n(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=r(x,"CODE",{});var st=i(L);Be=n(st,"model.fit()"),st.forEach(t),te=n(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),oe=r(x,"CODE",{});var de=i(oe);Re=n(de,"fit()"),de.forEach(t),ke=n(x," and "),R=r(x,"CODE",{});var fe=i(R);We=n(fe,"predict()"),fe.forEach(t),$e=n(x,`, such as when creating your own layers or models with
the Keras `),W=r(x,"CODE",{});var Ze=i(W);ge=n(Ze,"Functional"),Ze.forEach(t),Ue=n(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),me=u(b),q=r(b,"UL",{});var I=i(q);O=r(I,"LI",{});var ce=i(O);Ce=n(ce,"a single Tensor with "),N=r(ce,"CODE",{});var et=i(N);_e=n(et,"input_values"),et.forEach(t),Ve=n(ce," only and nothing else: "),se=r(ce,"CODE",{});var lt=i(se);ne=n(lt,"model(input_values)"),lt.forEach(t),ce.forEach(t),Ke=u(I),A=r(I,"LI",{});var Z=i(A);Ye=n(Z,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),ae=r(Z,"CODE",{});var B=i(ae);He=n(B,"model([input_values, attention_mask])"),B.forEach(t),J=n(Z," or "),re=r(Z,"CODE",{});var ve=i(re);ie=n(ve,"model([input_values, attention_mask, token_type_ids])"),ve.forEach(t),Z.forEach(t),Ge=u(I),V=r(I,"LI",{});var tt=i(V);Ee=n(tt,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),D=r(tt,"CODE",{});var pe=i(D);Q=n(pe,'model({"input_values": input_values, "token_type_ids": token_type_ids})'),pe.forEach(t),tt.forEach(t),I.forEach(t),le=u(b),P=r(b,"P",{});var ye=i(P);Xe=n(ye,`Note that when creating models and layers with
`),z=r(ye,"A",{href:!0,rel:!0});var xe=i(z);Je=n(xe,"subclassing"),xe.forEach(t),je=n(ye,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),ye.forEach(t),this.h()},h(){h(z,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),h(z,"rel","nofollow")},m(b,j){g(b,d,j),e(d,y),e(d,f),e(f,m),e(d,v),g(b,l,j),g(b,c,j),e(c,F),e(F,Ie),e(c,we),e(c,S),e(S,X),g(b,ee,j),g(b,w,j),e(w,Le),e(w,U),e(U,Ne),e(w,Te),e(w,L),e(L,Be),e(w,te),e(w,oe),e(oe,Re),e(w,ke),e(w,R),e(R,We),e(w,$e),e(w,W),e(W,ge),e(w,Ue),g(b,me,j),g(b,q,j),e(q,O),e(O,Ce),e(O,N),e(N,_e),e(O,Ve),e(O,se),e(se,ne),e(q,Ke),e(q,A),e(A,Ye),e(A,ae),e(ae,He),e(A,J),e(A,re),e(re,ie),e(q,Ge),e(q,V),e(V,Ee),e(V,D),e(D,Q),g(b,le,j),g(b,P,j),e(P,Xe),e(P,z),e(z,Je),e(P,je)},d(b){b&&t(d),b&&t(l),b&&t(c),b&&t(ee),b&&t(w),b&&t(me),b&&t(q),b&&t(le),b&&t(P)}}}function nl(M){let d,y,f,m,v;return{c(){d=a("p"),y=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=s("Module"),v=s(`
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(l){d=r(l,"P",{});var c=i(d);y=n(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var F=i(f);m=n(F,"Module"),F.forEach(t),v=n(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){g(l,d,c),e(d,y),e(d,f),e(f,m),e(d,v)},d(l){l&&t(d)}}}function al(M){let d,y,f,m,v;return m=new os({props:{code:`import tensorflow as tf
from transformers import AutoProcessor, TFHubertForCTC
from datasets import load_dataset
import soundfile as sf

processor = AutoProcessor.from_pretrained("facebook/hubert-large-ls960-ft")
model = TFHubertForCTC.from_pretrained("facebook/hubert-large-ls960-ft")


def map_to_array(batch):
    speech, _ = sf.read(batch["file"])
    batch["speech"] = speech
    return batch


ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
ds = ds.map(map_to_array)

input_values = processor(ds["speech"][0], return_tensors="tf").input_values  # Batch size 1
logits = model(input_values).logits
predicted_ids = tf.argmax(logits, axis=-1)

transcription = processor.decode(predicted_ids[0])

# compute loss
target_transcription = "A MAN SAID TO THE UNIVERSE SIR I EXIST"

# Pass the transcription as text to encode labels
labels = processor(text=transcription, return_tensors="tf").input_values

loss = model(input_values, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFHubertForCTC
<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> soundfile <span class="hljs-keyword">as</span> sf

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/hubert-large-ls960-ft&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFHubertForCTC.from_pretrained(<span class="hljs-string">&quot;facebook/hubert-large-ls960-ft&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">map_to_array</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    speech, _ = sf.read(batch[<span class="hljs-string">&quot;file&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;speech&quot;</span>] = speech
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch


<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;hf-internal-testing/librispeech_asr_dummy&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>ds = ds.<span class="hljs-built_in">map</span>(map_to_array)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_values = processor(ds[<span class="hljs-string">&quot;speech&quot;</span>][<span class="hljs-number">0</span>], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_values  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(input_values).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = tf.argmax(logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.decode(predicted_ids[<span class="hljs-number">0</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute loss</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_transcription = <span class="hljs-string">&quot;A MAN SAID TO THE UNIVERSE SIR I EXIST&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Pass the transcription as text to encode labels</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = processor(text=transcription, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>).input_values

<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(input_values, labels=labels).loss`}}),{c(){d=a("p"),y=s("Example:"),f=p(),T(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=n(c,"Example:"),c.forEach(t),f=u(l),k(m.$$.fragment,l)},m(l,c){g(l,d,c),e(d,y),g(l,f,c),$(m,l,c),v=!0},p:ts,i(l){v||(C(m.$$.fragment,l),v=!0)},o(l){H(m.$$.fragment,l),v=!1},d(l){l&&t(d),l&&t(f),E(m,l)}}}function rl(M){let d,y,f,m,v,l,c,F,Ie,we,S,X,ee,w,Le,U,Ne,Te,L,Be,te,oe,Re,ke,R,We,$e,W,ge,Ue,me,q,O,Ce,N,_e,Ve,se,ne,Ke,A,Ye,ae,He,J,re,ie,Ge,V,Ee,D,Q,le,P,Xe,z,Je,je,b,j,Fe,be,rt,Qe,x,it,st,de,fe,Ze,I,ce,et,lt,Z,B,ve,tt,pe,ye,xe,mn,fn,Vt,gn,_n,bn,dt,vn,Ao,yn,wn,So,Tn,kn,$n,Tt,qs,ct,kt,ss,Kt,Cn,ns,Hn,Ps,ue,Yt,En,Gt,jn,Xt,Fn,xn,Mn,Jt,qn,Oo,Pn,An,Sn,Qt,On,Zt,Dn,zn,In,Me,eo,Ln,pt,Nn,Do,Bn,Rn,as,Wn,Un,Vn,$t,Kn,Ct,As,ut,Ht,rs,to,Yn,is,Gn,Ss,he,oo,Xn,ht,Jn,ls,Qn,Zn,so,ea,ta,oa,no,sa,zo,na,aa,ra,ao,ia,ro,la,da,ca,qe,io,pa,mt,ua,Io,ha,ma,ds,fa,ga,_a,Et,ba,jt,Os,ft,Ft,cs,lo,va,ps,ya,Ds,K,co,wa,us,Ta,ka,po,$a,uo,Ca,Ha,Ea,ho,ja,Lo,Fa,xa,Ma,mo,qa,fo,Pa,Aa,Sa,Pe,go,Oa,gt,Da,No,za,Ia,hs,La,Na,Ba,xt,Ra,Mt,zs,_t,qt,ms,_o,Wa,fs,Ua,Is,Y,bo,Va,gs,Ka,Ya,vo,Ga,Bo,Xa,Ja,Qa,yo,Za,wo,er,tr,or,Pt,sr,Ae,To,nr,bt,ar,Ro,rr,ir,_s,lr,dr,cr,At,pr,St,Ls,vt,Ot,bs,ko,ur,vs,hr,Ns,G,$o,mr,Co,fr,ys,gr,_r,br,Ho,vr,Wo,yr,wr,Tr,Eo,kr,jo,$r,Cr,Hr,Dt,Er,Se,Fo,jr,yt,Fr,Uo,xr,Mr,ws,qr,Pr,Ar,zt,Sr,It,Bs;return l=new wt({}),w=new wt({}),P=new wt({}),I=new wt({}),ve=new ot({props:{name:"class transformers.HubertConfig",anchor:"transformers.HubertConfig",parameters:[{name:"vocab_size",val:" = 32"},{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",val:" = 0.1"},{name:"activation_dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.1"},{name:"feat_proj_layer_norm",val:" = True"},{name:"feat_proj_dropout",val:" = 0.0"},{name:"final_dropout",val:" = 0.1"},{name:"layerdrop",val:" = 0.1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"feat_extract_norm",val:" = 'group'"},{name:"feat_extract_activation",val:" = 'gelu'"},{name:"conv_dim",val:" = (512, 512, 512, 512, 512, 512, 512)"},{name:"conv_stride",val:" = (5, 2, 2, 2, 2, 2, 2)"},{name:"conv_kernel",val:" = (10, 3, 3, 3, 3, 2, 2)"},{name:"conv_bias",val:" = False"},{name:"num_conv_pos_embeddings",val:" = 128"},{name:"num_conv_pos_embedding_groups",val:" = 16"},{name:"do_stable_layer_norm",val:" = False"},{name:"apply_spec_augment",val:" = True"},{name:"mask_time_prob",val:" = 0.05"},{name:"mask_time_length",val:" = 10"},{name:"mask_time_min_masks",val:" = 2"},{name:"mask_feature_prob",val:" = 0.0"},{name:"mask_feature_length",val:" = 10"},{name:"mask_feature_min_masks",val:" = 0"},{name:"ctc_loss_reduction",val:" = 'sum'"},{name:"ctc_zero_infinity",val:" = False"},{name:"use_weighted_layer_sum",val:" = False"},{name:"classifier_proj_size",val:" = 256"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.HubertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Vocabulary size of the Hubert model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertModel">HubertModel</a>. Vocabulary size of the model. Defines the different
tokens that can be represented by the <em>inputs_ids</em> passed to the forward method of <a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertModel">HubertModel</a>.`,name:"vocab_size"},{anchor:"transformers.HubertConfig.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.HubertConfig.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.HubertConfig.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.HubertConfig.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.HubertConfig.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.HubertConfig.hidden_dropout(float,",description:`<strong>hidden_dropout(<code>float</code>,</strong> <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(float,"},{anchor:"transformers.HubertConfig.attention_dropout(float,",description:`<strong>attention_dropout(<code>float</code>,</strong> <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout(float,"},{anchor:"transformers.HubertConfig.final_dropout",description:`<strong>final_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for the final projection layer of <a href="/docs/transformers/v4.29.0/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a>.`,name:"final_dropout"},{anchor:"transformers.HubertConfig.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.HubertConfig.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.HubertConfig.feat_extract_norm",description:`<strong>feat_extract_norm</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;group&quot;</code>) &#x2014;
The norm to be applied to 1D convolutional layers in feature encoder. One of <code>&quot;group&quot;</code> for group
normalization of only the first 1D convolutional layer or <code>&quot;layer&quot;</code> for layer normalization of all 1D
convolutional layers.`,name:"feat_extract_norm"},{anchor:"transformers.HubertConfig.feat_proj_dropout",description:`<strong>feat_proj_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for output of the feature encoder.`,name:"feat_proj_dropout"},{anchor:"transformers.HubertConfig.feat_proj_layer_norm",description:`<strong>feat_proj_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply LayerNorm to the output of the feature encoder.`,name:"feat_proj_layer_norm"},{anchor:"transformers.HubertConfig.feat_extract_activation",description:"<strong>feat_extract_activation</strong> (<code>str, </code>optional<code>, defaults to </code>&#x201C;gelu&#x201D;<code>) -- The non-linear activation function (function or string) in the 1D convolutional layers of the feature extractor. If string, </code>&#x201C;gelu&#x201D;<code>, </code>&#x201C;relu&#x201D;<code>, </code>&#x201C;selu&#x201D;<code>and</code>&#x201C;gelu_new&#x201D;` are supported.",name:"feat_extract_activation"},{anchor:"transformers.HubertConfig.conv_dim",description:`<strong>conv_dim</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(512, 512, 512, 512, 512, 512, 512)</code>) &#x2014;
A tuple of integers defining the number of input and output channels of each 1D convolutional layer in the
feature encoder. The length of <em>conv_dim</em> defines the number of 1D convolutional layers.`,name:"conv_dim"},{anchor:"transformers.HubertConfig.conv_stride",description:`<strong>conv_stride</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(5, 2, 2, 2, 2, 2, 2)</code>) &#x2014;
A tuple of integers defining the stride of each 1D convolutional layer in the feature encoder. The length
of <em>conv_stride</em> defines the number of convolutional layers and has to match the length of <em>conv_dim</em>.`,name:"conv_stride"},{anchor:"transformers.HubertConfig.conv_kernel",description:`<strong>conv_kernel</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(10, 3, 3, 3, 3, 3, 3)</code>) &#x2014;
A tuple of integers defining the kernel size of each 1D convolutional layer in the feature encoder. The
length of <em>conv_kernel</em> defines the number of convolutional layers and has to match the length of
<em>conv_dim</em>.`,name:"conv_kernel"},{anchor:"transformers.HubertConfig.conv_bias",description:`<strong>conv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the 1D convolutional layers have a bias.`,name:"conv_bias"},{anchor:"transformers.HubertConfig.num_conv_pos_embeddings",description:`<strong>num_conv_pos_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Number of convolutional positional embeddings. Defines the kernel size of 1D convolutional positional
embeddings layer.`,name:"num_conv_pos_embeddings"},{anchor:"transformers.HubertConfig.num_conv_pos_embedding_groups",description:`<strong>num_conv_pos_embedding_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of groups of 1D convolutional positional embeddings layer.`,name:"num_conv_pos_embedding_groups"},{anchor:"transformers.HubertConfig.do_stable_layer_norm",description:`<strong>do_stable_layer_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether do apply <em>stable</em> layer norm architecture of the Transformer encoder. <code>do_stable_layer_norm is True</code> corresponds to applying layer norm before the attention layer, whereas <code>do_stable_layer_norm is False</code> corresponds to applying layer norm after the attention layer.`,name:"do_stable_layer_norm"},{anchor:"transformers.HubertConfig.apply_spec_augment",description:`<strong>apply_spec_augment</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply <em>SpecAugment</em> data augmentation to the outputs of the feature encoder. For reference see
<a href="https://arxiv.org/abs/1904.08779" rel="nofollow">SpecAugment: A Simple Data Augmentation Method for Automatic Speech
Recognition</a>.`,name:"apply_spec_augment"},{anchor:"transformers.HubertConfig.mask_time_prob",description:`<strong>mask_time_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.05) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the time axis which will be masked. The masking
procecure generates &#x201D;mask_time_prob<em>len(time_axis)/mask_time_length&#x201D; independent masks over the axis. If
reasoning from the propability of each feature vector to be chosen as the start of the vector span to be
masked, </em>mask_time_prob<em> should be \`prob_vector_start</em>mask_time_length<code>. Note that overlap may decrease the actual percentage of masked vectors. This is only relevant if </code>apply_spec_augment is True\`.`,name:"mask_time_prob"},{anchor:"transformers.HubertConfig.mask_time_length",description:`<strong>mask_time_length</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Length of vector span along the time axis.`,name:"mask_time_length"},{anchor:"transformers.HubertConfig.mask_time_min_masks",description:`<strong>mask_time_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 2), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the time axis, each time step,
irrespectively of <code>mask_feature_prob</code>. Only relevant if &#x201D;mask_time_prob*len(time_axis)/mask_time_length &lt;
mask_time_min_masks&#x201D;`,name:"mask_time_min_masks"},{anchor:"transformers.HubertConfig.mask_feature_prob",description:`<strong>mask_feature_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Percentage (between 0 and 1) of all feature vectors along the feature axis which will be masked. The
masking procecure generates &#x201D;mask_feature_prob<em>len(feature_axis)/mask_time_length&#x201D; independent masks over
the axis. If reasoning from the propability of each feature vector to be chosen as the start of the vector
span to be masked, </em>mask_feature_prob<em> should be \`prob_vector_start</em>mask_feature_length<code>. Note that overlap may decrease the actual percentage of masked vectors. This is only relevant if </code>apply_spec_augment is
True\`.`,name:"mask_feature_prob"},{anchor:"transformers.HubertConfig.mask_feature_length",description:`<strong>mask_feature_length</strong> (<code>int</code>, <em>optional</em>, defaults to 10) &#x2014;
Length of vector span along the feature axis.`,name:"mask_feature_length"},{anchor:"transformers.HubertConfig.mask_feature_min_masks",description:`<strong>mask_feature_min_masks</strong> (<code>int</code>, <em>optional</em>, defaults to 0), &#x2014;
The minimum number of masks of length <code>mask_feature_length</code> generated along the feature axis, each time
step, irrespectively of <code>mask_feature_prob</code>. Only relevant if
&#x201D;mask_feature_prob*len(feature_axis)/mask_feature_length &lt; mask_feature_min_masks&#x201D;`,name:"mask_feature_min_masks"},{anchor:"transformers.HubertConfig.ctc_loss_reduction",description:`<strong>ctc_loss_reduction</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;sum&quot;</code>) &#x2014;
Specifies the reduction to apply to the output of <code>torch.nn.CTCLoss</code>. Only relevant when training an
instance of <a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertForCTC">HubertForCTC</a>.`,name:"ctc_loss_reduction"},{anchor:"transformers.HubertConfig.ctc_zero_infinity",description:`<strong>ctc_zero_infinity</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to zero infinite losses and the associated gradients of <code>torch.nn.CTCLoss</code>. Infinite losses mainly
occur when the inputs are too short to be aligned to the targets. Only relevant when training an instance
of <a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertForCTC">HubertForCTC</a>.`,name:"ctc_zero_infinity"},{anchor:"transformers.HubertConfig.use_weighted_layer_sum",description:`<strong>use_weighted_layer_sum</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a weighted average of layer outputs with learned weights. Only relevant when using an
instance of <a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertForSequenceClassification">HubertForSequenceClassification</a>.`,name:"use_weighted_layer_sum"},{anchor:"transformers.HubertConfig.classifier_proj_size",description:`<strong>classifier_proj_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of the projection before token mean-pooling for classification.`,name:"classifier_proj_size"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/hubert/configuration_hubert.py#L32"}}),Tt=new es({props:{anchor:"transformers.HubertConfig.example",$$slots:{default:[Ki]},$$scope:{ctx:M}}}),Kt=new wt({}),Yt=new ot({props:{name:"class transformers.HubertModel",anchor:"transformers.HubertModel",parameters:[{name:"config",val:": HubertConfig"}],parametersDescription:[{anchor:"transformers.HubertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertConfig">HubertConfig</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.29.0/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.29.0/src/transformers/models/hubert/modeling_hubert.py#L954"}}),eo=new ot({props:{name:"forward",anchor:"transformers.HubertModel.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mask_time_indices",val:": typing.Optional[torch.FloatTensor] = 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.HubertModel.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_values</code>, the <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.29.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.HubertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/hubert-base-ls960" rel="nofollow">hubert-base</a>, <code>attention_mask</code> should <strong>not</strong> be passed
to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should simply be
padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly different
results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.HubertModel.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.HubertModel.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.HubertModel.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.29.0/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.29.0/src/transformers/models/hubert/modeling_hubert.py#L1019",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</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.29.0/en/model_doc/hubert#transformers.HubertConfig"
>HubertConfig</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>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.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$t=new Po({props:{$$slots:{default:[Yi]},$$scope:{ctx:M}}}),Ct=new es({props:{anchor:"transformers.HubertModel.forward.example",$$slots:{default:[Gi]},$$scope:{ctx:M}}}),to=new wt({}),oo=new ot({props:{name:"class transformers.HubertForCTC",anchor:"transformers.HubertForCTC",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.HubertForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertConfig">HubertConfig</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.29.0/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.29.0/src/transformers/models/hubert/modeling_hubert.py#L1098"}}),io=new ot({props:{name:"forward",anchor:"transformers.HubertForCTC.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_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"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.HubertForCTC.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_values</code>, the <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.29.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.HubertForCTC.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/hubert-base-ls960" rel="nofollow">hubert-base</a>, <code>attention_mask</code> should <strong>not</strong> be passed
to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should simply be
padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly different
results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.HubertForCTC.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.HubertForCTC.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.HubertForCTC.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.HubertForCTC.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, target_length)</code>, <em>optional</em>) &#x2014;
Labels for connectionist temporal classification. Note that <code>target_length</code> has to be smaller or equal to
the sequence length of the output logits. Indices are selected in <code>[-100, 0, ..., config.vocab_size - 1]</code>.
All labels set to <code>-100</code> are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/hubert/modeling_hubert.py#L1139",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</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.29.0/en/model_doc/hubert#transformers.HubertConfig"
>HubertConfig</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 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token 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.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutput"
>transformers.modeling_outputs.CausalLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Et=new Po({props:{$$slots:{default:[Xi]},$$scope:{ctx:M}}}),jt=new es({props:{anchor:"transformers.HubertForCTC.forward.example",$$slots:{default:[Ji]},$$scope:{ctx:M}}}),lo=new wt({}),co=new ot({props:{name:"class transformers.HubertForSequenceClassification",anchor:"transformers.HubertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.HubertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertConfig">HubertConfig</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.29.0/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.29.0/src/transformers/models/hubert/modeling_hubert.py#L1227"}}),go=new ot({props:{name:"forward",anchor:"transformers.HubertForSequenceClassification.forward",parameters:[{name:"input_values",val:": typing.Optional[torch.Tensor]"},{name:"attention_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"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.HubertForSequenceClassification.forward.input_values",description:`<strong>input_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Float values of input raw speech waveform. Values can be obtained by loading a <code>.flac</code> or <code>.wav</code> audio file
into an array of type <code>List[float]</code> or a <code>numpy.ndarray</code>, <em>e.g.</em> via the soundfile library (<code>pip install soundfile</code>). To prepare the array into <code>input_values</code>, the <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> should be used for padding and
conversion into a tensor of type <code>torch.FloatTensor</code>. See <a href="/docs/transformers/v4.29.0/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor.__call__">Wav2Vec2Processor.<strong>call</strong>()</a> for details.`,name:"input_values"},{anchor:"transformers.HubertForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing convolution and attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p><code>attention_mask</code> should only be passed if the corresponding processor has <code>config.return_attention_mask == True</code>. For all models whose processor has <code>config.return_attention_mask == False</code>, such as
<a href="https://huggingface.co/facebook/hubert-base-ls960" rel="nofollow">hubert-base</a>, <code>attention_mask</code> should <strong>not</strong> be passed
to avoid degraded performance when doing batched inference. For such models <code>input_values</code> should simply be
padded with 0 and passed without <code>attention_mask</code>. Be aware that these models also yield slightly different
results depending on whether <code>input_values</code> is padded or not.</p>

					</div>`,name:"attention_mask"},{anchor:"transformers.HubertForSequenceClassification.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.HubertForSequenceClassification.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.HubertForSequenceClassification.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.HubertForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence 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.29.0/src/transformers/models/hubert/modeling_hubert.py#L1272",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/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.29.0/en/model_doc/hubert#transformers.HubertConfig"
>HubertConfig</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.29.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xt=new Po({props:{$$slots:{default:[Qi]},$$scope:{ctx:M}}}),Mt=new es({props:{anchor:"transformers.HubertForSequenceClassification.forward.example",$$slots:{default:[Zi]},$$scope:{ctx:M}}}),_o=new wt({}),bo=new ot({props:{name:"class transformers.TFHubertModel",anchor:"transformers.TFHubertModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFHubertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertConfig">HubertConfig</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.29.0/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.29.0/src/transformers/models/hubert/modeling_tf_hubert.py#L1290"}}),Pt=new Po({props:{$$slots:{default:[el]},$$scope:{ctx:M}}}),To=new ot({props:{name:"call",anchor:"transformers.TFHubertModel.call",parameters:[{name:"input_values",val:": Tensor"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"position_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFHubertModel.call.input_values",description:`<strong>input_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_values"},{anchor:"transformers.TFHubertModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFHubertModel.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFHubertModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFHubertModel.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFHubertModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_values</code> you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>input_values</code> indices into associated vectors
than the model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFHubertModel.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFHubertModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFHubertModel.call.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFHubertModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/hubert/modeling_tf_hubert.py#L1296",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or a tuple of <code>tf.Tensor</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.29.0/en/model_doc/hubert#transformers.HubertConfig"
>HubertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</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>hidden_states</strong> (<code>tuple(tf.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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutput"
>transformers.modeling_tf_outputs.TFBaseModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),At=new Po({props:{$$slots:{default:[tl]},$$scope:{ctx:M}}}),St=new es({props:{anchor:"transformers.TFHubertModel.call.example",$$slots:{default:[ol]},$$scope:{ctx:M}}}),ko=new wt({}),$o=new ot({props:{name:"class transformers.TFHubertForCTC",anchor:"transformers.TFHubertForCTC",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFHubertForCTC.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertConfig">HubertConfig</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.29.0/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.29.0/src/transformers/models/hubert/modeling_tf_hubert.py#L1371"}}),Dt=new Po({props:{$$slots:{default:[sl]},$$scope:{ctx:M}}}),Fo=new ot({props:{name:"call",anchor:"transformers.TFHubertForCTC.call",parameters:[{name:"input_values",val:": Tensor"},{name:"attention_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"position_ids",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"head_mask",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"labels",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFHubertForCTC.call.input_values",description:`<strong>input_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_values"},{anchor:"transformers.TFHubertForCTC.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFHubertForCTC.call.token_type_ids",description:`<strong>token_type_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.TFHubertForCTC.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFHubertForCTC.call.head_mask",description:`<strong>head_mask</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.TFHubertForCTC.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>np.ndarray</code> or <code>tf.Tensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_values</code> you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>input_values</code> indices into associated vectors
than the model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFHubertForCTC.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFHubertForCTC.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFHubertForCTC.call.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFHubertForCTC.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"},{anchor:"transformers.TFHubertForCTC.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> or <code>np.ndarray</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_values</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked),
the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/hubert/modeling_tf_hubert.py#L1398",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutput"
>transformers.modeling_tf_outputs.TFCausalLMOutput</a> or a tuple of <code>tf.Tensor</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.29.0/en/model_doc/hubert#transformers.HubertConfig"
>HubertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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.29.0/en/main_classes/output#transformers.modeling_tf_outputs.TFCausalLMOutput"
>transformers.modeling_tf_outputs.TFCausalLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),zt=new Po({props:{$$slots:{default:[nl]},$$scope:{ctx:M}}}),It=new es({props:{anchor:"transformers.TFHubertForCTC.call.example",$$slots:{default:[al]},$$scope:{ctx:M}}}),{c(){d=a("meta"),y=p(),f=a("h1"),m=a("a"),v=a("span"),T(l.$$.fragment),c=p(),F=a("span"),Ie=s("Hubert"),we=p(),S=a("h2"),X=a("a"),ee=a("span"),T(w.$$.fragment),Le=p(),U=a("span"),Ne=s("Overview"),Te=p(),L=a("p"),Be=s("Hubert was proposed in "),te=a("a"),oe=s("HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units"),Re=s(` by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan
Salakhutdinov, Abdelrahman Mohamed.`),ke=p(),R=a("p"),We=s("The abstract from the paper is the following:"),$e=p(),W=a("p"),ge=a("em"),Ue=s(`Self-supervised approaches for speech representation learning are challenged by three unique problems: (1) there are
multiple sound units in each input utterance, (2) there is no lexicon of input sound units during the pre-training
phase, and (3) sound units have variable lengths with no explicit segmentation. To deal with these three problems, we
propose the Hidden-Unit BERT (HuBERT) approach for self-supervised speech representation learning, which utilizes an
offline clustering step to provide aligned target labels for a BERT-like prediction loss. A key ingredient of our
approach is applying the prediction loss over the masked regions only, which forces the model to learn a combined
acoustic and language model over the continuous inputs. HuBERT relies primarily on the consistency of the unsupervised
clustering step rather than the intrinsic quality of the assigned cluster labels. Starting with a simple k-means
teacher of 100 clusters, and using two iterations of clustering, the HuBERT model either matches or improves upon the
state-of-the-art wav2vec 2.0 performance on the Librispeech (960h) and Libri-light (60,000h) benchmarks with 10min, 1h,
10h, 100h, and 960h fine-tuning subsets. Using a 1B parameter model, HuBERT shows up to 19% and 13% relative WER
reduction on the more challenging dev-other and test-other evaluation subsets.`),me=p(),q=a("p"),O=s("Tips:"),Ce=p(),N=a("ul"),_e=a("li"),Ve=s("Hubert is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),se=p(),ne=a("li"),Ke=s(`Hubert model was fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),A=a("a"),Ye=s("Wav2Vec2CTCTokenizer"),ae=s("."),He=p(),J=a("p"),re=s("This model was contributed by "),ie=a("a"),Ge=s("patrickvonplaten"),V=s("."),Ee=p(),D=a("h2"),Q=a("a"),le=a("span"),T(P.$$.fragment),Xe=p(),z=a("span"),Je=s("Documentation resources"),je=p(),b=a("ul"),j=a("li"),Fe=a("a"),be=s("Audio classification task guide"),rt=p(),Qe=a("li"),x=a("a"),it=s("Automatic speech recognition task guide"),st=p(),de=a("h2"),fe=a("a"),Ze=a("span"),T(I.$$.fragment),ce=p(),et=a("span"),lt=s("HubertConfig"),Z=p(),B=a("div"),T(ve.$$.fragment),tt=p(),pe=a("p"),ye=s("This is the configuration class to store the configuration of a "),xe=a("a"),mn=s("HubertModel"),fn=s(`. It is used to instantiate an
Hubert 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 Hubert
`),Vt=a("a"),gn=s("facebook/hubert-base-ls960"),_n=s(" architecture."),bn=p(),dt=a("p"),vn=s("Configuration objects inherit from "),Ao=a("a"),yn=s("PretrainedConfig"),wn=s(` and can be used to control the model outputs. Read the
documentation from `),So=a("a"),Tn=s("PretrainedConfig"),kn=s(" for more information."),$n=p(),T(Tt.$$.fragment),qs=p(),ct=a("h2"),kt=a("a"),ss=a("span"),T(Kt.$$.fragment),Cn=p(),ns=a("span"),Hn=s("HubertModel"),Ps=p(),ue=a("div"),T(Yt.$$.fragment),En=p(),Gt=a("p"),jn=s(`The bare Hubert Model transformer outputting raw hidden-states without any specific head on top.
Hubert was proposed in `),Xt=a("a"),Fn=s(`HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden
Units`),xn=s(` by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia,
Ruslan Salakhutdinov, Abdelrahman Mohamed.`),Mn=p(),Jt=a("p"),qn=s("This model inherits from "),Oo=a("a"),Pn=s("PreTrainedModel"),An=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Sn=p(),Qt=a("p"),On=s("This model is a PyTorch "),Zt=a("a"),Dn=s("torch.nn.Module"),zn=s(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),In=p(),Me=a("div"),T(eo.$$.fragment),Ln=p(),pt=a("p"),Nn=s("The "),Do=a("a"),Bn=s("HubertModel"),Rn=s(" forward method, overrides the "),as=a("code"),Wn=s("__call__"),Un=s(" special method."),Vn=p(),T($t.$$.fragment),Kn=p(),T(Ct.$$.fragment),As=p(),ut=a("h2"),Ht=a("a"),rs=a("span"),T(to.$$.fragment),Yn=p(),is=a("span"),Gn=s("HubertForCTC"),Ss=p(),he=a("div"),T(oo.$$.fragment),Xn=p(),ht=a("p"),Jn=s("Hubert Model with a "),ls=a("code"),Qn=s("language modeling"),Zn=s(` head on top for Connectionist Temporal Classification (CTC).
Hubert was proposed in `),so=a("a"),ea=s(`HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden
Units`),ta=s(` by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia,
Ruslan Salakhutdinov, Abdelrahman Mohamed.`),oa=p(),no=a("p"),sa=s("This model inherits from "),zo=a("a"),na=s("PreTrainedModel"),aa=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),ra=p(),ao=a("p"),ia=s("This model is a PyTorch "),ro=a("a"),la=s("torch.nn.Module"),da=s(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ca=p(),qe=a("div"),T(io.$$.fragment),pa=p(),mt=a("p"),ua=s("The "),Io=a("a"),ha=s("HubertForCTC"),ma=s(" forward method, overrides the "),ds=a("code"),fa=s("__call__"),ga=s(" special method."),_a=p(),T(Et.$$.fragment),ba=p(),T(jt.$$.fragment),Os=p(),ft=a("h2"),Ft=a("a"),cs=a("span"),T(lo.$$.fragment),va=p(),ps=a("span"),ya=s("HubertForSequenceClassification"),Ds=p(),K=a("div"),T(co.$$.fragment),wa=p(),us=a("p"),Ta=s(`Hubert Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),ka=p(),po=a("p"),$a=s("Hubert was proposed in "),uo=a("a"),Ca=s(`HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden
Units`),Ha=s(` by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia,
Ruslan Salakhutdinov, Abdelrahman Mohamed.`),Ea=p(),ho=a("p"),ja=s("This model inherits from "),Lo=a("a"),Fa=s("PreTrainedModel"),xa=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Ma=p(),mo=a("p"),qa=s("This model is a PyTorch "),fo=a("a"),Pa=s("torch.nn.Module"),Aa=s(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sa=p(),Pe=a("div"),T(go.$$.fragment),Oa=p(),gt=a("p"),Da=s("The "),No=a("a"),za=s("HubertForSequenceClassification"),Ia=s(" forward method, overrides the "),hs=a("code"),La=s("__call__"),Na=s(" special method."),Ba=p(),T(xt.$$.fragment),Ra=p(),T(Mt.$$.fragment),zs=p(),_t=a("h2"),qt=a("a"),ms=a("span"),T(_o.$$.fragment),Wa=p(),fs=a("span"),Ua=s("TFHubertModel"),Is=p(),Y=a("div"),T(bo.$$.fragment),Va=p(),gs=a("p"),Ka=s("The bare TFHubert Model transformer outputing raw hidden-states without any specific head on top."),Ya=p(),vo=a("p"),Ga=s("This model inherits from "),Bo=a("a"),Xa=s("TFPreTrainedModel"),Ja=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Qa=p(),yo=a("p"),Za=s("This model is also a "),wo=a("a"),er=s("tf.keras.Model"),tr=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),or=p(),T(Pt.$$.fragment),sr=p(),Ae=a("div"),T(To.$$.fragment),nr=p(),bt=a("p"),ar=s("The "),Ro=a("a"),rr=s("TFHubertModel"),ir=s(" forward method, overrides the "),_s=a("code"),lr=s("__call__"),dr=s(" special method."),cr=p(),T(At.$$.fragment),pr=p(),T(St.$$.fragment),Ls=p(),vt=a("h2"),Ot=a("a"),bs=a("span"),T(ko.$$.fragment),ur=p(),vs=a("span"),hr=s("TFHubertForCTC"),Ns=p(),G=a("div"),T($o.$$.fragment),mr=p(),Co=a("p"),fr=s("TFHubert Model with a "),ys=a("code"),gr=s("language modeling"),_r=s(" head on top for Connectionist Temporal Classification (CTC)."),br=p(),Ho=a("p"),vr=s("This model inherits from "),Wo=a("a"),yr=s("TFPreTrainedModel"),wr=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Tr=p(),Eo=a("p"),kr=s("This model is also a "),jo=a("a"),$r=s("tf.keras.Model"),Cr=s(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Hr=p(),T(Dt.$$.fragment),Er=p(),Se=a("div"),T(Fo.$$.fragment),jr=p(),yt=a("p"),Fr=s("The "),Uo=a("a"),xr=s("TFHubertForCTC"),Mr=s(" forward method, overrides the "),ws=a("code"),qr=s("__call__"),Pr=s(" special method."),Ar=p(),T(zt.$$.fragment),Sr=p(),T(It.$$.fragment),this.h()},l(o){const _=Ui('[data-svelte="svelte-1phssyn"]',document.head);d=r(_,"META",{name:!0,content:!0}),_.forEach(t),y=u(o),f=r(o,"H1",{class:!0});var xo=i(f);m=r(xo,"A",{id:!0,class:!0,href:!0});var Ts=i(m);v=r(Ts,"SPAN",{});var ks=i(v);k(l.$$.fragment,ks),ks.forEach(t),Ts.forEach(t),c=u(xo),F=r(xo,"SPAN",{});var $s=i(F);Ie=n($s,"Hubert"),$s.forEach(t),xo.forEach(t),we=u(o),S=r(o,"H2",{class:!0});var Mo=i(S);X=r(Mo,"A",{id:!0,class:!0,href:!0});var Cs=i(X);ee=r(Cs,"SPAN",{});var Hs=i(ee);k(w.$$.fragment,Hs),Hs.forEach(t),Cs.forEach(t),Le=u(Mo),U=r(Mo,"SPAN",{});var Es=i(U);Ne=n(Es,"Overview"),Es.forEach(t),Mo.forEach(t),Te=u(o),L=r(o,"P",{});var qo=i(L);Be=n(qo,"Hubert was proposed in "),te=r(qo,"A",{href:!0,rel:!0});var js=i(te);oe=n(js,"HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units"),js.forEach(t),Re=n(qo,` by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan
Salakhutdinov, Abdelrahman Mohamed.`),qo.forEach(t),ke=u(o),R=r(o,"P",{});var Fs=i(R);We=n(Fs,"The abstract from the paper is the following:"),Fs.forEach(t),$e=u(o),W=r(o,"P",{});var xs=i(W);ge=r(xs,"EM",{});var Ms=i(ge);Ue=n(Ms,`Self-supervised approaches for speech representation learning are challenged by three unique problems: (1) there are
multiple sound units in each input utterance, (2) there is no lexicon of input sound units during the pre-training
phase, and (3) sound units have variable lengths with no explicit segmentation. To deal with these three problems, we
propose the Hidden-Unit BERT (HuBERT) approach for self-supervised speech representation learning, which utilizes an
offline clustering step to provide aligned target labels for a BERT-like prediction loss. A key ingredient of our
approach is applying the prediction loss over the masked regions only, which forces the model to learn a combined
acoustic and language model over the continuous inputs. HuBERT relies primarily on the consistency of the unsupervised
clustering step rather than the intrinsic quality of the assigned cluster labels. Starting with a simple k-means
teacher of 100 clusters, and using two iterations of clustering, the HuBERT model either matches or improves upon the
state-of-the-art wav2vec 2.0 performance on the Librispeech (960h) and Libri-light (60,000h) benchmarks with 10min, 1h,
10h, 100h, and 960h fine-tuning subsets. Using a 1B parameter model, HuBERT shows up to 19% and 13% relative WER
reduction on the more challenging dev-other and test-other evaluation subsets.`),Ms.forEach(t),xs.forEach(t),me=u(o),q=r(o,"P",{});var Or=i(q);O=n(Or,"Tips:"),Or.forEach(t),Ce=u(o),N=r(o,"UL",{});var Rs=i(N);_e=r(Rs,"LI",{});var Dr=i(_e);Ve=n(Dr,"Hubert is a speech model that accepts a float array corresponding to the raw waveform of the speech signal."),Dr.forEach(t),se=u(Rs),ne=r(Rs,"LI",{});var Ws=i(ne);Ke=n(Ws,`Hubert model was fine-tuned using connectionist temporal classification (CTC) so the model output has to be decoded
using `),A=r(Ws,"A",{href:!0});var zr=i(A);Ye=n(zr,"Wav2Vec2CTCTokenizer"),zr.forEach(t),ae=n(Ws,"."),Ws.forEach(t),Rs.forEach(t),He=u(o),J=r(o,"P",{});var Us=i(J);re=n(Us,"This model was contributed by "),ie=r(Us,"A",{href:!0,rel:!0});var Ir=i(ie);Ge=n(Ir,"patrickvonplaten"),Ir.forEach(t),V=n(Us,"."),Us.forEach(t),Ee=u(o),D=r(o,"H2",{class:!0});var Vs=i(D);Q=r(Vs,"A",{id:!0,class:!0,href:!0});var Lr=i(Q);le=r(Lr,"SPAN",{});var Nr=i(le);k(P.$$.fragment,Nr),Nr.forEach(t),Lr.forEach(t),Xe=u(Vs),z=r(Vs,"SPAN",{});var Br=i(z);Je=n(Br,"Documentation resources"),Br.forEach(t),Vs.forEach(t),je=u(o),b=r(o,"UL",{});var Ks=i(b);j=r(Ks,"LI",{});var Rr=i(j);Fe=r(Rr,"A",{href:!0});var Wr=i(Fe);be=n(Wr,"Audio classification task guide"),Wr.forEach(t),Rr.forEach(t),rt=u(Ks),Qe=r(Ks,"LI",{});var Ur=i(Qe);x=r(Ur,"A",{href:!0});var Vr=i(x);it=n(Vr,"Automatic speech recognition task guide"),Vr.forEach(t),Ur.forEach(t),Ks.forEach(t),st=u(o),de=r(o,"H2",{class:!0});var Ys=i(de);fe=r(Ys,"A",{id:!0,class:!0,href:!0});var Kr=i(fe);Ze=r(Kr,"SPAN",{});var Yr=i(Ze);k(I.$$.fragment,Yr),Yr.forEach(t),Kr.forEach(t),ce=u(Ys),et=r(Ys,"SPAN",{});var Gr=i(et);lt=n(Gr,"HubertConfig"),Gr.forEach(t),Ys.forEach(t),Z=u(o),B=r(o,"DIV",{class:!0});var Lt=i(B);k(ve.$$.fragment,Lt),tt=u(Lt),pe=r(Lt,"P",{});var Vo=i(pe);ye=n(Vo,"This is the configuration class to store the configuration of a "),xe=r(Vo,"A",{href:!0});var Xr=i(xe);mn=n(Xr,"HubertModel"),Xr.forEach(t),fn=n(Vo,`. It is used to instantiate an
Hubert 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 Hubert
`),Vt=r(Vo,"A",{href:!0,rel:!0});var Jr=i(Vt);gn=n(Jr,"facebook/hubert-base-ls960"),Jr.forEach(t),_n=n(Vo," architecture."),Vo.forEach(t),bn=u(Lt),dt=r(Lt,"P",{});var Ko=i(dt);vn=n(Ko,"Configuration objects inherit from "),Ao=r(Ko,"A",{href:!0});var Qr=i(Ao);yn=n(Qr,"PretrainedConfig"),Qr.forEach(t),wn=n(Ko,` and can be used to control the model outputs. Read the
documentation from `),So=r(Ko,"A",{href:!0});var Zr=i(So);Tn=n(Zr,"PretrainedConfig"),Zr.forEach(t),kn=n(Ko," for more information."),Ko.forEach(t),$n=u(Lt),k(Tt.$$.fragment,Lt),Lt.forEach(t),qs=u(o),ct=r(o,"H2",{class:!0});var Gs=i(ct);kt=r(Gs,"A",{id:!0,class:!0,href:!0});var ei=i(kt);ss=r(ei,"SPAN",{});var ti=i(ss);k(Kt.$$.fragment,ti),ti.forEach(t),ei.forEach(t),Cn=u(Gs),ns=r(Gs,"SPAN",{});var oi=i(ns);Hn=n(oi,"HubertModel"),oi.forEach(t),Gs.forEach(t),Ps=u(o),ue=r(o,"DIV",{class:!0});var nt=i(ue);k(Yt.$$.fragment,nt),En=u(nt),Gt=r(nt,"P",{});var Xs=i(Gt);jn=n(Xs,`The bare Hubert Model transformer outputting raw hidden-states without any specific head on top.
Hubert was proposed in `),Xt=r(Xs,"A",{href:!0,rel:!0});var si=i(Xt);Fn=n(si,`HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden
Units`),si.forEach(t),xn=n(Xs,` by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia,
Ruslan Salakhutdinov, Abdelrahman Mohamed.`),Xs.forEach(t),Mn=u(nt),Jt=r(nt,"P",{});var Js=i(Jt);qn=n(Js,"This model inherits from "),Oo=r(Js,"A",{href:!0});var ni=i(Oo);Pn=n(ni,"PreTrainedModel"),ni.forEach(t),An=n(Js,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),Js.forEach(t),Sn=u(nt),Qt=r(nt,"P",{});var Qs=i(Qt);On=n(Qs,"This model is a PyTorch "),Zt=r(Qs,"A",{href:!0,rel:!0});var ai=i(Zt);Dn=n(ai,"torch.nn.Module"),ai.forEach(t),zn=n(Qs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qs.forEach(t),In=u(nt),Me=r(nt,"DIV",{class:!0});var Nt=i(Me);k(eo.$$.fragment,Nt),Ln=u(Nt),pt=r(Nt,"P",{});var Yo=i(pt);Nn=n(Yo,"The "),Do=r(Yo,"A",{href:!0});var ri=i(Do);Bn=n(ri,"HubertModel"),ri.forEach(t),Rn=n(Yo," forward method, overrides the "),as=r(Yo,"CODE",{});var ii=i(as);Wn=n(ii,"__call__"),ii.forEach(t),Un=n(Yo," special method."),Yo.forEach(t),Vn=u(Nt),k($t.$$.fragment,Nt),Kn=u(Nt),k(Ct.$$.fragment,Nt),Nt.forEach(t),nt.forEach(t),As=u(o),ut=r(o,"H2",{class:!0});var Zs=i(ut);Ht=r(Zs,"A",{id:!0,class:!0,href:!0});var li=i(Ht);rs=r(li,"SPAN",{});var di=i(rs);k(to.$$.fragment,di),di.forEach(t),li.forEach(t),Yn=u(Zs),is=r(Zs,"SPAN",{});var ci=i(is);Gn=n(ci,"HubertForCTC"),ci.forEach(t),Zs.forEach(t),Ss=u(o),he=r(o,"DIV",{class:!0});var at=i(he);k(oo.$$.fragment,at),Xn=u(at),ht=r(at,"P",{});var Go=i(ht);Jn=n(Go,"Hubert Model with a "),ls=r(Go,"CODE",{});var pi=i(ls);Qn=n(pi,"language modeling"),pi.forEach(t),Zn=n(Go,` head on top for Connectionist Temporal Classification (CTC).
Hubert was proposed in `),so=r(Go,"A",{href:!0,rel:!0});var ui=i(so);ea=n(ui,`HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden
Units`),ui.forEach(t),ta=n(Go,` by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia,
Ruslan Salakhutdinov, Abdelrahman Mohamed.`),Go.forEach(t),oa=u(at),no=r(at,"P",{});var en=i(no);sa=n(en,"This model inherits from "),zo=r(en,"A",{href:!0});var hi=i(zo);na=n(hi,"PreTrainedModel"),hi.forEach(t),aa=n(en,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),en.forEach(t),ra=u(at),ao=r(at,"P",{});var tn=i(ao);ia=n(tn,"This model is a PyTorch "),ro=r(tn,"A",{href:!0,rel:!0});var mi=i(ro);la=n(mi,"torch.nn.Module"),mi.forEach(t),da=n(tn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),tn.forEach(t),ca=u(at),qe=r(at,"DIV",{class:!0});var Bt=i(qe);k(io.$$.fragment,Bt),pa=u(Bt),mt=r(Bt,"P",{});var Xo=i(mt);ua=n(Xo,"The "),Io=r(Xo,"A",{href:!0});var fi=i(Io);ha=n(fi,"HubertForCTC"),fi.forEach(t),ma=n(Xo," forward method, overrides the "),ds=r(Xo,"CODE",{});var gi=i(ds);fa=n(gi,"__call__"),gi.forEach(t),ga=n(Xo," special method."),Xo.forEach(t),_a=u(Bt),k(Et.$$.fragment,Bt),ba=u(Bt),k(jt.$$.fragment,Bt),Bt.forEach(t),at.forEach(t),Os=u(o),ft=r(o,"H2",{class:!0});var on=i(ft);Ft=r(on,"A",{id:!0,class:!0,href:!0});var _i=i(Ft);cs=r(_i,"SPAN",{});var bi=i(cs);k(lo.$$.fragment,bi),bi.forEach(t),_i.forEach(t),va=u(on),ps=r(on,"SPAN",{});var vi=i(ps);ya=n(vi,"HubertForSequenceClassification"),vi.forEach(t),on.forEach(t),Ds=u(o),K=r(o,"DIV",{class:!0});var Oe=i(K);k(co.$$.fragment,Oe),wa=u(Oe),us=r(Oe,"P",{});var yi=i(us);Ta=n(yi,`Hubert Model with a sequence classification head on top (a linear layer over the pooled output) for tasks like
SUPERB Keyword Spotting.`),yi.forEach(t),ka=u(Oe),po=r(Oe,"P",{});var sn=i(po);$a=n(sn,"Hubert was proposed in "),uo=r(sn,"A",{href:!0,rel:!0});var wi=i(uo);Ca=n(wi,`HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden
Units`),wi.forEach(t),Ha=n(sn,` by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia,
Ruslan Salakhutdinov, Abdelrahman Mohamed.`),sn.forEach(t),Ea=u(Oe),ho=r(Oe,"P",{});var nn=i(ho);ja=n(nn,"This model inherits from "),Lo=r(nn,"A",{href:!0});var Ti=i(Lo);Fa=n(Ti,"PreTrainedModel"),Ti.forEach(t),xa=n(nn,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving etc.).`),nn.forEach(t),Ma=u(Oe),mo=r(Oe,"P",{});var an=i(mo);qa=n(an,"This model is a PyTorch "),fo=r(an,"A",{href:!0,rel:!0});var ki=i(fo);Pa=n(ki,"torch.nn.Module"),ki.forEach(t),Aa=n(an,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),an.forEach(t),Sa=u(Oe),Pe=r(Oe,"DIV",{class:!0});var Rt=i(Pe);k(go.$$.fragment,Rt),Oa=u(Rt),gt=r(Rt,"P",{});var Jo=i(gt);Da=n(Jo,"The "),No=r(Jo,"A",{href:!0});var $i=i(No);za=n($i,"HubertForSequenceClassification"),$i.forEach(t),Ia=n(Jo," forward method, overrides the "),hs=r(Jo,"CODE",{});var Ci=i(hs);La=n(Ci,"__call__"),Ci.forEach(t),Na=n(Jo," special method."),Jo.forEach(t),Ba=u(Rt),k(xt.$$.fragment,Rt),Ra=u(Rt),k(Mt.$$.fragment,Rt),Rt.forEach(t),Oe.forEach(t),zs=u(o),_t=r(o,"H2",{class:!0});var rn=i(_t);qt=r(rn,"A",{id:!0,class:!0,href:!0});var Hi=i(qt);ms=r(Hi,"SPAN",{});var Ei=i(ms);k(_o.$$.fragment,Ei),Ei.forEach(t),Hi.forEach(t),Wa=u(rn),fs=r(rn,"SPAN",{});var ji=i(fs);Ua=n(ji,"TFHubertModel"),ji.forEach(t),rn.forEach(t),Is=u(o),Y=r(o,"DIV",{class:!0});var De=i(Y);k(bo.$$.fragment,De),Va=u(De),gs=r(De,"P",{});var Fi=i(gs);Ka=n(Fi,"The bare TFHubert Model transformer outputing raw hidden-states without any specific head on top."),Fi.forEach(t),Ya=u(De),vo=r(De,"P",{});var ln=i(vo);Ga=n(ln,"This model inherits from "),Bo=r(ln,"A",{href:!0});var xi=i(Bo);Xa=n(xi,"TFPreTrainedModel"),xi.forEach(t),Ja=n(ln,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ln.forEach(t),Qa=u(De),yo=r(De,"P",{});var dn=i(yo);Za=n(dn,"This model is also a "),wo=r(dn,"A",{href:!0,rel:!0});var Mi=i(wo);er=n(Mi,"tf.keras.Model"),Mi.forEach(t),tr=n(dn,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),dn.forEach(t),or=u(De),k(Pt.$$.fragment,De),sr=u(De),Ae=r(De,"DIV",{class:!0});var Wt=i(Ae);k(To.$$.fragment,Wt),nr=u(Wt),bt=r(Wt,"P",{});var Qo=i(bt);ar=n(Qo,"The "),Ro=r(Qo,"A",{href:!0});var qi=i(Ro);rr=n(qi,"TFHubertModel"),qi.forEach(t),ir=n(Qo," forward method, overrides the "),_s=r(Qo,"CODE",{});var Pi=i(_s);lr=n(Pi,"__call__"),Pi.forEach(t),dr=n(Qo," special method."),Qo.forEach(t),cr=u(Wt),k(At.$$.fragment,Wt),pr=u(Wt),k(St.$$.fragment,Wt),Wt.forEach(t),De.forEach(t),Ls=u(o),vt=r(o,"H2",{class:!0});var cn=i(vt);Ot=r(cn,"A",{id:!0,class:!0,href:!0});var Ai=i(Ot);bs=r(Ai,"SPAN",{});var Si=i(bs);k(ko.$$.fragment,Si),Si.forEach(t),Ai.forEach(t),ur=u(cn),vs=r(cn,"SPAN",{});var Oi=i(vs);hr=n(Oi,"TFHubertForCTC"),Oi.forEach(t),cn.forEach(t),Ns=u(o),G=r(o,"DIV",{class:!0});var ze=i(G);k($o.$$.fragment,ze),mr=u(ze),Co=r(ze,"P",{});var pn=i(Co);fr=n(pn,"TFHubert Model with a "),ys=r(pn,"CODE",{});var Di=i(ys);gr=n(Di,"language modeling"),Di.forEach(t),_r=n(pn," head on top for Connectionist Temporal Classification (CTC)."),pn.forEach(t),br=u(ze),Ho=r(ze,"P",{});var un=i(Ho);vr=n(un,"This model inherits from "),Wo=r(un,"A",{href:!0});var zi=i(Wo);yr=n(zi,"TFPreTrainedModel"),zi.forEach(t),wr=n(un,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),un.forEach(t),Tr=u(ze),Eo=r(ze,"P",{});var hn=i(Eo);kr=n(hn,"This model is also a "),jo=r(hn,"A",{href:!0,rel:!0});var Ii=i(jo);$r=n(Ii,"tf.keras.Model"),Ii.forEach(t),Cr=n(hn,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),hn.forEach(t),Hr=u(ze),k(Dt.$$.fragment,ze),Er=u(ze),Se=r(ze,"DIV",{class:!0});var Ut=i(Se);k(Fo.$$.fragment,Ut),jr=u(Ut),yt=r(Ut,"P",{});var Zo=i(yt);Fr=n(Zo,"The "),Uo=r(Zo,"A",{href:!0});var Li=i(Uo);xr=n(Li,"TFHubertForCTC"),Li.forEach(t),Mr=n(Zo," forward method, overrides the "),ws=r(Zo,"CODE",{});var Ni=i(ws);qr=n(Ni,"__call__"),Ni.forEach(t),Pr=n(Zo," special method."),Zo.forEach(t),Ar=u(Ut),k(zt.$$.fragment,Ut),Sr=u(Ut),k(It.$$.fragment,Ut),Ut.forEach(t),ze.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(il)),h(m,"id","hubert"),h(m,"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"),h(m,"href","#hubert"),h(f,"class","relative group"),h(X,"id","overview"),h(X,"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"),h(X,"href","#overview"),h(S,"class","relative group"),h(te,"href","https://arxiv.org/abs/2106.07447"),h(te,"rel","nofollow"),h(A,"href","/docs/transformers/v4.29.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer"),h(ie,"href","https://huggingface.co/patrickvonplaten"),h(ie,"rel","nofollow"),h(Q,"id","documentation-resources"),h(Q,"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"),h(Q,"href","#documentation-resources"),h(D,"class","relative group"),h(Fe,"href","../tasks/audio_classification"),h(x,"href","../tasks/asr"),h(fe,"id","transformers.HubertConfig"),h(fe,"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"),h(fe,"href","#transformers.HubertConfig"),h(de,"class","relative group"),h(xe,"href","/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertModel"),h(Vt,"href","https://huggingface.co/facebook/hubert-base-ls960"),h(Vt,"rel","nofollow"),h(Ao,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(So,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(kt,"id","transformers.HubertModel"),h(kt,"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"),h(kt,"href","#transformers.HubertModel"),h(ct,"class","relative group"),h(Xt,"href","https://arxiv.org/abs/2106.07447"),h(Xt,"rel","nofollow"),h(Oo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(Zt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Zt,"rel","nofollow"),h(Do,"href","/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertModel"),h(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ht,"id","transformers.HubertForCTC"),h(Ht,"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"),h(Ht,"href","#transformers.HubertForCTC"),h(ut,"class","relative group"),h(so,"href","https://arxiv.org/abs/2106.07447"),h(so,"rel","nofollow"),h(zo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(ro,"rel","nofollow"),h(Io,"href","/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertForCTC"),h(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ft,"id","transformers.HubertForSequenceClassification"),h(Ft,"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"),h(Ft,"href","#transformers.HubertForSequenceClassification"),h(ft,"class","relative group"),h(uo,"href","https://arxiv.org/abs/2106.07447"),h(uo,"rel","nofollow"),h(Lo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),h(fo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(fo,"rel","nofollow"),h(No,"href","/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.HubertForSequenceClassification"),h(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(qt,"id","transformers.TFHubertModel"),h(qt,"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"),h(qt,"href","#transformers.TFHubertModel"),h(_t,"class","relative group"),h(Bo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(wo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(wo,"rel","nofollow"),h(Ro,"href","/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.TFHubertModel"),h(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ot,"id","transformers.TFHubertForCTC"),h(Ot,"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"),h(Ot,"href","#transformers.TFHubertForCTC"),h(vt,"class","relative group"),h(Wo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.TFPreTrainedModel"),h(jo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),h(jo,"rel","nofollow"),h(Uo,"href","/docs/transformers/v4.29.0/en/model_doc/hubert#transformers.TFHubertForCTC"),h(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,_){e(document.head,d),g(o,y,_),g(o,f,_),e(f,m),e(m,v),$(l,v,null),e(f,c),e(f,F),e(F,Ie),g(o,we,_),g(o,S,_),e(S,X),e(X,ee),$(w,ee,null),e(S,Le),e(S,U),e(U,Ne),g(o,Te,_),g(o,L,_),e(L,Be),e(L,te),e(te,oe),e(L,Re),g(o,ke,_),g(o,R,_),e(R,We),g(o,$e,_),g(o,W,_),e(W,ge),e(ge,Ue),g(o,me,_),g(o,q,_),e(q,O),g(o,Ce,_),g(o,N,_),e(N,_e),e(_e,Ve),e(N,se),e(N,ne),e(ne,Ke),e(ne,A),e(A,Ye),e(ne,ae),g(o,He,_),g(o,J,_),e(J,re),e(J,ie),e(ie,Ge),e(J,V),g(o,Ee,_),g(o,D,_),e(D,Q),e(Q,le),$(P,le,null),e(D,Xe),e(D,z),e(z,Je),g(o,je,_),g(o,b,_),e(b,j),e(j,Fe),e(Fe,be),e(b,rt),e(b,Qe),e(Qe,x),e(x,it),g(o,st,_),g(o,de,_),e(de,fe),e(fe,Ze),$(I,Ze,null),e(de,ce),e(de,et),e(et,lt),g(o,Z,_),g(o,B,_),$(ve,B,null),e(B,tt),e(B,pe),e(pe,ye),e(pe,xe),e(xe,mn),e(pe,fn),e(pe,Vt),e(Vt,gn),e(pe,_n),e(B,bn),e(B,dt),e(dt,vn),e(dt,Ao),e(Ao,yn),e(dt,wn),e(dt,So),e(So,Tn),e(dt,kn),e(B,$n),$(Tt,B,null),g(o,qs,_),g(o,ct,_),e(ct,kt),e(kt,ss),$(Kt,ss,null),e(ct,Cn),e(ct,ns),e(ns,Hn),g(o,Ps,_),g(o,ue,_),$(Yt,ue,null),e(ue,En),e(ue,Gt),e(Gt,jn),e(Gt,Xt),e(Xt,Fn),e(Gt,xn),e(ue,Mn),e(ue,Jt),e(Jt,qn),e(Jt,Oo),e(Oo,Pn),e(Jt,An),e(ue,Sn),e(ue,Qt),e(Qt,On),e(Qt,Zt),e(Zt,Dn),e(Qt,zn),e(ue,In),e(ue,Me),$(eo,Me,null),e(Me,Ln),e(Me,pt),e(pt,Nn),e(pt,Do),e(Do,Bn),e(pt,Rn),e(pt,as),e(as,Wn),e(pt,Un),e(Me,Vn),$($t,Me,null),e(Me,Kn),$(Ct,Me,null),g(o,As,_),g(o,ut,_),e(ut,Ht),e(Ht,rs),$(to,rs,null),e(ut,Yn),e(ut,is),e(is,Gn),g(o,Ss,_),g(o,he,_),$(oo,he,null),e(he,Xn),e(he,ht),e(ht,Jn),e(ht,ls),e(ls,Qn),e(ht,Zn),e(ht,so),e(so,ea),e(ht,ta),e(he,oa),e(he,no),e(no,sa),e(no,zo),e(zo,na),e(no,aa),e(he,ra),e(he,ao),e(ao,ia),e(ao,ro),e(ro,la),e(ao,da),e(he,ca),e(he,qe),$(io,qe,null),e(qe,pa),e(qe,mt),e(mt,ua),e(mt,Io),e(Io,ha),e(mt,ma),e(mt,ds),e(ds,fa),e(mt,ga),e(qe,_a),$(Et,qe,null),e(qe,ba),$(jt,qe,null),g(o,Os,_),g(o,ft,_),e(ft,Ft),e(Ft,cs),$(lo,cs,null),e(ft,va),e(ft,ps),e(ps,ya),g(o,Ds,_),g(o,K,_),$(co,K,null),e(K,wa),e(K,us),e(us,Ta),e(K,ka),e(K,po),e(po,$a),e(po,uo),e(uo,Ca),e(po,Ha),e(K,Ea),e(K,ho),e(ho,ja),e(ho,Lo),e(Lo,Fa),e(ho,xa),e(K,Ma),e(K,mo),e(mo,qa),e(mo,fo),e(fo,Pa),e(mo,Aa),e(K,Sa),e(K,Pe),$(go,Pe,null),e(Pe,Oa),e(Pe,gt),e(gt,Da),e(gt,No),e(No,za),e(gt,Ia),e(gt,hs),e(hs,La),e(gt,Na),e(Pe,Ba),$(xt,Pe,null),e(Pe,Ra),$(Mt,Pe,null),g(o,zs,_),g(o,_t,_),e(_t,qt),e(qt,ms),$(_o,ms,null),e(_t,Wa),e(_t,fs),e(fs,Ua),g(o,Is,_),g(o,Y,_),$(bo,Y,null),e(Y,Va),e(Y,gs),e(gs,Ka),e(Y,Ya),e(Y,vo),e(vo,Ga),e(vo,Bo),e(Bo,Xa),e(vo,Ja),e(Y,Qa),e(Y,yo),e(yo,Za),e(yo,wo),e(wo,er),e(yo,tr),e(Y,or),$(Pt,Y,null),e(Y,sr),e(Y,Ae),$(To,Ae,null),e(Ae,nr),e(Ae,bt),e(bt,ar),e(bt,Ro),e(Ro,rr),e(bt,ir),e(bt,_s),e(_s,lr),e(bt,dr),e(Ae,cr),$(At,Ae,null),e(Ae,pr),$(St,Ae,null),g(o,Ls,_),g(o,vt,_),e(vt,Ot),e(Ot,bs),$(ko,bs,null),e(vt,ur),e(vt,vs),e(vs,hr),g(o,Ns,_),g(o,G,_),$($o,G,null),e(G,mr),e(G,Co),e(Co,fr),e(Co,ys),e(ys,gr),e(Co,_r),e(G,br),e(G,Ho),e(Ho,vr),e(Ho,Wo),e(Wo,yr),e(Ho,wr),e(G,Tr),e(G,Eo),e(Eo,kr),e(Eo,jo),e(jo,$r),e(Eo,Cr),e(G,Hr),$(Dt,G,null),e(G,Er),e(G,Se),$(Fo,Se,null),e(Se,jr),e(Se,yt),e(yt,Fr),e(yt,Uo),e(Uo,xr),e(yt,Mr),e(yt,ws),e(ws,qr),e(yt,Pr),e(Se,Ar),$(zt,Se,null),e(Se,Sr),$(It,Se,null),Bs=!0},p(o,[_]){const xo={};_&2&&(xo.$$scope={dirty:_,ctx:o}),Tt.$set(xo);const Ts={};_&2&&(Ts.$$scope={dirty:_,ctx:o}),$t.$set(Ts);const ks={};_&2&&(ks.$$scope={dirty:_,ctx:o}),Ct.$set(ks);const $s={};_&2&&($s.$$scope={dirty:_,ctx:o}),Et.$set($s);const Mo={};_&2&&(Mo.$$scope={dirty:_,ctx:o}),jt.$set(Mo);const Cs={};_&2&&(Cs.$$scope={dirty:_,ctx:o}),xt.$set(Cs);const Hs={};_&2&&(Hs.$$scope={dirty:_,ctx:o}),Mt.$set(Hs);const Es={};_&2&&(Es.$$scope={dirty:_,ctx:o}),Pt.$set(Es);const qo={};_&2&&(qo.$$scope={dirty:_,ctx:o}),At.$set(qo);const js={};_&2&&(js.$$scope={dirty:_,ctx:o}),St.$set(js);const Fs={};_&2&&(Fs.$$scope={dirty:_,ctx:o}),Dt.$set(Fs);const xs={};_&2&&(xs.$$scope={dirty:_,ctx:o}),zt.$set(xs);const Ms={};_&2&&(Ms.$$scope={dirty:_,ctx:o}),It.$set(Ms)},i(o){Bs||(C(l.$$.fragment,o),C(w.$$.fragment,o),C(P.$$.fragment,o),C(I.$$.fragment,o),C(ve.$$.fragment,o),C(Tt.$$.fragment,o),C(Kt.$$.fragment,o),C(Yt.$$.fragment,o),C(eo.$$.fragment,o),C($t.$$.fragment,o),C(Ct.$$.fragment,o),C(to.$$.fragment,o),C(oo.$$.fragment,o),C(io.$$.fragment,o),C(Et.$$.fragment,o),C(jt.$$.fragment,o),C(lo.$$.fragment,o),C(co.$$.fragment,o),C(go.$$.fragment,o),C(xt.$$.fragment,o),C(Mt.$$.fragment,o),C(_o.$$.fragment,o),C(bo.$$.fragment,o),C(Pt.$$.fragment,o),C(To.$$.fragment,o),C(At.$$.fragment,o),C(St.$$.fragment,o),C(ko.$$.fragment,o),C($o.$$.fragment,o),C(Dt.$$.fragment,o),C(Fo.$$.fragment,o),C(zt.$$.fragment,o),C(It.$$.fragment,o),Bs=!0)},o(o){H(l.$$.fragment,o),H(w.$$.fragment,o),H(P.$$.fragment,o),H(I.$$.fragment,o),H(ve.$$.fragment,o),H(Tt.$$.fragment,o),H(Kt.$$.fragment,o),H(Yt.$$.fragment,o),H(eo.$$.fragment,o),H($t.$$.fragment,o),H(Ct.$$.fragment,o),H(to.$$.fragment,o),H(oo.$$.fragment,o),H(io.$$.fragment,o),H(Et.$$.fragment,o),H(jt.$$.fragment,o),H(lo.$$.fragment,o),H(co.$$.fragment,o),H(go.$$.fragment,o),H(xt.$$.fragment,o),H(Mt.$$.fragment,o),H(_o.$$.fragment,o),H(bo.$$.fragment,o),H(Pt.$$.fragment,o),H(To.$$.fragment,o),H(At.$$.fragment,o),H(St.$$.fragment,o),H(ko.$$.fragment,o),H($o.$$.fragment,o),H(Dt.$$.fragment,o),H(Fo.$$.fragment,o),H(zt.$$.fragment,o),H(It.$$.fragment,o),Bs=!1},d(o){t(d),o&&t(y),o&&t(f),E(l),o&&t(we),o&&t(S),E(w),o&&t(Te),o&&t(L),o&&t(ke),o&&t(R),o&&t($e),o&&t(W),o&&t(me),o&&t(q),o&&t(Ce),o&&t(N),o&&t(He),o&&t(J),o&&t(Ee),o&&t(D),E(P),o&&t(je),o&&t(b),o&&t(st),o&&t(de),E(I),o&&t(Z),o&&t(B),E(ve),E(Tt),o&&t(qs),o&&t(ct),E(Kt),o&&t(Ps),o&&t(ue),E(Yt),E(eo),E($t),E(Ct),o&&t(As),o&&t(ut),E(to),o&&t(Ss),o&&t(he),E(oo),E(io),E(Et),E(jt),o&&t(Os),o&&t(ft),E(lo),o&&t(Ds),o&&t(K),E(co),E(go),E(xt),E(Mt),o&&t(zs),o&&t(_t),E(_o),o&&t(Is),o&&t(Y),E(bo),E(Pt),E(To),E(At),E(St),o&&t(Ls),o&&t(vt),E(ko),o&&t(Ns),o&&t(G),E($o),E(Dt),E(Fo),E(zt),E(It)}}}const il={local:"hubert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.HubertConfig",title:"HubertConfig"},{local:"transformers.HubertModel",title:"HubertModel"},{local:"transformers.HubertForCTC",title:"HubertForCTC"},{local:"transformers.HubertForSequenceClassification",title:"HubertForSequenceClassification"},{local:"transformers.TFHubertModel",title:"TFHubertModel"},{local:"transformers.TFHubertForCTC",title:"TFHubertForCTC"}],title:"Hubert"};function ll(M){return Vi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fl extends Bi{constructor(d){super();Ri(this,d,ll,rl,Wi,{})}}export{fl as default,il as metadata};
