import{S as wm,i as ym,s as Tm,e as n,k as u,w as z,t as i,M as Sm,c as r,d as s,m as h,a,x as q,h as l,b as g,G as e,g as k,y as v,q as $,o as w,B as y,v as Bm,L as P}from"../../chunks/vendor-hf-doc-builder.js";import{T as Xo}from"../../chunks/Tip-hf-doc-builder.js";import{D as L}from"../../chunks/Docstring-hf-doc-builder.js";import{C as A}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ne}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as C}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Em(T){let d,_,m,c,f;return c=new A({props:{code:`from transformers import SqueezeBertConfig, SqueezeBertModel

# Initializing a SqueezeBERT configuration
configuration = SqueezeBertConfig()

# Initializing a model (with random weights) from the configuration above
model = SqueezeBertModel(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> SqueezeBertConfig, SqueezeBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a SqueezeBERT configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = SqueezeBertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration above</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertModel(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=n("p"),_=i("Examples:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Examples:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function jm(T){let d,_,m,c,f;return c=new A({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=n("p"),_=i("sequence pair mask has the following format:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"sequence pair mask has the following format:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function xm(T){let d,_,m,c,f;return c=new A({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=n("p"),_=i("sequence pair mask has the following format:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"sequence pair mask has the following format:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Mm(T){let d,_,m,c,f;return c=new A({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){d=n("p"),_=i("Hierarchy:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Hierarchy:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Fm(T){let d,_,m,c,f;return c=new A({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){d=n("p"),_=i("Data layouts:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Data layouts:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Cm(T){let d,_,m,c,f;return{c(){d=n("p"),_=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),c=i("Module"),f=i(`
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(t){d=r(t,"P",{});var p=a(d);_=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(p,"CODE",{});var S=a(m);c=l(S,"Module"),S.forEach(s),f=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){k(t,d,p),e(d,_),e(d,m),e(m,c),e(d,f)},d(t){t&&s(d)}}}function Pm(T){let d,_,m,c,f;return c=new A({props:{code:`from transformers import AutoTokenizer, SqueezeBertModel
import torch

tokenizer = AutoTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertModel.from_pretrained("squeezebert/squeezebert-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.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> AutoTokenizer, SqueezeBertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertModel.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=n("p"),_=i("Example:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Example:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Am(T){let d,_,m,c,f;return c=new A({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){d=n("p"),_=i("Hierarchy:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Hierarchy:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Lm(T){let d,_,m,c,f;return c=new A({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){d=n("p"),_=i("Data layouts:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Data layouts:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Im(T){let d,_,m,c,f;return{c(){d=n("p"),_=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),c=i("Module"),f=i(`
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(t){d=r(t,"P",{});var p=a(d);_=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(p,"CODE",{});var S=a(m);c=l(S,"Module"),S.forEach(s),f=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){k(t,d,p),e(d,_),e(d,m),e(m,c),e(d,f)},d(t){t&&s(d)}}}function Nm(T){let d,_,m,c,f;return c=new A({props:{code:`from transformers import AutoTokenizer, SqueezeBertForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForMaskedLM.from_pretrained("squeezebert/squeezebert-uncased")

inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt")

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

# retrieve index of [MASK]
mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]

predicted_token_id = logits[0, mask_token_index].argmax(axis=-1)

labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]
# mask labels of non-[MASK] tokens
labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForMaskedLM.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is [MASK].&quot;</span>, 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><span class="hljs-comment"># retrieve index of [MASK]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-[MASK] tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){d=n("p"),_=i("Example:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Example:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Dm(T){let d,_,m,c,f;return c=new A({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){d=n("p"),_=i("Hierarchy:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Hierarchy:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Om(T){let d,_,m,c,f;return c=new A({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){d=n("p"),_=i("Data layouts:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Data layouts:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Rm(T){let d,_,m,c,f;return{c(){d=n("p"),_=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),c=i("Module"),f=i(`
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(t){d=r(t,"P",{});var p=a(d);_=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(p,"CODE",{});var S=a(m);c=l(S,"Module"),S.forEach(s),f=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){k(t,d,p),e(d,_),e(d,m),e(m,c),e(d,f)},d(t){t&&s(d)}}}function Wm(T){let d,_,m,c,f;return c=new A({props:{code:`import torch
from transformers import AutoTokenizer, SqueezeBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForSequenceClassification.from_pretrained("squeezebert/squeezebert-uncased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

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

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = SqueezeBertForSequenceClassification.from_pretrained("squeezebert/squeezebert-uncased", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, 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_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),_=i("Example of single-label classification:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Example of single-label classification:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Km(T){let d,_,m,c,f;return c=new A({props:{code:`import torch
from transformers import AutoTokenizer, SqueezeBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForSequenceClassification.from_pretrained("squeezebert/squeezebert-uncased", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

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

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = SqueezeBertForSequenceClassification.from_pretrained(
    "squeezebert/squeezebert-uncased", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, 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.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),_=i("Example of multi-label classification:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Example of multi-label classification:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Hm(T){let d,_,m,c,f;return c=new A({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){d=n("p"),_=i("Hierarchy:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Hierarchy:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Qm(T){let d,_,m,c,f;return c=new A({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){d=n("p"),_=i("Data layouts:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Data layouts:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Um(T){let d,_,m,c,f;return{c(){d=n("p"),_=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),c=i("Module"),f=i(`
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(t){d=r(t,"P",{});var p=a(d);_=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(p,"CODE",{});var S=a(m);c=l(S,"Module"),S.forEach(s),f=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){k(t,d,p),e(d,_),e(d,m),e(m,c),e(d,f)},d(t){t&&s(d)}}}function Vm(T){let d,_,m,c,f;return c=new A({props:{code:`from transformers import AutoTokenizer, SqueezeBertForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForMultipleChoice.from_pretrained("squeezebert/squeezebert-uncased")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=n("p"),_=i("Example:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Example:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Gm(T){let d,_,m,c,f;return c=new A({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){d=n("p"),_=i("Hierarchy:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Hierarchy:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Jm(T){let d,_,m,c,f;return c=new A({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){d=n("p"),_=i("Data layouts:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Data layouts:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Xm(T){let d,_,m,c,f;return{c(){d=n("p"),_=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),c=i("Module"),f=i(`
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(t){d=r(t,"P",{});var p=a(d);_=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(p,"CODE",{});var S=a(m);c=l(S,"Module"),S.forEach(s),f=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){k(t,d,p),e(d,_),e(d,m),e(m,c),e(d,f)},d(t){t&&s(d)}}}function Ym(T){let d,_,m,c,f;return c=new A({props:{code:`from transformers import AutoTokenizer, SqueezeBertForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForTokenClassification.from_pretrained("squeezebert/squeezebert-uncased")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

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

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </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_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),_=i("Example:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Example:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function Zm(T){let d,_,m,c,f;return c=new A({props:{code:`Internal class hierarchy:
SqueezeBertModel
    SqueezeBertEncoder
        SqueezeBertModule
        SqueezeBertSelfAttention
            ConvActivation
            ConvDropoutLayerNorm`,highlighted:`Internal <span class="hljs-keyword">class</span> <span class="hljs-symbol">hierarchy:
<span class="hljs-symbol">SqueezeBertModel</span></span>
    <span class="hljs-symbol">SqueezeBertEncoder</span>
        <span class="hljs-symbol">SqueezeBertModule</span>
        <span class="hljs-symbol">SqueezeBertSelfAttention</span>
            <span class="hljs-symbol">ConvActivation</span>
            <span class="hljs-symbol">ConvDropoutLayerNorm</span>`}}),{c(){d=n("p"),_=i("Hierarchy:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Hierarchy:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function ef(T){let d,_,m,c,f;return c=new A({props:{code:`Input data is in [batch, sequence_length, hidden_size] format.

Data inside the encoder is in [batch, hidden_size, sequence_length] format. But, if \`output_hidden_states == True\`, the data from inside the encoder is returned in [batch, sequence_length, hidden_size] format.

The final output of the encoder is in [batch, sequence_length, hidden_size] format.`,highlighted:`<span class="hljs-keyword">Input</span> data <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

Data inside the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, hidden_size, sequence_length] <span class="hljs-keyword">format</span>. But, <span class="hljs-keyword">if</span> \`output_hidden_states == <span class="hljs-keyword">True</span>\`, the data <span class="hljs-keyword">from</span> inside the encoder <span class="hljs-keyword">is</span> returned <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.

The final output <span class="hljs-keyword">of</span> the encoder <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> [batch, sequence_length, hidden_size] <span class="hljs-keyword">format</span>.`}}),{c(){d=n("p"),_=i("Data layouts:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Data layouts:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function tf(T){let d,_,m,c,f;return{c(){d=n("p"),_=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),c=i("Module"),f=i(`
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(t){d=r(t,"P",{});var p=a(d);_=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(p,"CODE",{});var S=a(m);c=l(S,"Module"),S.forEach(s),f=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(s)},m(t,p){k(t,d,p),e(d,_),e(d,m),e(m,c),e(d,f)},d(t){t&&s(d)}}}function sf(T){let d,_,m,c,f;return c=new A({props:{code:`from transformers import AutoTokenizer, SqueezeBertForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("squeezebert/squeezebert-uncased")
model = SqueezeBertForQuestionAnswering.from_pretrained("squeezebert/squeezebert-uncased")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, SqueezeBertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SqueezeBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;squeezebert/squeezebert-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){d=n("p"),_=i("Example:"),m=u(),z(c.$$.fragment)},l(t){d=r(t,"P",{});var p=a(d);_=l(p,"Example:"),p.forEach(s),m=h(t),q(c.$$.fragment,t)},m(t,p){k(t,d,p),e(d,_),k(t,m,p),v(c,t,p),f=!0},p:P,i(t){f||($(c.$$.fragment,t),f=!0)},o(t){w(c.$$.fragment,t),f=!1},d(t){t&&s(d),t&&s(m),y(c,t)}}}function of(T){let d,_,m,c,f,t,p,S,Qa,xr,ue,Ae,Yo,jt,Ua,Zo,Va,Mr,re,Ga,xt,Ja,Xa,Mt,Ya,Za,Fr,io,ei,Cr,lo,en,ti,Pr,co,si,Ar,ae,tn,oi,ni,sn,ri,ai,Ft,ii,on,li,di,Lr,Le,ci,Ct,pi,ui,Ir,he,Ie,nn,Pt,hi,rn,mi,Nr,U,an,po,fi,gi,ln,uo,_i,bi,dn,ho,ki,zi,cn,mo,qi,vi,pn,fo,$i,Dr,me,Ne,un,At,wi,hn,yi,Or,H,Lt,Ti,fe,Si,go,Bi,Ei,It,ji,xi,Mi,ge,Fi,_o,Ci,Pi,bo,Ai,Li,Ii,De,Ni,mn,Di,Rr,_e,Oe,fn,Nt,Oi,gn,Ri,Wr,I,Dt,Wi,_n,Ki,Hi,Ot,Qi,ko,Ui,Vi,Gi,ie,Rt,Ji,bn,Xi,Yi,Wt,zo,Zi,kn,el,tl,qo,sl,zn,ol,nl,Re,Kt,rl,Ht,al,qn,il,ll,dl,X,Qt,cl,vn,pl,ul,We,hl,be,ml,$n,fl,gl,wn,_l,bl,kl,vo,Ut,Kr,ke,Ke,yn,Vt,zl,Tn,ql,Hr,Q,Gt,vl,Jt,$l,Sn,wl,yl,Tl,Xt,Sl,$o,Bl,El,jl,le,Yt,xl,Bn,Ml,Fl,Zt,wo,Cl,En,Pl,Al,yo,Ll,jn,Il,Nl,Y,es,Dl,xn,Ol,Rl,He,Wl,ze,Kl,Mn,Hl,Ql,Fn,Ul,Vl,Qr,qe,Qe,Cn,ts,Gl,Pn,Jl,Ur,B,ss,Xl,An,Yl,Zl,os,ed,ns,td,sd,od,rs,nd,To,rd,ad,id,as,ld,is,dd,cd,pd,ls,ud,Ln,hd,md,fd,Ue,gd,Ve,_d,Z,ds,bd,ve,kd,So,zd,qd,In,vd,$d,wd,Ge,yd,Je,Vr,$e,Xe,Nn,cs,Td,Dn,Sd,Gr,E,ps,Bd,us,Ed,On,jd,xd,Md,hs,Fd,ms,Cd,Pd,Ad,fs,Ld,Bo,Id,Nd,Dd,gs,Od,_s,Rd,Wd,Kd,bs,Hd,Rn,Qd,Ud,Vd,Ye,Gd,Ze,Jd,ee,ks,Xd,we,Yd,Eo,Zd,ec,Wn,tc,sc,oc,et,nc,tt,Jr,ye,st,Kn,zs,rc,Hn,ac,Xr,j,qs,ic,Qn,lc,dc,vs,cc,$s,pc,uc,hc,ws,mc,jo,fc,gc,_c,ys,bc,Ts,kc,zc,qc,Ss,vc,Un,$c,wc,yc,ot,Tc,nt,Sc,V,Bs,Bc,Te,Ec,xo,jc,xc,Vn,Mc,Fc,Cc,rt,Pc,at,Ac,it,Yr,Se,lt,Gn,Es,Lc,Jn,Ic,Zr,x,js,Nc,Xn,Dc,Oc,xs,Rc,Ms,Wc,Kc,Hc,Fs,Qc,Mo,Uc,Vc,Gc,Cs,Jc,Ps,Xc,Yc,Zc,As,ep,Yn,tp,sp,op,dt,np,ct,rp,te,Ls,ap,Be,ip,Fo,lp,dp,Zn,cp,pp,up,pt,hp,ut,ea,Ee,ht,er,Is,mp,tr,fp,ta,M,Ns,gp,sr,_p,bp,Ds,kp,Os,zp,qp,vp,Rs,$p,Co,wp,yp,Tp,Ws,Sp,Ks,Bp,Ep,jp,Hs,xp,or,Mp,Fp,Cp,mt,Pp,ft,Ap,se,Qs,Lp,je,Ip,Po,Np,Dp,nr,Op,Rp,Wp,gt,Kp,_t,sa,xe,bt,rr,Us,Hp,ar,Qp,oa,F,Vs,Up,Me,Vp,ir,Gp,Jp,lr,Xp,Yp,Zp,Gs,eu,Js,tu,su,ou,Xs,nu,Ao,ru,au,iu,Ys,lu,Zs,du,cu,pu,eo,uu,dr,hu,mu,fu,kt,gu,zt,_u,oe,to,bu,Fe,ku,Lo,zu,qu,cr,vu,$u,wu,qt,yu,vt,na;return t=new ne({}),jt=new ne({}),Pt=new ne({}),At=new ne({}),Lt=new L({props:{name:"class transformers.SqueezeBertConfig",anchor:"transformers.SqueezeBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"embedding_size",val:" = 768"},{name:"q_groups",val:" = 4"},{name:"k_groups",val:" = 4"},{name:"v_groups",val:" = 4"},{name:"post_attention_groups",val:" = 1"},{name:"intermediate_groups",val:" = 4"},{name:"output_groups",val:" = 4"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the SqueezeBERT 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/squeezebert#transformers.SqueezeBertModel">SqueezeBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.SqueezeBertConfig.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.SqueezeBertConfig.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.SqueezeBertConfig.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.SqueezeBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.SqueezeBertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.SqueezeBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.SqueezeBertConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.SqueezeBertConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.SqueezeBertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.29.0/en/model_doc/bert#transformers.BertModel">BertModel</a> or <a href="/docs/transformers/v4.29.0/en/model_doc/bert#transformers.TFBertModel">TFBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.SqueezeBertConfig.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.SqueezeBertConfig.layer_norm_eps",description:"<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;",name:"layer_norm_eps"},{anchor:"transformers.SqueezeBertConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The ID of the token in the word embedding to use as padding.`,name:"pad_token_id"},{anchor:"transformers.SqueezeBertConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The dimension of the word embedding vectors.`,name:"embedding_size"},{anchor:"transformers.SqueezeBertConfig.q_groups",description:`<strong>q_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in Q layer.`,name:"q_groups"},{anchor:"transformers.SqueezeBertConfig.k_groups",description:`<strong>k_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in K layer.`,name:"k_groups"},{anchor:"transformers.SqueezeBertConfig.v_groups",description:`<strong>v_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in V layer.`,name:"v_groups"},{anchor:"transformers.SqueezeBertConfig.post_attention_groups",description:`<strong>post_attention_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of groups in the first feed forward network layer.`,name:"post_attention_groups"},{anchor:"transformers.SqueezeBertConfig.intermediate_groups",description:`<strong>intermediate_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in the second feed forward network layer.`,name:"intermediate_groups"},{anchor:"transformers.SqueezeBertConfig.output_groups",description:`<strong>output_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of groups in the third feed forward network layer.`,name:"output_groups"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/configuration_squeezebert.py#L37"}}),De=new C({props:{anchor:"transformers.SqueezeBertConfig.example",$$slots:{default:[Em]},$$scope:{ctx:T}}}),Nt=new ne({}),Dt=new L({props:{name:"class transformers.SqueezeBertTokenizer",anchor:"transformers.SqueezeBertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.SqueezeBertTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.SqueezeBertTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.SqueezeBertTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.SqueezeBertTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.SqueezeBertTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.SqueezeBertTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.SqueezeBertTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.SqueezeBertTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.SqueezeBertTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.SqueezeBertTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original SqueezeBERT).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/tokenization_squeezebert.py#L79"}}),Rt=new L({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.SqueezeBertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.SqueezeBertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/tokenization_squeezebert.py#L209",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Kt=new L({props:{name:"get_special_tokens_mask",anchor:"transformers.SqueezeBertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.SqueezeBertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.SqueezeBertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.SqueezeBertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/tokenization_squeezebert.py#L234",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Qt=new L({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.SqueezeBertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.SqueezeBertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/tokenization_squeezebert.py#L262",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),We=new C({props:{anchor:"transformers.SqueezeBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[jm]},$$scope:{ctx:T}}}),Ut=new L({props:{name:"save_vocabulary",anchor:"transformers.SqueezeBertTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/tokenization_squeezebert.py#L291"}}),Vt=new ne({}),Gt=new L({props:{name:"class transformers.SqueezeBertTokenizerFast",anchor:"transformers.SqueezeBertTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.SqueezeBertTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.SqueezeBertTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.SqueezeBertTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.SqueezeBertTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.SqueezeBertTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.SqueezeBertTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.SqueezeBertTokenizerFast.clean_text",description:`<strong>clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.`,name:"clean_text"},{anchor:"transformers.SqueezeBertTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.SqueezeBertTokenizerFast.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original SqueezeBERT).`,name:"strip_accents"},{anchor:"transformers.SqueezeBertTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py#L69"}}),Yt=new L({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.SqueezeBertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.SqueezeBertTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py#L157",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),es=new L({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.SqueezeBertTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.SqueezeBertTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/tokenization_squeezebert_fast.py#L181",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),He=new C({props:{anchor:"transformers.SqueezeBertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[xm]},$$scope:{ctx:T}}}),ts=new ne({}),ss=new L({props:{name:"class transformers.SqueezeBertModel",anchor:"transformers.SqueezeBertModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</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/squeezebert/modeling_squeezebert.py#L546"}}),Ue=new C({props:{anchor:"transformers.SqueezeBertModel.example",$$slots:{default:[Mm]},$$scope:{ctx:T}}}),Ve=new C({props:{anchor:"transformers.SqueezeBertModel.example-2",$$slots:{default:[Fm]},$$scope:{ctx:T}}}),ds=new L({props:{name:"forward",anchor:"transformers.SqueezeBertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",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.SqueezeBertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertModel.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.SqueezeBertModel.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.SqueezeBertModel.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/squeezebert/modeling_squeezebert.py#L571",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new Xo({props:{$$slots:{default:[Cm]},$$scope:{ctx:T}}}),Je=new C({props:{anchor:"transformers.SqueezeBertModel.forward.example",$$slots:{default:[Pm]},$$scope:{ctx:T}}}),cs=new ne({}),ps=new L({props:{name:"class transformers.SqueezeBertForMaskedLM",anchor:"transformers.SqueezeBertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</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/squeezebert/modeling_squeezebert.py#L645"}}),Ye=new C({props:{anchor:"transformers.SqueezeBertForMaskedLM.example",$$slots:{default:[Am]},$$scope:{ctx:T}}}),Ze=new C({props:{anchor:"transformers.SqueezeBertForMaskedLM.example-2",$$slots:{default:[Lm]},$$scope:{ctx:T}}}),ks=new L({props:{name:"forward",anchor:"transformers.SqueezeBertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.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.SqueezeBertForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</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_ids</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/squeezebert/modeling_squeezebert.py#L667",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</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/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</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 Masked language modeling (MLM) loss.</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.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),et=new Xo({props:{$$slots:{default:[Im]},$$scope:{ctx:T}}}),tt=new C({props:{anchor:"transformers.SqueezeBertForMaskedLM.forward.example",$$slots:{default:[Nm]},$$scope:{ctx:T}}}),zs=new ne({}),qs=new L({props:{name:"class transformers.SqueezeBertForSequenceClassification",anchor:"transformers.SqueezeBertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</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/squeezebert/modeling_squeezebert.py#L733"}}),ot=new C({props:{anchor:"transformers.SqueezeBertForSequenceClassification.example",$$slots:{default:[Dm]},$$scope:{ctx:T}}}),nt=new C({props:{anchor:"transformers.SqueezeBertForSequenceClassification.example-2",$$slots:{default:[Om]},$$scope:{ctx:T}}}),Bs=new L({props:{name:"forward",anchor:"transformers.SqueezeBertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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.SqueezeBertForSequenceClassification.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/squeezebert/modeling_squeezebert.py#L746",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/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</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>
`}}),rt=new Xo({props:{$$slots:{default:[Rm]},$$scope:{ctx:T}}}),at=new C({props:{anchor:"transformers.SqueezeBertForSequenceClassification.forward.example",$$slots:{default:[Wm]},$$scope:{ctx:T}}}),it=new C({props:{anchor:"transformers.SqueezeBertForSequenceClassification.forward.example-2",$$slots:{default:[Km]},$$scope:{ctx:T}}}),Es=new ne({}),js=new L({props:{name:"class transformers.SqueezeBertForMultipleChoice",anchor:"transformers.SqueezeBertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</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/squeezebert/modeling_squeezebert.py#L832"}}),dt=new C({props:{anchor:"transformers.SqueezeBertForMultipleChoice.example",$$slots:{default:[Hm]},$$scope:{ctx:T}}}),ct=new C({props:{anchor:"transformers.SqueezeBertForMultipleChoice.example-2",$$slots:{default:[Qm]},$$scope:{ctx:T}}}),Ls=new L({props:{name:"forward",anchor:"transformers.SqueezeBertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</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.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</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.SqueezeBertForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</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.SqueezeBertForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</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.SqueezeBertForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.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.SqueezeBertForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <em>num_choices</em> is the size of the second dimension of the input tensors. (see
<em>input_ids</em> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/modeling_squeezebert.py#L843",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</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/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification 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.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pt=new Xo({props:{$$slots:{default:[Um]},$$scope:{ctx:T}}}),ut=new C({props:{anchor:"transformers.SqueezeBertForMultipleChoice.forward.example",$$slots:{default:[Vm]},$$scope:{ctx:T}}}),Is=new ne({}),Ns=new L({props:{name:"class transformers.SqueezeBertForTokenClassification",anchor:"transformers.SqueezeBertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</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/squeezebert/modeling_squeezebert.py#L925"}}),mt=new C({props:{anchor:"transformers.SqueezeBertForTokenClassification.example",$$slots:{default:[Gm]},$$scope:{ctx:T}}}),ft=new C({props:{anchor:"transformers.SqueezeBertForTokenClassification.example-2",$$slots:{default:[Jm]},$$scope:{ctx:T}}}),Qs=new L({props:{name:"forward",anchor:"transformers.SqueezeBertForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.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.SqueezeBertForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/modeling_squeezebert.py#L937",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</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/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</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 loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification 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.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),gt=new Xo({props:{$$slots:{default:[Xm]},$$scope:{ctx:T}}}),_t=new C({props:{anchor:"transformers.SqueezeBertForTokenClassification.forward.example",$$slots:{default:[Ym]},$$scope:{ctx:T}}}),Us=new ne({}),Vs=new L({props:{name:"class transformers.SqueezeBertForQuestionAnswering",anchor:"transformers.SqueezeBertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SqueezeBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertConfig">SqueezeBertConfig</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/squeezebert/modeling_squeezebert.py#L1003"}}),kt=new C({props:{anchor:"transformers.SqueezeBertForQuestionAnswering.example",$$slots:{default:[Zm]},$$scope:{ctx:T}}}),zt=new C({props:{anchor:"transformers.SqueezeBertForQuestionAnswering.example-2",$$slots:{default:[ef]},$$scope:{ctx:T}}}),to=new L({props:{name:"forward",anchor:"transformers.SqueezeBertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</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.SqueezeBertForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.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.SqueezeBertForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<em>sequence_length</em>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/squeezebert/modeling_squeezebert.py#L1014",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</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/squeezebert#transformers.SqueezeBertConfig"
>SqueezeBertConfig</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 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end 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.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qt=new Xo({props:{$$slots:{default:[tf]},$$scope:{ctx:T}}}),vt=new C({props:{anchor:"transformers.SqueezeBertForQuestionAnswering.forward.example",$$slots:{default:[sf]},$$scope:{ctx:T}}}),{c(){d=n("meta"),_=u(),m=n("h1"),c=n("a"),f=n("span"),z(t.$$.fragment),p=u(),S=n("span"),Qa=i("SqueezeBERT"),xr=u(),ue=n("h2"),Ae=n("a"),Yo=n("span"),z(jt.$$.fragment),Ua=u(),Zo=n("span"),Va=i("Overview"),Mr=u(),re=n("p"),Ga=i("The SqueezeBERT model was proposed in "),xt=n("a"),Ja=i("SqueezeBERT: What can computer vision teach NLP about efficient neural networks?"),Xa=i(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, Kurt W. Keutzer. It\u2019s a
bidirectional transformer similar to the BERT model. The key difference between the BERT architecture and the
SqueezeBERT architecture is that SqueezeBERT uses `),Mt=n("a"),Ya=i("grouped convolutions"),Za=i(`
instead of fully-connected layers for the Q, K, V and FFN layers.`),Fr=u(),io=n("p"),ei=i("The abstract from the paper is the following:"),Cr=u(),lo=n("p"),en=n("em"),ti=i(`Humans read and write hundreds of billions of messages every day. Further, due to the availability of large datasets,
large computing systems, and better neural network models, natural language processing (NLP) technology has made
significant strides in understanding, proofreading, and organizing these messages. Thus, there is a significant
opportunity to deploy NLP in myriad applications to help web users, social networks, and businesses. In particular, we
consider smartphones and other mobile devices as crucial platforms for deploying NLP models at scale. However, today\u2019s
highly-accurate NLP neural network models such as BERT and RoBERTa are extremely computationally expensive, with
BERT-base taking 1.7 seconds to classify a text snippet on a Pixel 3 smartphone. In this work, we observe that methods
such as grouped convolutions have yielded significant speedups for computer vision networks, but many of these
techniques have not been adopted by NLP neural network designers. We demonstrate how to replace several operations in
self-attention layers with grouped convolutions, and we use this technique in a novel network architecture called
SqueezeBERT, which runs 4.3x faster than BERT-base on the Pixel 3 while achieving competitive accuracy on the GLUE test
set. The SqueezeBERT code will be released.`),Pr=u(),co=n("p"),si=i("Tips:"),Ar=u(),ae=n("ul"),tn=n("li"),oi=i(`SqueezeBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right
rather than the left.`),ni=u(),sn=n("li"),ri=i(`SqueezeBERT is similar to BERT and therefore relies on the masked language modeling (MLM) objective. It is therefore
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation. Models trained
with a causal language modeling (CLM) objective are better in that regard.`),ai=u(),Ft=n("li"),ii=i(`For best results when finetuning on sequence classification tasks, it is recommended to start with the
`),on=n("em"),li=i("squeezebert/squeezebert-mnli-headless"),di=i(" checkpoint."),Lr=u(),Le=n("p"),ci=i("This model was contributed by "),Ct=n("a"),pi=i("forresti"),ui=i("."),Ir=u(),he=n("h2"),Ie=n("a"),nn=n("span"),z(Pt.$$.fragment),hi=u(),rn=n("span"),mi=i("Documentation resources"),Nr=u(),U=n("ul"),an=n("li"),po=n("a"),fi=i("Text classification task guide"),gi=u(),ln=n("li"),uo=n("a"),_i=i("Token classification task guide"),bi=u(),dn=n("li"),ho=n("a"),ki=i("Question answering task guide"),zi=u(),cn=n("li"),mo=n("a"),qi=i("Masked language modeling task guide"),vi=u(),pn=n("li"),fo=n("a"),$i=i("Multiple choice task guide"),Dr=u(),me=n("h2"),Ne=n("a"),un=n("span"),z(At.$$.fragment),wi=u(),hn=n("span"),yi=i("SqueezeBertConfig"),Or=u(),H=n("div"),z(Lt.$$.fragment),Ti=u(),fe=n("p"),Si=i("This is the configuration class to store the configuration of a "),go=n("a"),Bi=i("SqueezeBertModel"),Ei=i(`. It is used to instantiate a
SqueezeBERT 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 SqueezeBERT
`),It=n("a"),ji=i("squeezebert/squeezebert-uncased"),xi=i(" architecture."),Mi=u(),ge=n("p"),Fi=i("Configuration objects inherit from "),_o=n("a"),Ci=i("PretrainedConfig"),Pi=i(` and can be used to control the model outputs. Read the
documentation from `),bo=n("a"),Ai=i("PretrainedConfig"),Li=i(" for more information."),Ii=u(),z(De.$$.fragment),Ni=u(),mn=n("p"),Di=i(`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),Rr=u(),_e=n("h2"),Oe=n("a"),fn=n("span"),z(Nt.$$.fragment),Oi=u(),gn=n("span"),Ri=i("SqueezeBertTokenizer"),Wr=u(),I=n("div"),z(Dt.$$.fragment),Wi=u(),_n=n("p"),Ki=i("Construct a SqueezeBERT tokenizer. Based on WordPiece."),Hi=u(),Ot=n("p"),Qi=i("This tokenizer inherits from "),ko=n("a"),Ui=i("PreTrainedTokenizer"),Vi=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Gi=u(),ie=n("div"),z(Rt.$$.fragment),Ji=u(),bn=n("p"),Xi=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A SqueezeBERT sequence has the following format:`),Yi=u(),Wt=n("ul"),zo=n("li"),Zi=i("single sequence: "),kn=n("code"),el=i("[CLS] X [SEP]"),tl=u(),qo=n("li"),sl=i("pair of sequences: "),zn=n("code"),ol=i("[CLS] A [SEP] B [SEP]"),nl=u(),Re=n("div"),z(Kt.$$.fragment),rl=u(),Ht=n("p"),al=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),qn=n("code"),il=i("prepare_for_model"),ll=i(" method."),dl=u(),X=n("div"),z(Qt.$$.fragment),cl=u(),vn=n("p"),pl=i("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A SqueezeBERT"),ul=u(),z(We.$$.fragment),hl=u(),be=n("p"),ml=i("If "),$n=n("code"),fl=i("token_ids_1"),gl=i(" is "),wn=n("code"),_l=i("None"),bl=i(", this method only returns the first portion of the mask (0s)."),kl=u(),vo=n("div"),z(Ut.$$.fragment),Kr=u(),ke=n("h2"),Ke=n("a"),yn=n("span"),z(Vt.$$.fragment),zl=u(),Tn=n("span"),ql=i("SqueezeBertTokenizerFast"),Hr=u(),Q=n("div"),z(Gt.$$.fragment),vl=u(),Jt=n("p"),$l=i("Construct a \u201Cfast\u201D SqueezeBERT tokenizer (backed by HuggingFace\u2019s "),Sn=n("em"),wl=i("tokenizers"),yl=i(" library). Based on WordPiece."),Tl=u(),Xt=n("p"),Sl=i("This tokenizer inherits from "),$o=n("a"),Bl=i("PreTrainedTokenizerFast"),El=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),jl=u(),le=n("div"),z(Yt.$$.fragment),xl=u(),Bn=n("p"),Ml=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A SqueezeBERT sequence has the following format:`),Fl=u(),Zt=n("ul"),wo=n("li"),Cl=i("single sequence: "),En=n("code"),Pl=i("[CLS] X [SEP]"),Al=u(),yo=n("li"),Ll=i("pair of sequences: "),jn=n("code"),Il=i("[CLS] A [SEP] B [SEP]"),Nl=u(),Y=n("div"),z(es.$$.fragment),Dl=u(),xn=n("p"),Ol=i("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A SqueezeBERT"),Rl=u(),z(He.$$.fragment),Wl=u(),ze=n("p"),Kl=i("If "),Mn=n("code"),Hl=i("token_ids_1"),Ql=i(" is "),Fn=n("code"),Ul=i("None"),Vl=i(", this method only returns the first portion of the mask (0s)."),Qr=u(),qe=n("h2"),Qe=n("a"),Cn=n("span"),z(ts.$$.fragment),Gl=u(),Pn=n("span"),Jl=i("SqueezeBertModel"),Ur=u(),B=n("div"),z(ss.$$.fragment),Xl=u(),An=n("p"),Yl=i("The bare SqueezeBERT Model transformer outputting raw hidden-states without any specific head on top."),Zl=u(),os=n("p"),ed=i("The SqueezeBERT model was proposed in "),ns=n("a"),td=i(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),sd=i(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),od=u(),rs=n("p"),nd=i("This model inherits from "),To=n("a"),rd=i("PreTrainedModel"),ad=i(`. 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.)`),id=u(),as=n("p"),ld=i("This model is also a PyTorch "),is=n("a"),dd=i("torch.nn.Module"),cd=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pd=u(),ls=n("p"),ud=i(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Ln=n("em"),hd=i("squeezebert/squeezebert-mnli-headless"),md=i(" checkpoint as a starting point."),fd=u(),z(Ue.$$.fragment),gd=u(),z(Ve.$$.fragment),_d=u(),Z=n("div"),z(ds.$$.fragment),bd=u(),ve=n("p"),kd=i("The "),So=n("a"),zd=i("SqueezeBertModel"),qd=i(" forward method, overrides the "),In=n("code"),vd=i("__call__"),$d=i(" special method."),wd=u(),z(Ge.$$.fragment),yd=u(),z(Je.$$.fragment),Vr=u(),$e=n("h2"),Xe=n("a"),Nn=n("span"),z(cs.$$.fragment),Td=u(),Dn=n("span"),Sd=i("SqueezeBertForMaskedLM"),Gr=u(),E=n("div"),z(ps.$$.fragment),Bd=u(),us=n("p"),Ed=i("SqueezeBERT Model with a "),On=n("code"),jd=i("language modeling"),xd=i(" head on top."),Md=u(),hs=n("p"),Fd=i("The SqueezeBERT model was proposed in "),ms=n("a"),Cd=i(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Pd=i(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Ad=u(),fs=n("p"),Ld=i("This model inherits from "),Bo=n("a"),Id=i("PreTrainedModel"),Nd=i(`. 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.)`),Dd=u(),gs=n("p"),Od=i("This model is also a PyTorch "),_s=n("a"),Rd=i("torch.nn.Module"),Wd=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kd=u(),bs=n("p"),Hd=i(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Rn=n("em"),Qd=i("squeezebert/squeezebert-mnli-headless"),Ud=i(" checkpoint as a starting point."),Vd=u(),z(Ye.$$.fragment),Gd=u(),z(Ze.$$.fragment),Jd=u(),ee=n("div"),z(ks.$$.fragment),Xd=u(),we=n("p"),Yd=i("The "),Eo=n("a"),Zd=i("SqueezeBertForMaskedLM"),ec=i(" forward method, overrides the "),Wn=n("code"),tc=i("__call__"),sc=i(" special method."),oc=u(),z(et.$$.fragment),nc=u(),z(tt.$$.fragment),Jr=u(),ye=n("h2"),st=n("a"),Kn=n("span"),z(zs.$$.fragment),rc=u(),Hn=n("span"),ac=i("SqueezeBertForSequenceClassification"),Xr=u(),j=n("div"),z(qs.$$.fragment),ic=u(),Qn=n("p"),lc=i(`SqueezeBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),dc=u(),vs=n("p"),cc=i("The SqueezeBERT model was proposed in "),$s=n("a"),pc=i(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),uc=i(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),hc=u(),ws=n("p"),mc=i("This model inherits from "),jo=n("a"),fc=i("PreTrainedModel"),gc=i(`. 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.)`),_c=u(),ys=n("p"),bc=i("This model is also a PyTorch "),Ts=n("a"),kc=i("torch.nn.Module"),zc=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qc=u(),Ss=n("p"),vc=i(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Un=n("em"),$c=i("squeezebert/squeezebert-mnli-headless"),wc=i(" checkpoint as a starting point."),yc=u(),z(ot.$$.fragment),Tc=u(),z(nt.$$.fragment),Sc=u(),V=n("div"),z(Bs.$$.fragment),Bc=u(),Te=n("p"),Ec=i("The "),xo=n("a"),jc=i("SqueezeBertForSequenceClassification"),xc=i(" forward method, overrides the "),Vn=n("code"),Mc=i("__call__"),Fc=i(" special method."),Cc=u(),z(rt.$$.fragment),Pc=u(),z(at.$$.fragment),Ac=u(),z(it.$$.fragment),Yr=u(),Se=n("h2"),lt=n("a"),Gn=n("span"),z(Es.$$.fragment),Lc=u(),Jn=n("span"),Ic=i("SqueezeBertForMultipleChoice"),Zr=u(),x=n("div"),z(js.$$.fragment),Nc=u(),Xn=n("p"),Dc=i(`SqueezeBERT Model with a multiple choice classification head on top (a linear layer on top of the pooled output and
a softmax) e.g. for RocStories/SWAG tasks.`),Oc=u(),xs=n("p"),Rc=i("The SqueezeBERT model was proposed in "),Ms=n("a"),Wc=i(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Kc=i(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Hc=u(),Fs=n("p"),Qc=i("This model inherits from "),Mo=n("a"),Uc=i("PreTrainedModel"),Vc=i(`. 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.)`),Gc=u(),Cs=n("p"),Jc=i("This model is also a PyTorch "),Ps=n("a"),Xc=i("torch.nn.Module"),Yc=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Zc=u(),As=n("p"),ep=i(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Yn=n("em"),tp=i("squeezebert/squeezebert-mnli-headless"),sp=i(" checkpoint as a starting point."),op=u(),z(dt.$$.fragment),np=u(),z(ct.$$.fragment),rp=u(),te=n("div"),z(Ls.$$.fragment),ap=u(),Be=n("p"),ip=i("The "),Fo=n("a"),lp=i("SqueezeBertForMultipleChoice"),dp=i(" forward method, overrides the "),Zn=n("code"),cp=i("__call__"),pp=i(" special method."),up=u(),z(pt.$$.fragment),hp=u(),z(ut.$$.fragment),ea=u(),Ee=n("h2"),ht=n("a"),er=n("span"),z(Is.$$.fragment),mp=u(),tr=n("span"),fp=i("SqueezeBertForTokenClassification"),ta=u(),M=n("div"),z(Ns.$$.fragment),gp=u(),sr=n("p"),_p=i(`SqueezeBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),bp=u(),Ds=n("p"),kp=i("The SqueezeBERT model was proposed in "),Os=n("a"),zp=i(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),qp=i(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),vp=u(),Rs=n("p"),$p=i("This model inherits from "),Co=n("a"),wp=i("PreTrainedModel"),yp=i(`. 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.)`),Tp=u(),Ws=n("p"),Sp=i("This model is also a PyTorch "),Ks=n("a"),Bp=i("torch.nn.Module"),Ep=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),jp=u(),Hs=n("p"),xp=i(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),or=n("em"),Mp=i("squeezebert/squeezebert-mnli-headless"),Fp=i(" checkpoint as a starting point."),Cp=u(),z(mt.$$.fragment),Pp=u(),z(ft.$$.fragment),Ap=u(),se=n("div"),z(Qs.$$.fragment),Lp=u(),je=n("p"),Ip=i("The "),Po=n("a"),Np=i("SqueezeBertForTokenClassification"),Dp=i(" forward method, overrides the "),nr=n("code"),Op=i("__call__"),Rp=i(" special method."),Wp=u(),z(gt.$$.fragment),Kp=u(),z(_t.$$.fragment),sa=u(),xe=n("h2"),bt=n("a"),rr=n("span"),z(Us.$$.fragment),Hp=u(),ar=n("span"),Qp=i("SqueezeBertForQuestionAnswering"),oa=u(),F=n("div"),z(Vs.$$.fragment),Up=u(),Me=n("p"),Vp=i(`SqueezeBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),ir=n("code"),Gp=i("span start logits"),Jp=i(" and "),lr=n("code"),Xp=i("span end logits"),Yp=i(")."),Zp=u(),Gs=n("p"),eu=i("The SqueezeBERT model was proposed in "),Js=n("a"),tu=i(`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),su=i(` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),ou=u(),Xs=n("p"),nu=i("This model inherits from "),Ao=n("a"),ru=i("PreTrainedModel"),au=i(`. 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.)`),iu=u(),Ys=n("p"),lu=i("This model is also a PyTorch "),Zs=n("a"),du=i("torch.nn.Module"),cu=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pu=u(),eo=n("p"),uu=i(`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),dr=n("em"),hu=i("squeezebert/squeezebert-mnli-headless"),mu=i(" checkpoint as a starting point."),fu=u(),z(kt.$$.fragment),gu=u(),z(zt.$$.fragment),_u=u(),oe=n("div"),z(to.$$.fragment),bu=u(),Fe=n("p"),ku=i("The "),Lo=n("a"),zu=i("SqueezeBertForQuestionAnswering"),qu=i(" forward method, overrides the "),cr=n("code"),vu=i("__call__"),$u=i(" special method."),wu=u(),z(qt.$$.fragment),yu=u(),z(vt.$$.fragment),this.h()},l(o){const b=Sm('[data-svelte="svelte-1phssyn"]',document.head);d=r(b,"META",{name:!0,content:!0}),b.forEach(s),_=h(o),m=r(o,"H1",{class:!0});var so=a(m);c=r(so,"A",{id:!0,class:!0,href:!0});var pr=a(c);f=r(pr,"SPAN",{});var ur=a(f);q(t.$$.fragment,ur),ur.forEach(s),pr.forEach(s),p=h(so),S=r(so,"SPAN",{});var hr=a(S);Qa=l(hr,"SqueezeBERT"),hr.forEach(s),so.forEach(s),xr=h(o),ue=r(o,"H2",{class:!0});var oo=a(ue);Ae=r(oo,"A",{id:!0,class:!0,href:!0});var mr=a(Ae);Yo=r(mr,"SPAN",{});var fr=a(Yo);q(jt.$$.fragment,fr),fr.forEach(s),mr.forEach(s),Ua=h(oo),Zo=r(oo,"SPAN",{});var gr=a(Zo);Va=l(gr,"Overview"),gr.forEach(s),oo.forEach(s),Mr=h(o),re=r(o,"P",{});var Ce=a(re);Ga=l(Ce,"The SqueezeBERT model was proposed in "),xt=r(Ce,"A",{href:!0,rel:!0});var _r=a(xt);Ja=l(_r,"SqueezeBERT: What can computer vision teach NLP about efficient neural networks?"),_r.forEach(s),Xa=l(Ce,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, Kurt W. Keutzer. It\u2019s a
bidirectional transformer similar to the BERT model. The key difference between the BERT architecture and the
SqueezeBERT architecture is that SqueezeBERT uses `),Mt=r(Ce,"A",{href:!0,rel:!0});var br=a(Mt);Ya=l(br,"grouped convolutions"),br.forEach(s),Za=l(Ce,`
instead of fully-connected layers for the Q, K, V and FFN layers.`),Ce.forEach(s),Fr=h(o),io=r(o,"P",{});var kr=a(io);ei=l(kr,"The abstract from the paper is the following:"),kr.forEach(s),Cr=h(o),lo=r(o,"P",{});var zr=a(lo);en=r(zr,"EM",{});var qr=a(en);ti=l(qr,`Humans read and write hundreds of billions of messages every day. Further, due to the availability of large datasets,
large computing systems, and better neural network models, natural language processing (NLP) technology has made
significant strides in understanding, proofreading, and organizing these messages. Thus, there is a significant
opportunity to deploy NLP in myriad applications to help web users, social networks, and businesses. In particular, we
consider smartphones and other mobile devices as crucial platforms for deploying NLP models at scale. However, today\u2019s
highly-accurate NLP neural network models such as BERT and RoBERTa are extremely computationally expensive, with
BERT-base taking 1.7 seconds to classify a text snippet on a Pixel 3 smartphone. In this work, we observe that methods
such as grouped convolutions have yielded significant speedups for computer vision networks, but many of these
techniques have not been adopted by NLP neural network designers. We demonstrate how to replace several operations in
self-attention layers with grouped convolutions, and we use this technique in a novel network architecture called
SqueezeBERT, which runs 4.3x faster than BERT-base on the Pixel 3 while achieving competitive accuracy on the GLUE test
set. The SqueezeBERT code will be released.`),qr.forEach(s),zr.forEach(s),Pr=h(o),co=r(o,"P",{});var vr=a(co);si=l(vr,"Tips:"),vr.forEach(s),Ar=h(o),ae=r(o,"UL",{});var Pe=a(ae);tn=r(Pe,"LI",{});var $r=a(tn);oi=l($r,`SqueezeBERT is a model with absolute position embeddings so it\u2019s usually advised to pad the inputs on the right
rather than the left.`),$r.forEach(s),ni=h(Pe),sn=r(Pe,"LI",{});var wr=a(sn);ri=l(wr,`SqueezeBERT is similar to BERT and therefore relies on the masked language modeling (MLM) objective. It is therefore
efficient at predicting masked tokens and at NLU in general, but is not optimal for text generation. Models trained
with a causal language modeling (CLM) objective are better in that regard.`),wr.forEach(s),ai=h(Pe),Ft=r(Pe,"LI",{});var no=a(Ft);ii=l(no,`For best results when finetuning on sequence classification tasks, it is recommended to start with the
`),on=r(no,"EM",{});var yr=a(on);li=l(yr,"squeezebert/squeezebert-mnli-headless"),yr.forEach(s),di=l(no," checkpoint."),no.forEach(s),Pe.forEach(s),Lr=h(o),Le=r(o,"P",{});var ro=a(Le);ci=l(ro,"This model was contributed by "),Ct=r(ro,"A",{href:!0,rel:!0});var Tr=a(Ct);pi=l(Tr,"forresti"),Tr.forEach(s),ui=l(ro,"."),ro.forEach(s),Ir=h(o),he=r(o,"H2",{class:!0});var ao=a(he);Ie=r(ao,"A",{id:!0,class:!0,href:!0});var Sr=a(Ie);nn=r(Sr,"SPAN",{});var Br=a(nn);q(Pt.$$.fragment,Br),Br.forEach(s),Sr.forEach(s),hi=h(ao),rn=r(ao,"SPAN",{});var Er=a(rn);mi=l(Er,"Documentation resources"),Er.forEach(s),ao.forEach(s),Nr=h(o),U=r(o,"UL",{});var J=a(U);an=r(J,"LI",{});var jr=a(an);po=r(jr,"A",{href:!0});var ju=a(po);fi=l(ju,"Text classification task guide"),ju.forEach(s),jr.forEach(s),gi=h(J),ln=r(J,"LI",{});var xu=a(ln);uo=r(xu,"A",{href:!0});var Mu=a(uo);_i=l(Mu,"Token classification task guide"),Mu.forEach(s),xu.forEach(s),bi=h(J),dn=r(J,"LI",{});var Fu=a(dn);ho=r(Fu,"A",{href:!0});var Cu=a(ho);ki=l(Cu,"Question answering task guide"),Cu.forEach(s),Fu.forEach(s),zi=h(J),cn=r(J,"LI",{});var Pu=a(cn);mo=r(Pu,"A",{href:!0});var Au=a(mo);qi=l(Au,"Masked language modeling task guide"),Au.forEach(s),Pu.forEach(s),vi=h(J),pn=r(J,"LI",{});var Lu=a(pn);fo=r(Lu,"A",{href:!0});var Iu=a(fo);$i=l(Iu,"Multiple choice task guide"),Iu.forEach(s),Lu.forEach(s),J.forEach(s),Dr=h(o),me=r(o,"H2",{class:!0});var ra=a(me);Ne=r(ra,"A",{id:!0,class:!0,href:!0});var Nu=a(Ne);un=r(Nu,"SPAN",{});var Du=a(un);q(At.$$.fragment,Du),Du.forEach(s),Nu.forEach(s),wi=h(ra),hn=r(ra,"SPAN",{});var Ou=a(hn);yi=l(Ou,"SqueezeBertConfig"),Ou.forEach(s),ra.forEach(s),Or=h(o),H=r(o,"DIV",{class:!0});var de=a(H);q(Lt.$$.fragment,de),Ti=h(de),fe=r(de,"P",{});var Io=a(fe);Si=l(Io,"This is the configuration class to store the configuration of a "),go=r(Io,"A",{href:!0});var Ru=a(go);Bi=l(Ru,"SqueezeBertModel"),Ru.forEach(s),Ei=l(Io,`. It is used to instantiate a
SqueezeBERT 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 SqueezeBERT
`),It=r(Io,"A",{href:!0,rel:!0});var Wu=a(It);ji=l(Wu,"squeezebert/squeezebert-uncased"),Wu.forEach(s),xi=l(Io," architecture."),Io.forEach(s),Mi=h(de),ge=r(de,"P",{});var No=a(ge);Fi=l(No,"Configuration objects inherit from "),_o=r(No,"A",{href:!0});var Ku=a(_o);Ci=l(Ku,"PretrainedConfig"),Ku.forEach(s),Pi=l(No,` and can be used to control the model outputs. Read the
documentation from `),bo=r(No,"A",{href:!0});var Hu=a(bo);Ai=l(Hu,"PretrainedConfig"),Hu.forEach(s),Li=l(No," for more information."),No.forEach(s),Ii=h(de),q(De.$$.fragment,de),Ni=h(de),mn=r(de,"P",{});var Qu=a(mn);Di=l(Qu,`Attributes: pretrained_config_archive_map (Dict[str, str]): A dictionary containing all the available pre-trained
checkpoints.`),Qu.forEach(s),de.forEach(s),Rr=h(o),_e=r(o,"H2",{class:!0});var aa=a(_e);Oe=r(aa,"A",{id:!0,class:!0,href:!0});var Uu=a(Oe);fn=r(Uu,"SPAN",{});var Vu=a(fn);q(Nt.$$.fragment,Vu),Vu.forEach(s),Uu.forEach(s),Oi=h(aa),gn=r(aa,"SPAN",{});var Gu=a(gn);Ri=l(Gu,"SqueezeBertTokenizer"),Gu.forEach(s),aa.forEach(s),Wr=h(o),I=r(o,"DIV",{class:!0});var G=a(I);q(Dt.$$.fragment,G),Wi=h(G),_n=r(G,"P",{});var Ju=a(_n);Ki=l(Ju,"Construct a SqueezeBERT tokenizer. Based on WordPiece."),Ju.forEach(s),Hi=h(G),Ot=r(G,"P",{});var ia=a(Ot);Qi=l(ia,"This tokenizer inherits from "),ko=r(ia,"A",{href:!0});var Xu=a(ko);Ui=l(Xu,"PreTrainedTokenizer"),Xu.forEach(s),Vi=l(ia,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),ia.forEach(s),Gi=h(G),ie=r(G,"DIV",{class:!0});var Do=a(ie);q(Rt.$$.fragment,Do),Ji=h(Do),bn=r(Do,"P",{});var Yu=a(bn);Xi=l(Yu,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A SqueezeBERT sequence has the following format:`),Yu.forEach(s),Yi=h(Do),Wt=r(Do,"UL",{});var la=a(Wt);zo=r(la,"LI",{});var Tu=a(zo);Zi=l(Tu,"single sequence: "),kn=r(Tu,"CODE",{});var Zu=a(kn);el=l(Zu,"[CLS] X [SEP]"),Zu.forEach(s),Tu.forEach(s),tl=h(la),qo=r(la,"LI",{});var Su=a(qo);sl=l(Su,"pair of sequences: "),zn=r(Su,"CODE",{});var eh=a(zn);ol=l(eh,"[CLS] A [SEP] B [SEP]"),eh.forEach(s),Su.forEach(s),la.forEach(s),Do.forEach(s),nl=h(G),Re=r(G,"DIV",{class:!0});var da=a(Re);q(Kt.$$.fragment,da),rl=h(da),Ht=r(da,"P",{});var ca=a(Ht);al=l(ca,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),qn=r(ca,"CODE",{});var th=a(qn);il=l(th,"prepare_for_model"),th.forEach(s),ll=l(ca," method."),ca.forEach(s),da.forEach(s),dl=h(G),X=r(G,"DIV",{class:!0});var $t=a(X);q(Qt.$$.fragment,$t),cl=h($t),vn=r($t,"P",{});var sh=a(vn);pl=l(sh,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A SqueezeBERT"),sh.forEach(s),ul=h($t),q(We.$$.fragment,$t),hl=h($t),be=r($t,"P",{});var Oo=a(be);ml=l(Oo,"If "),$n=r(Oo,"CODE",{});var oh=a($n);fl=l(oh,"token_ids_1"),oh.forEach(s),gl=l(Oo," is "),wn=r(Oo,"CODE",{});var nh=a(wn);_l=l(nh,"None"),nh.forEach(s),bl=l(Oo,", this method only returns the first portion of the mask (0s)."),Oo.forEach(s),$t.forEach(s),kl=h(G),vo=r(G,"DIV",{class:!0});var rh=a(vo);q(Ut.$$.fragment,rh),rh.forEach(s),G.forEach(s),Kr=h(o),ke=r(o,"H2",{class:!0});var pa=a(ke);Ke=r(pa,"A",{id:!0,class:!0,href:!0});var ah=a(Ke);yn=r(ah,"SPAN",{});var ih=a(yn);q(Vt.$$.fragment,ih),ih.forEach(s),ah.forEach(s),zl=h(pa),Tn=r(pa,"SPAN",{});var lh=a(Tn);ql=l(lh,"SqueezeBertTokenizerFast"),lh.forEach(s),pa.forEach(s),Hr=h(o),Q=r(o,"DIV",{class:!0});var ce=a(Q);q(Gt.$$.fragment,ce),vl=h(ce),Jt=r(ce,"P",{});var ua=a(Jt);$l=l(ua,"Construct a \u201Cfast\u201D SqueezeBERT tokenizer (backed by HuggingFace\u2019s "),Sn=r(ua,"EM",{});var dh=a(Sn);wl=l(dh,"tokenizers"),dh.forEach(s),yl=l(ua," library). Based on WordPiece."),ua.forEach(s),Tl=h(ce),Xt=r(ce,"P",{});var ha=a(Xt);Sl=l(ha,"This tokenizer inherits from "),$o=r(ha,"A",{href:!0});var ch=a($o);Bl=l(ch,"PreTrainedTokenizerFast"),ch.forEach(s),El=l(ha,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),ha.forEach(s),jl=h(ce),le=r(ce,"DIV",{class:!0});var Ro=a(le);q(Yt.$$.fragment,Ro),xl=h(Ro),Bn=r(Ro,"P",{});var ph=a(Bn);Ml=l(ph,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A SqueezeBERT sequence has the following format:`),ph.forEach(s),Fl=h(Ro),Zt=r(Ro,"UL",{});var ma=a(Zt);wo=r(ma,"LI",{});var Bu=a(wo);Cl=l(Bu,"single sequence: "),En=r(Bu,"CODE",{});var uh=a(En);Pl=l(uh,"[CLS] X [SEP]"),uh.forEach(s),Bu.forEach(s),Al=h(ma),yo=r(ma,"LI",{});var Eu=a(yo);Ll=l(Eu,"pair of sequences: "),jn=r(Eu,"CODE",{});var hh=a(jn);Il=l(hh,"[CLS] A [SEP] B [SEP]"),hh.forEach(s),Eu.forEach(s),ma.forEach(s),Ro.forEach(s),Nl=h(ce),Y=r(ce,"DIV",{class:!0});var wt=a(Y);q(es.$$.fragment,wt),Dl=h(wt),xn=r(wt,"P",{});var mh=a(xn);Ol=l(mh,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A SqueezeBERT"),mh.forEach(s),Rl=h(wt),q(He.$$.fragment,wt),Wl=h(wt),ze=r(wt,"P",{});var Wo=a(ze);Kl=l(Wo,"If "),Mn=r(Wo,"CODE",{});var fh=a(Mn);Hl=l(fh,"token_ids_1"),fh.forEach(s),Ql=l(Wo," is "),Fn=r(Wo,"CODE",{});var gh=a(Fn);Ul=l(gh,"None"),gh.forEach(s),Vl=l(Wo,", this method only returns the first portion of the mask (0s)."),Wo.forEach(s),wt.forEach(s),ce.forEach(s),Qr=h(o),qe=r(o,"H2",{class:!0});var fa=a(qe);Qe=r(fa,"A",{id:!0,class:!0,href:!0});var _h=a(Qe);Cn=r(_h,"SPAN",{});var bh=a(Cn);q(ts.$$.fragment,bh),bh.forEach(s),_h.forEach(s),Gl=h(fa),Pn=r(fa,"SPAN",{});var kh=a(Pn);Jl=l(kh,"SqueezeBertModel"),kh.forEach(s),fa.forEach(s),Ur=h(o),B=r(o,"DIV",{class:!0});var N=a(B);q(ss.$$.fragment,N),Xl=h(N),An=r(N,"P",{});var zh=a(An);Yl=l(zh,"The bare SqueezeBERT Model transformer outputting raw hidden-states without any specific head on top."),zh.forEach(s),Zl=h(N),os=r(N,"P",{});var ga=a(os);ed=l(ga,"The SqueezeBERT model was proposed in "),ns=r(ga,"A",{href:!0,rel:!0});var qh=a(ns);td=l(qh,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),qh.forEach(s),sd=l(ga,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),ga.forEach(s),od=h(N),rs=r(N,"P",{});var _a=a(rs);nd=l(_a,"This model inherits from "),To=r(_a,"A",{href:!0});var vh=a(To);rd=l(vh,"PreTrainedModel"),vh.forEach(s),ad=l(_a,`. 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.)`),_a.forEach(s),id=h(N),as=r(N,"P",{});var ba=a(as);ld=l(ba,"This model is also a PyTorch "),is=r(ba,"A",{href:!0,rel:!0});var $h=a(is);dd=l($h,"torch.nn.Module"),$h.forEach(s),cd=l(ba,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ba.forEach(s),pd=h(N),ls=r(N,"P",{});var ka=a(ls);ud=l(ka,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Ln=r(ka,"EM",{});var wh=a(Ln);hd=l(wh,"squeezebert/squeezebert-mnli-headless"),wh.forEach(s),md=l(ka," checkpoint as a starting point."),ka.forEach(s),fd=h(N),q(Ue.$$.fragment,N),gd=h(N),q(Ve.$$.fragment,N),_d=h(N),Z=r(N,"DIV",{class:!0});var yt=a(Z);q(ds.$$.fragment,yt),bd=h(yt),ve=r(yt,"P",{});var Ko=a(ve);kd=l(Ko,"The "),So=r(Ko,"A",{href:!0});var yh=a(So);zd=l(yh,"SqueezeBertModel"),yh.forEach(s),qd=l(Ko," forward method, overrides the "),In=r(Ko,"CODE",{});var Th=a(In);vd=l(Th,"__call__"),Th.forEach(s),$d=l(Ko," special method."),Ko.forEach(s),wd=h(yt),q(Ge.$$.fragment,yt),yd=h(yt),q(Je.$$.fragment,yt),yt.forEach(s),N.forEach(s),Vr=h(o),$e=r(o,"H2",{class:!0});var za=a($e);Xe=r(za,"A",{id:!0,class:!0,href:!0});var Sh=a(Xe);Nn=r(Sh,"SPAN",{});var Bh=a(Nn);q(cs.$$.fragment,Bh),Bh.forEach(s),Sh.forEach(s),Td=h(za),Dn=r(za,"SPAN",{});var Eh=a(Dn);Sd=l(Eh,"SqueezeBertForMaskedLM"),Eh.forEach(s),za.forEach(s),Gr=h(o),E=r(o,"DIV",{class:!0});var D=a(E);q(ps.$$.fragment,D),Bd=h(D),us=r(D,"P",{});var qa=a(us);Ed=l(qa,"SqueezeBERT Model with a "),On=r(qa,"CODE",{});var jh=a(On);jd=l(jh,"language modeling"),jh.forEach(s),xd=l(qa," head on top."),qa.forEach(s),Md=h(D),hs=r(D,"P",{});var va=a(hs);Fd=l(va,"The SqueezeBERT model was proposed in "),ms=r(va,"A",{href:!0,rel:!0});var xh=a(ms);Cd=l(xh,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),xh.forEach(s),Pd=l(va,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),va.forEach(s),Ad=h(D),fs=r(D,"P",{});var $a=a(fs);Ld=l($a,"This model inherits from "),Bo=r($a,"A",{href:!0});var Mh=a(Bo);Id=l(Mh,"PreTrainedModel"),Mh.forEach(s),Nd=l($a,`. 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.)`),$a.forEach(s),Dd=h(D),gs=r(D,"P",{});var wa=a(gs);Od=l(wa,"This model is also a PyTorch "),_s=r(wa,"A",{href:!0,rel:!0});var Fh=a(_s);Rd=l(Fh,"torch.nn.Module"),Fh.forEach(s),Wd=l(wa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wa.forEach(s),Kd=h(D),bs=r(D,"P",{});var ya=a(bs);Hd=l(ya,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Rn=r(ya,"EM",{});var Ch=a(Rn);Qd=l(Ch,"squeezebert/squeezebert-mnli-headless"),Ch.forEach(s),Ud=l(ya," checkpoint as a starting point."),ya.forEach(s),Vd=h(D),q(Ye.$$.fragment,D),Gd=h(D),q(Ze.$$.fragment,D),Jd=h(D),ee=r(D,"DIV",{class:!0});var Tt=a(ee);q(ks.$$.fragment,Tt),Xd=h(Tt),we=r(Tt,"P",{});var Ho=a(we);Yd=l(Ho,"The "),Eo=r(Ho,"A",{href:!0});var Ph=a(Eo);Zd=l(Ph,"SqueezeBertForMaskedLM"),Ph.forEach(s),ec=l(Ho," forward method, overrides the "),Wn=r(Ho,"CODE",{});var Ah=a(Wn);tc=l(Ah,"__call__"),Ah.forEach(s),sc=l(Ho," special method."),Ho.forEach(s),oc=h(Tt),q(et.$$.fragment,Tt),nc=h(Tt),q(tt.$$.fragment,Tt),Tt.forEach(s),D.forEach(s),Jr=h(o),ye=r(o,"H2",{class:!0});var Ta=a(ye);st=r(Ta,"A",{id:!0,class:!0,href:!0});var Lh=a(st);Kn=r(Lh,"SPAN",{});var Ih=a(Kn);q(zs.$$.fragment,Ih),Ih.forEach(s),Lh.forEach(s),rc=h(Ta),Hn=r(Ta,"SPAN",{});var Nh=a(Hn);ac=l(Nh,"SqueezeBertForSequenceClassification"),Nh.forEach(s),Ta.forEach(s),Xr=h(o),j=r(o,"DIV",{class:!0});var O=a(j);q(qs.$$.fragment,O),ic=h(O),Qn=r(O,"P",{});var Dh=a(Qn);lc=l(Dh,`SqueezeBERT Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Dh.forEach(s),dc=h(O),vs=r(O,"P",{});var Sa=a(vs);cc=l(Sa,"The SqueezeBERT model was proposed in "),$s=r(Sa,"A",{href:!0,rel:!0});var Oh=a($s);pc=l(Oh,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Oh.forEach(s),uc=l(Sa,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Sa.forEach(s),hc=h(O),ws=r(O,"P",{});var Ba=a(ws);mc=l(Ba,"This model inherits from "),jo=r(Ba,"A",{href:!0});var Rh=a(jo);fc=l(Rh,"PreTrainedModel"),Rh.forEach(s),gc=l(Ba,`. 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.)`),Ba.forEach(s),_c=h(O),ys=r(O,"P",{});var Ea=a(ys);bc=l(Ea,"This model is also a PyTorch "),Ts=r(Ea,"A",{href:!0,rel:!0});var Wh=a(Ts);kc=l(Wh,"torch.nn.Module"),Wh.forEach(s),zc=l(Ea,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ea.forEach(s),qc=h(O),Ss=r(O,"P",{});var ja=a(Ss);vc=l(ja,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Un=r(ja,"EM",{});var Kh=a(Un);$c=l(Kh,"squeezebert/squeezebert-mnli-headless"),Kh.forEach(s),wc=l(ja," checkpoint as a starting point."),ja.forEach(s),yc=h(O),q(ot.$$.fragment,O),Tc=h(O),q(nt.$$.fragment,O),Sc=h(O),V=r(O,"DIV",{class:!0});var pe=a(V);q(Bs.$$.fragment,pe),Bc=h(pe),Te=r(pe,"P",{});var Qo=a(Te);Ec=l(Qo,"The "),xo=r(Qo,"A",{href:!0});var Hh=a(xo);jc=l(Hh,"SqueezeBertForSequenceClassification"),Hh.forEach(s),xc=l(Qo," forward method, overrides the "),Vn=r(Qo,"CODE",{});var Qh=a(Vn);Mc=l(Qh,"__call__"),Qh.forEach(s),Fc=l(Qo," special method."),Qo.forEach(s),Cc=h(pe),q(rt.$$.fragment,pe),Pc=h(pe),q(at.$$.fragment,pe),Ac=h(pe),q(it.$$.fragment,pe),pe.forEach(s),O.forEach(s),Yr=h(o),Se=r(o,"H2",{class:!0});var xa=a(Se);lt=r(xa,"A",{id:!0,class:!0,href:!0});var Uh=a(lt);Gn=r(Uh,"SPAN",{});var Vh=a(Gn);q(Es.$$.fragment,Vh),Vh.forEach(s),Uh.forEach(s),Lc=h(xa),Jn=r(xa,"SPAN",{});var Gh=a(Jn);Ic=l(Gh,"SqueezeBertForMultipleChoice"),Gh.forEach(s),xa.forEach(s),Zr=h(o),x=r(o,"DIV",{class:!0});var R=a(x);q(js.$$.fragment,R),Nc=h(R),Xn=r(R,"P",{});var Jh=a(Xn);Dc=l(Jh,`SqueezeBERT Model with a multiple choice classification head on top (a linear layer on top of the pooled output and
a softmax) e.g. for RocStories/SWAG tasks.`),Jh.forEach(s),Oc=h(R),xs=r(R,"P",{});var Ma=a(xs);Rc=l(Ma,"The SqueezeBERT model was proposed in "),Ms=r(Ma,"A",{href:!0,rel:!0});var Xh=a(Ms);Wc=l(Xh,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),Xh.forEach(s),Kc=l(Ma,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Ma.forEach(s),Hc=h(R),Fs=r(R,"P",{});var Fa=a(Fs);Qc=l(Fa,"This model inherits from "),Mo=r(Fa,"A",{href:!0});var Yh=a(Mo);Uc=l(Yh,"PreTrainedModel"),Yh.forEach(s),Vc=l(Fa,`. 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.)`),Fa.forEach(s),Gc=h(R),Cs=r(R,"P",{});var Ca=a(Cs);Jc=l(Ca,"This model is also a PyTorch "),Ps=r(Ca,"A",{href:!0,rel:!0});var Zh=a(Ps);Xc=l(Zh,"torch.nn.Module"),Zh.forEach(s),Yc=l(Ca,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ca.forEach(s),Zc=h(R),As=r(R,"P",{});var Pa=a(As);ep=l(Pa,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),Yn=r(Pa,"EM",{});var em=a(Yn);tp=l(em,"squeezebert/squeezebert-mnli-headless"),em.forEach(s),sp=l(Pa," checkpoint as a starting point."),Pa.forEach(s),op=h(R),q(dt.$$.fragment,R),np=h(R),q(ct.$$.fragment,R),rp=h(R),te=r(R,"DIV",{class:!0});var St=a(te);q(Ls.$$.fragment,St),ap=h(St),Be=r(St,"P",{});var Uo=a(Be);ip=l(Uo,"The "),Fo=r(Uo,"A",{href:!0});var tm=a(Fo);lp=l(tm,"SqueezeBertForMultipleChoice"),tm.forEach(s),dp=l(Uo," forward method, overrides the "),Zn=r(Uo,"CODE",{});var sm=a(Zn);cp=l(sm,"__call__"),sm.forEach(s),pp=l(Uo," special method."),Uo.forEach(s),up=h(St),q(pt.$$.fragment,St),hp=h(St),q(ut.$$.fragment,St),St.forEach(s),R.forEach(s),ea=h(o),Ee=r(o,"H2",{class:!0});var Aa=a(Ee);ht=r(Aa,"A",{id:!0,class:!0,href:!0});var om=a(ht);er=r(om,"SPAN",{});var nm=a(er);q(Is.$$.fragment,nm),nm.forEach(s),om.forEach(s),mp=h(Aa),tr=r(Aa,"SPAN",{});var rm=a(tr);fp=l(rm,"SqueezeBertForTokenClassification"),rm.forEach(s),Aa.forEach(s),ta=h(o),M=r(o,"DIV",{class:!0});var W=a(M);q(Ns.$$.fragment,W),gp=h(W),sr=r(W,"P",{});var am=a(sr);_p=l(am,`SqueezeBERT Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g.
for Named-Entity-Recognition (NER) tasks.`),am.forEach(s),bp=h(W),Ds=r(W,"P",{});var La=a(Ds);kp=l(La,"The SqueezeBERT model was proposed in "),Os=r(La,"A",{href:!0,rel:!0});var im=a(Os);zp=l(im,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),im.forEach(s),qp=l(La,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),La.forEach(s),vp=h(W),Rs=r(W,"P",{});var Ia=a(Rs);$p=l(Ia,"This model inherits from "),Co=r(Ia,"A",{href:!0});var lm=a(Co);wp=l(lm,"PreTrainedModel"),lm.forEach(s),yp=l(Ia,`. 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.)`),Ia.forEach(s),Tp=h(W),Ws=r(W,"P",{});var Na=a(Ws);Sp=l(Na,"This model is also a PyTorch "),Ks=r(Na,"A",{href:!0,rel:!0});var dm=a(Ks);Bp=l(dm,"torch.nn.Module"),dm.forEach(s),Ep=l(Na,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Na.forEach(s),jp=h(W),Hs=r(W,"P",{});var Da=a(Hs);xp=l(Da,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),or=r(Da,"EM",{});var cm=a(or);Mp=l(cm,"squeezebert/squeezebert-mnli-headless"),cm.forEach(s),Fp=l(Da," checkpoint as a starting point."),Da.forEach(s),Cp=h(W),q(mt.$$.fragment,W),Pp=h(W),q(ft.$$.fragment,W),Ap=h(W),se=r(W,"DIV",{class:!0});var Bt=a(se);q(Qs.$$.fragment,Bt),Lp=h(Bt),je=r(Bt,"P",{});var Vo=a(je);Ip=l(Vo,"The "),Po=r(Vo,"A",{href:!0});var pm=a(Po);Np=l(pm,"SqueezeBertForTokenClassification"),pm.forEach(s),Dp=l(Vo," forward method, overrides the "),nr=r(Vo,"CODE",{});var um=a(nr);Op=l(um,"__call__"),um.forEach(s),Rp=l(Vo," special method."),Vo.forEach(s),Wp=h(Bt),q(gt.$$.fragment,Bt),Kp=h(Bt),q(_t.$$.fragment,Bt),Bt.forEach(s),W.forEach(s),sa=h(o),xe=r(o,"H2",{class:!0});var Oa=a(xe);bt=r(Oa,"A",{id:!0,class:!0,href:!0});var hm=a(bt);rr=r(hm,"SPAN",{});var mm=a(rr);q(Us.$$.fragment,mm),mm.forEach(s),hm.forEach(s),Hp=h(Oa),ar=r(Oa,"SPAN",{});var fm=a(ar);Qp=l(fm,"SqueezeBertForQuestionAnswering"),fm.forEach(s),Oa.forEach(s),oa=h(o),F=r(o,"DIV",{class:!0});var K=a(F);q(Vs.$$.fragment,K),Up=h(K),Me=r(K,"P",{});var Go=a(Me);Vp=l(Go,`SqueezeBERT Model with a span classification head on top for extractive question-answering tasks like SQuAD (a
linear layers on top of the hidden-states output to compute `),ir=r(Go,"CODE",{});var gm=a(ir);Gp=l(gm,"span start logits"),gm.forEach(s),Jp=l(Go," and "),lr=r(Go,"CODE",{});var _m=a(lr);Xp=l(_m,"span end logits"),_m.forEach(s),Yp=l(Go,")."),Go.forEach(s),Zp=h(K),Gs=r(K,"P",{});var Ra=a(Gs);eu=l(Ra,"The SqueezeBERT model was proposed in "),Js=r(Ra,"A",{href:!0,rel:!0});var bm=a(Js);tu=l(bm,`SqueezeBERT: What can computer vision teach NLP about efficient neural
networks?`),bm.forEach(s),su=l(Ra,` by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W.
Keutzer`),Ra.forEach(s),ou=h(K),Xs=r(K,"P",{});var Wa=a(Xs);nu=l(Wa,"This model inherits from "),Ao=r(Wa,"A",{href:!0});var km=a(Ao);ru=l(km,"PreTrainedModel"),km.forEach(s),au=l(Wa,`. 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.)`),Wa.forEach(s),iu=h(K),Ys=r(K,"P",{});var Ka=a(Ys);lu=l(Ka,"This model is also a PyTorch "),Zs=r(Ka,"A",{href:!0,rel:!0});var zm=a(Zs);du=l(zm,"torch.nn.Module"),zm.forEach(s),cu=l(Ka,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ka.forEach(s),pu=h(K),eo=r(K,"P",{});var Ha=a(eo);uu=l(Ha,`For best results finetuning SqueezeBERT on text classification tasks, it is recommended to use the
`),dr=r(Ha,"EM",{});var qm=a(dr);hu=l(qm,"squeezebert/squeezebert-mnli-headless"),qm.forEach(s),mu=l(Ha," checkpoint as a starting point."),Ha.forEach(s),fu=h(K),q(kt.$$.fragment,K),gu=h(K),q(zt.$$.fragment,K),_u=h(K),oe=r(K,"DIV",{class:!0});var Et=a(oe);q(to.$$.fragment,Et),bu=h(Et),Fe=r(Et,"P",{});var Jo=a(Fe);ku=l(Jo,"The "),Lo=r(Jo,"A",{href:!0});var vm=a(Lo);zu=l(vm,"SqueezeBertForQuestionAnswering"),vm.forEach(s),qu=l(Jo," forward method, overrides the "),cr=r(Jo,"CODE",{});var $m=a(cr);vu=l($m,"__call__"),$m.forEach(s),$u=l(Jo," special method."),Jo.forEach(s),wu=h(Et),q(qt.$$.fragment,Et),yu=h(Et),q(vt.$$.fragment,Et),Et.forEach(s),K.forEach(s),this.h()},h(){g(d,"name","hf:doc:metadata"),g(d,"content",JSON.stringify(nf)),g(c,"id","squeezebert"),g(c,"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"),g(c,"href","#squeezebert"),g(m,"class","relative group"),g(Ae,"id","overview"),g(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(Ae,"href","#overview"),g(ue,"class","relative group"),g(xt,"href","https://arxiv.org/abs/2006.11316"),g(xt,"rel","nofollow"),g(Mt,"href","https://blog.yani.io/filter-group-tutorial"),g(Mt,"rel","nofollow"),g(Ct,"href","https://huggingface.co/forresti"),g(Ct,"rel","nofollow"),g(Ie,"id","documentation-resources"),g(Ie,"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"),g(Ie,"href","#documentation-resources"),g(he,"class","relative group"),g(po,"href","../tasks/sequence_classification"),g(uo,"href","../tasks/token_classification"),g(ho,"href","../tasks/question_answering"),g(mo,"href","../tasks/masked_language_modeling"),g(fo,"href","../tasks/multiple_choice"),g(Ne,"id","transformers.SqueezeBertConfig"),g(Ne,"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"),g(Ne,"href","#transformers.SqueezeBertConfig"),g(me,"class","relative group"),g(go,"href","/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertModel"),g(It,"href","https://huggingface.co/squeezebert/squeezebert-uncased"),g(It,"rel","nofollow"),g(_o,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),g(bo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),g(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Oe,"id","transformers.SqueezeBertTokenizer"),g(Oe,"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"),g(Oe,"href","#transformers.SqueezeBertTokenizer"),g(_e,"class","relative group"),g(ko,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),g(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ke,"id","transformers.SqueezeBertTokenizerFast"),g(Ke,"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"),g(Ke,"href","#transformers.SqueezeBertTokenizerFast"),g(ke,"class","relative group"),g($o,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),g(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Qe,"id","transformers.SqueezeBertModel"),g(Qe,"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"),g(Qe,"href","#transformers.SqueezeBertModel"),g(qe,"class","relative group"),g(ns,"href","https://arxiv.org/abs/2006.11316"),g(ns,"rel","nofollow"),g(To,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),g(is,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(is,"rel","nofollow"),g(So,"href","/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertModel"),g(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Xe,"id","transformers.SqueezeBertForMaskedLM"),g(Xe,"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"),g(Xe,"href","#transformers.SqueezeBertForMaskedLM"),g($e,"class","relative group"),g(ms,"href","https://arxiv.org/abs/2006.11316"),g(ms,"rel","nofollow"),g(Bo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),g(_s,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(_s,"rel","nofollow"),g(Eo,"href","/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertForMaskedLM"),g(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(st,"id","transformers.SqueezeBertForSequenceClassification"),g(st,"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"),g(st,"href","#transformers.SqueezeBertForSequenceClassification"),g(ye,"class","relative group"),g($s,"href","https://arxiv.org/abs/2006.11316"),g($s,"rel","nofollow"),g(jo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),g(Ts,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Ts,"rel","nofollow"),g(xo,"href","/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertForSequenceClassification"),g(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(lt,"id","transformers.SqueezeBertForMultipleChoice"),g(lt,"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"),g(lt,"href","#transformers.SqueezeBertForMultipleChoice"),g(Se,"class","relative group"),g(Ms,"href","https://arxiv.org/abs/2006.11316"),g(Ms,"rel","nofollow"),g(Mo,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),g(Ps,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Ps,"rel","nofollow"),g(Fo,"href","/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertForMultipleChoice"),g(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ht,"id","transformers.SqueezeBertForTokenClassification"),g(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"),g(ht,"href","#transformers.SqueezeBertForTokenClassification"),g(Ee,"class","relative group"),g(Os,"href","https://arxiv.org/abs/2006.11316"),g(Os,"rel","nofollow"),g(Co,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),g(Ks,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Ks,"rel","nofollow"),g(Po,"href","/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertForTokenClassification"),g(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(bt,"id","transformers.SqueezeBertForQuestionAnswering"),g(bt,"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"),g(bt,"href","#transformers.SqueezeBertForQuestionAnswering"),g(xe,"class","relative group"),g(Js,"href","https://arxiv.org/abs/2006.11316"),g(Js,"rel","nofollow"),g(Ao,"href","/docs/transformers/v4.29.0/en/main_classes/model#transformers.PreTrainedModel"),g(Zs,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),g(Zs,"rel","nofollow"),g(Lo,"href","/docs/transformers/v4.29.0/en/model_doc/squeezebert#transformers.SqueezeBertForQuestionAnswering"),g(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(F,"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,b){e(document.head,d),k(o,_,b),k(o,m,b),e(m,c),e(c,f),v(t,f,null),e(m,p),e(m,S),e(S,Qa),k(o,xr,b),k(o,ue,b),e(ue,Ae),e(Ae,Yo),v(jt,Yo,null),e(ue,Ua),e(ue,Zo),e(Zo,Va),k(o,Mr,b),k(o,re,b),e(re,Ga),e(re,xt),e(xt,Ja),e(re,Xa),e(re,Mt),e(Mt,Ya),e(re,Za),k(o,Fr,b),k(o,io,b),e(io,ei),k(o,Cr,b),k(o,lo,b),e(lo,en),e(en,ti),k(o,Pr,b),k(o,co,b),e(co,si),k(o,Ar,b),k(o,ae,b),e(ae,tn),e(tn,oi),e(ae,ni),e(ae,sn),e(sn,ri),e(ae,ai),e(ae,Ft),e(Ft,ii),e(Ft,on),e(on,li),e(Ft,di),k(o,Lr,b),k(o,Le,b),e(Le,ci),e(Le,Ct),e(Ct,pi),e(Le,ui),k(o,Ir,b),k(o,he,b),e(he,Ie),e(Ie,nn),v(Pt,nn,null),e(he,hi),e(he,rn),e(rn,mi),k(o,Nr,b),k(o,U,b),e(U,an),e(an,po),e(po,fi),e(U,gi),e(U,ln),e(ln,uo),e(uo,_i),e(U,bi),e(U,dn),e(dn,ho),e(ho,ki),e(U,zi),e(U,cn),e(cn,mo),e(mo,qi),e(U,vi),e(U,pn),e(pn,fo),e(fo,$i),k(o,Dr,b),k(o,me,b),e(me,Ne),e(Ne,un),v(At,un,null),e(me,wi),e(me,hn),e(hn,yi),k(o,Or,b),k(o,H,b),v(Lt,H,null),e(H,Ti),e(H,fe),e(fe,Si),e(fe,go),e(go,Bi),e(fe,Ei),e(fe,It),e(It,ji),e(fe,xi),e(H,Mi),e(H,ge),e(ge,Fi),e(ge,_o),e(_o,Ci),e(ge,Pi),e(ge,bo),e(bo,Ai),e(ge,Li),e(H,Ii),v(De,H,null),e(H,Ni),e(H,mn),e(mn,Di),k(o,Rr,b),k(o,_e,b),e(_e,Oe),e(Oe,fn),v(Nt,fn,null),e(_e,Oi),e(_e,gn),e(gn,Ri),k(o,Wr,b),k(o,I,b),v(Dt,I,null),e(I,Wi),e(I,_n),e(_n,Ki),e(I,Hi),e(I,Ot),e(Ot,Qi),e(Ot,ko),e(ko,Ui),e(Ot,Vi),e(I,Gi),e(I,ie),v(Rt,ie,null),e(ie,Ji),e(ie,bn),e(bn,Xi),e(ie,Yi),e(ie,Wt),e(Wt,zo),e(zo,Zi),e(zo,kn),e(kn,el),e(Wt,tl),e(Wt,qo),e(qo,sl),e(qo,zn),e(zn,ol),e(I,nl),e(I,Re),v(Kt,Re,null),e(Re,rl),e(Re,Ht),e(Ht,al),e(Ht,qn),e(qn,il),e(Ht,ll),e(I,dl),e(I,X),v(Qt,X,null),e(X,cl),e(X,vn),e(vn,pl),e(X,ul),v(We,X,null),e(X,hl),e(X,be),e(be,ml),e(be,$n),e($n,fl),e(be,gl),e(be,wn),e(wn,_l),e(be,bl),e(I,kl),e(I,vo),v(Ut,vo,null),k(o,Kr,b),k(o,ke,b),e(ke,Ke),e(Ke,yn),v(Vt,yn,null),e(ke,zl),e(ke,Tn),e(Tn,ql),k(o,Hr,b),k(o,Q,b),v(Gt,Q,null),e(Q,vl),e(Q,Jt),e(Jt,$l),e(Jt,Sn),e(Sn,wl),e(Jt,yl),e(Q,Tl),e(Q,Xt),e(Xt,Sl),e(Xt,$o),e($o,Bl),e(Xt,El),e(Q,jl),e(Q,le),v(Yt,le,null),e(le,xl),e(le,Bn),e(Bn,Ml),e(le,Fl),e(le,Zt),e(Zt,wo),e(wo,Cl),e(wo,En),e(En,Pl),e(Zt,Al),e(Zt,yo),e(yo,Ll),e(yo,jn),e(jn,Il),e(Q,Nl),e(Q,Y),v(es,Y,null),e(Y,Dl),e(Y,xn),e(xn,Ol),e(Y,Rl),v(He,Y,null),e(Y,Wl),e(Y,ze),e(ze,Kl),e(ze,Mn),e(Mn,Hl),e(ze,Ql),e(ze,Fn),e(Fn,Ul),e(ze,Vl),k(o,Qr,b),k(o,qe,b),e(qe,Qe),e(Qe,Cn),v(ts,Cn,null),e(qe,Gl),e(qe,Pn),e(Pn,Jl),k(o,Ur,b),k(o,B,b),v(ss,B,null),e(B,Xl),e(B,An),e(An,Yl),e(B,Zl),e(B,os),e(os,ed),e(os,ns),e(ns,td),e(os,sd),e(B,od),e(B,rs),e(rs,nd),e(rs,To),e(To,rd),e(rs,ad),e(B,id),e(B,as),e(as,ld),e(as,is),e(is,dd),e(as,cd),e(B,pd),e(B,ls),e(ls,ud),e(ls,Ln),e(Ln,hd),e(ls,md),e(B,fd),v(Ue,B,null),e(B,gd),v(Ve,B,null),e(B,_d),e(B,Z),v(ds,Z,null),e(Z,bd),e(Z,ve),e(ve,kd),e(ve,So),e(So,zd),e(ve,qd),e(ve,In),e(In,vd),e(ve,$d),e(Z,wd),v(Ge,Z,null),e(Z,yd),v(Je,Z,null),k(o,Vr,b),k(o,$e,b),e($e,Xe),e(Xe,Nn),v(cs,Nn,null),e($e,Td),e($e,Dn),e(Dn,Sd),k(o,Gr,b),k(o,E,b),v(ps,E,null),e(E,Bd),e(E,us),e(us,Ed),e(us,On),e(On,jd),e(us,xd),e(E,Md),e(E,hs),e(hs,Fd),e(hs,ms),e(ms,Cd),e(hs,Pd),e(E,Ad),e(E,fs),e(fs,Ld),e(fs,Bo),e(Bo,Id),e(fs,Nd),e(E,Dd),e(E,gs),e(gs,Od),e(gs,_s),e(_s,Rd),e(gs,Wd),e(E,Kd),e(E,bs),e(bs,Hd),e(bs,Rn),e(Rn,Qd),e(bs,Ud),e(E,Vd),v(Ye,E,null),e(E,Gd),v(Ze,E,null),e(E,Jd),e(E,ee),v(ks,ee,null),e(ee,Xd),e(ee,we),e(we,Yd),e(we,Eo),e(Eo,Zd),e(we,ec),e(we,Wn),e(Wn,tc),e(we,sc),e(ee,oc),v(et,ee,null),e(ee,nc),v(tt,ee,null),k(o,Jr,b),k(o,ye,b),e(ye,st),e(st,Kn),v(zs,Kn,null),e(ye,rc),e(ye,Hn),e(Hn,ac),k(o,Xr,b),k(o,j,b),v(qs,j,null),e(j,ic),e(j,Qn),e(Qn,lc),e(j,dc),e(j,vs),e(vs,cc),e(vs,$s),e($s,pc),e(vs,uc),e(j,hc),e(j,ws),e(ws,mc),e(ws,jo),e(jo,fc),e(ws,gc),e(j,_c),e(j,ys),e(ys,bc),e(ys,Ts),e(Ts,kc),e(ys,zc),e(j,qc),e(j,Ss),e(Ss,vc),e(Ss,Un),e(Un,$c),e(Ss,wc),e(j,yc),v(ot,j,null),e(j,Tc),v(nt,j,null),e(j,Sc),e(j,V),v(Bs,V,null),e(V,Bc),e(V,Te),e(Te,Ec),e(Te,xo),e(xo,jc),e(Te,xc),e(Te,Vn),e(Vn,Mc),e(Te,Fc),e(V,Cc),v(rt,V,null),e(V,Pc),v(at,V,null),e(V,Ac),v(it,V,null),k(o,Yr,b),k(o,Se,b),e(Se,lt),e(lt,Gn),v(Es,Gn,null),e(Se,Lc),e(Se,Jn),e(Jn,Ic),k(o,Zr,b),k(o,x,b),v(js,x,null),e(x,Nc),e(x,Xn),e(Xn,Dc),e(x,Oc),e(x,xs),e(xs,Rc),e(xs,Ms),e(Ms,Wc),e(xs,Kc),e(x,Hc),e(x,Fs),e(Fs,Qc),e(Fs,Mo),e(Mo,Uc),e(Fs,Vc),e(x,Gc),e(x,Cs),e(Cs,Jc),e(Cs,Ps),e(Ps,Xc),e(Cs,Yc),e(x,Zc),e(x,As),e(As,ep),e(As,Yn),e(Yn,tp),e(As,sp),e(x,op),v(dt,x,null),e(x,np),v(ct,x,null),e(x,rp),e(x,te),v(Ls,te,null),e(te,ap),e(te,Be),e(Be,ip),e(Be,Fo),e(Fo,lp),e(Be,dp),e(Be,Zn),e(Zn,cp),e(Be,pp),e(te,up),v(pt,te,null),e(te,hp),v(ut,te,null),k(o,ea,b),k(o,Ee,b),e(Ee,ht),e(ht,er),v(Is,er,null),e(Ee,mp),e(Ee,tr),e(tr,fp),k(o,ta,b),k(o,M,b),v(Ns,M,null),e(M,gp),e(M,sr),e(sr,_p),e(M,bp),e(M,Ds),e(Ds,kp),e(Ds,Os),e(Os,zp),e(Ds,qp),e(M,vp),e(M,Rs),e(Rs,$p),e(Rs,Co),e(Co,wp),e(Rs,yp),e(M,Tp),e(M,Ws),e(Ws,Sp),e(Ws,Ks),e(Ks,Bp),e(Ws,Ep),e(M,jp),e(M,Hs),e(Hs,xp),e(Hs,or),e(or,Mp),e(Hs,Fp),e(M,Cp),v(mt,M,null),e(M,Pp),v(ft,M,null),e(M,Ap),e(M,se),v(Qs,se,null),e(se,Lp),e(se,je),e(je,Ip),e(je,Po),e(Po,Np),e(je,Dp),e(je,nr),e(nr,Op),e(je,Rp),e(se,Wp),v(gt,se,null),e(se,Kp),v(_t,se,null),k(o,sa,b),k(o,xe,b),e(xe,bt),e(bt,rr),v(Us,rr,null),e(xe,Hp),e(xe,ar),e(ar,Qp),k(o,oa,b),k(o,F,b),v(Vs,F,null),e(F,Up),e(F,Me),e(Me,Vp),e(Me,ir),e(ir,Gp),e(Me,Jp),e(Me,lr),e(lr,Xp),e(Me,Yp),e(F,Zp),e(F,Gs),e(Gs,eu),e(Gs,Js),e(Js,tu),e(Gs,su),e(F,ou),e(F,Xs),e(Xs,nu),e(Xs,Ao),e(Ao,ru),e(Xs,au),e(F,iu),e(F,Ys),e(Ys,lu),e(Ys,Zs),e(Zs,du),e(Ys,cu),e(F,pu),e(F,eo),e(eo,uu),e(eo,dr),e(dr,hu),e(eo,mu),e(F,fu),v(kt,F,null),e(F,gu),v(zt,F,null),e(F,_u),e(F,oe),v(to,oe,null),e(oe,bu),e(oe,Fe),e(Fe,ku),e(Fe,Lo),e(Lo,zu),e(Fe,qu),e(Fe,cr),e(cr,vu),e(Fe,$u),e(oe,wu),v(qt,oe,null),e(oe,yu),v(vt,oe,null),na=!0},p(o,[b]){const so={};b&2&&(so.$$scope={dirty:b,ctx:o}),De.$set(so);const pr={};b&2&&(pr.$$scope={dirty:b,ctx:o}),We.$set(pr);const ur={};b&2&&(ur.$$scope={dirty:b,ctx:o}),He.$set(ur);const hr={};b&2&&(hr.$$scope={dirty:b,ctx:o}),Ue.$set(hr);const oo={};b&2&&(oo.$$scope={dirty:b,ctx:o}),Ve.$set(oo);const mr={};b&2&&(mr.$$scope={dirty:b,ctx:o}),Ge.$set(mr);const fr={};b&2&&(fr.$$scope={dirty:b,ctx:o}),Je.$set(fr);const gr={};b&2&&(gr.$$scope={dirty:b,ctx:o}),Ye.$set(gr);const Ce={};b&2&&(Ce.$$scope={dirty:b,ctx:o}),Ze.$set(Ce);const _r={};b&2&&(_r.$$scope={dirty:b,ctx:o}),et.$set(_r);const br={};b&2&&(br.$$scope={dirty:b,ctx:o}),tt.$set(br);const kr={};b&2&&(kr.$$scope={dirty:b,ctx:o}),ot.$set(kr);const zr={};b&2&&(zr.$$scope={dirty:b,ctx:o}),nt.$set(zr);const qr={};b&2&&(qr.$$scope={dirty:b,ctx:o}),rt.$set(qr);const vr={};b&2&&(vr.$$scope={dirty:b,ctx:o}),at.$set(vr);const Pe={};b&2&&(Pe.$$scope={dirty:b,ctx:o}),it.$set(Pe);const $r={};b&2&&($r.$$scope={dirty:b,ctx:o}),dt.$set($r);const wr={};b&2&&(wr.$$scope={dirty:b,ctx:o}),ct.$set(wr);const no={};b&2&&(no.$$scope={dirty:b,ctx:o}),pt.$set(no);const yr={};b&2&&(yr.$$scope={dirty:b,ctx:o}),ut.$set(yr);const ro={};b&2&&(ro.$$scope={dirty:b,ctx:o}),mt.$set(ro);const Tr={};b&2&&(Tr.$$scope={dirty:b,ctx:o}),ft.$set(Tr);const ao={};b&2&&(ao.$$scope={dirty:b,ctx:o}),gt.$set(ao);const Sr={};b&2&&(Sr.$$scope={dirty:b,ctx:o}),_t.$set(Sr);const Br={};b&2&&(Br.$$scope={dirty:b,ctx:o}),kt.$set(Br);const Er={};b&2&&(Er.$$scope={dirty:b,ctx:o}),zt.$set(Er);const J={};b&2&&(J.$$scope={dirty:b,ctx:o}),qt.$set(J);const jr={};b&2&&(jr.$$scope={dirty:b,ctx:o}),vt.$set(jr)},i(o){na||($(t.$$.fragment,o),$(jt.$$.fragment,o),$(Pt.$$.fragment,o),$(At.$$.fragment,o),$(Lt.$$.fragment,o),$(De.$$.fragment,o),$(Nt.$$.fragment,o),$(Dt.$$.fragment,o),$(Rt.$$.fragment,o),$(Kt.$$.fragment,o),$(Qt.$$.fragment,o),$(We.$$.fragment,o),$(Ut.$$.fragment,o),$(Vt.$$.fragment,o),$(Gt.$$.fragment,o),$(Yt.$$.fragment,o),$(es.$$.fragment,o),$(He.$$.fragment,o),$(ts.$$.fragment,o),$(ss.$$.fragment,o),$(Ue.$$.fragment,o),$(Ve.$$.fragment,o),$(ds.$$.fragment,o),$(Ge.$$.fragment,o),$(Je.$$.fragment,o),$(cs.$$.fragment,o),$(ps.$$.fragment,o),$(Ye.$$.fragment,o),$(Ze.$$.fragment,o),$(ks.$$.fragment,o),$(et.$$.fragment,o),$(tt.$$.fragment,o),$(zs.$$.fragment,o),$(qs.$$.fragment,o),$(ot.$$.fragment,o),$(nt.$$.fragment,o),$(Bs.$$.fragment,o),$(rt.$$.fragment,o),$(at.$$.fragment,o),$(it.$$.fragment,o),$(Es.$$.fragment,o),$(js.$$.fragment,o),$(dt.$$.fragment,o),$(ct.$$.fragment,o),$(Ls.$$.fragment,o),$(pt.$$.fragment,o),$(ut.$$.fragment,o),$(Is.$$.fragment,o),$(Ns.$$.fragment,o),$(mt.$$.fragment,o),$(ft.$$.fragment,o),$(Qs.$$.fragment,o),$(gt.$$.fragment,o),$(_t.$$.fragment,o),$(Us.$$.fragment,o),$(Vs.$$.fragment,o),$(kt.$$.fragment,o),$(zt.$$.fragment,o),$(to.$$.fragment,o),$(qt.$$.fragment,o),$(vt.$$.fragment,o),na=!0)},o(o){w(t.$$.fragment,o),w(jt.$$.fragment,o),w(Pt.$$.fragment,o),w(At.$$.fragment,o),w(Lt.$$.fragment,o),w(De.$$.fragment,o),w(Nt.$$.fragment,o),w(Dt.$$.fragment,o),w(Rt.$$.fragment,o),w(Kt.$$.fragment,o),w(Qt.$$.fragment,o),w(We.$$.fragment,o),w(Ut.$$.fragment,o),w(Vt.$$.fragment,o),w(Gt.$$.fragment,o),w(Yt.$$.fragment,o),w(es.$$.fragment,o),w(He.$$.fragment,o),w(ts.$$.fragment,o),w(ss.$$.fragment,o),w(Ue.$$.fragment,o),w(Ve.$$.fragment,o),w(ds.$$.fragment,o),w(Ge.$$.fragment,o),w(Je.$$.fragment,o),w(cs.$$.fragment,o),w(ps.$$.fragment,o),w(Ye.$$.fragment,o),w(Ze.$$.fragment,o),w(ks.$$.fragment,o),w(et.$$.fragment,o),w(tt.$$.fragment,o),w(zs.$$.fragment,o),w(qs.$$.fragment,o),w(ot.$$.fragment,o),w(nt.$$.fragment,o),w(Bs.$$.fragment,o),w(rt.$$.fragment,o),w(at.$$.fragment,o),w(it.$$.fragment,o),w(Es.$$.fragment,o),w(js.$$.fragment,o),w(dt.$$.fragment,o),w(ct.$$.fragment,o),w(Ls.$$.fragment,o),w(pt.$$.fragment,o),w(ut.$$.fragment,o),w(Is.$$.fragment,o),w(Ns.$$.fragment,o),w(mt.$$.fragment,o),w(ft.$$.fragment,o),w(Qs.$$.fragment,o),w(gt.$$.fragment,o),w(_t.$$.fragment,o),w(Us.$$.fragment,o),w(Vs.$$.fragment,o),w(kt.$$.fragment,o),w(zt.$$.fragment,o),w(to.$$.fragment,o),w(qt.$$.fragment,o),w(vt.$$.fragment,o),na=!1},d(o){s(d),o&&s(_),o&&s(m),y(t),o&&s(xr),o&&s(ue),y(jt),o&&s(Mr),o&&s(re),o&&s(Fr),o&&s(io),o&&s(Cr),o&&s(lo),o&&s(Pr),o&&s(co),o&&s(Ar),o&&s(ae),o&&s(Lr),o&&s(Le),o&&s(Ir),o&&s(he),y(Pt),o&&s(Nr),o&&s(U),o&&s(Dr),o&&s(me),y(At),o&&s(Or),o&&s(H),y(Lt),y(De),o&&s(Rr),o&&s(_e),y(Nt),o&&s(Wr),o&&s(I),y(Dt),y(Rt),y(Kt),y(Qt),y(We),y(Ut),o&&s(Kr),o&&s(ke),y(Vt),o&&s(Hr),o&&s(Q),y(Gt),y(Yt),y(es),y(He),o&&s(Qr),o&&s(qe),y(ts),o&&s(Ur),o&&s(B),y(ss),y(Ue),y(Ve),y(ds),y(Ge),y(Je),o&&s(Vr),o&&s($e),y(cs),o&&s(Gr),o&&s(E),y(ps),y(Ye),y(Ze),y(ks),y(et),y(tt),o&&s(Jr),o&&s(ye),y(zs),o&&s(Xr),o&&s(j),y(qs),y(ot),y(nt),y(Bs),y(rt),y(at),y(it),o&&s(Yr),o&&s(Se),y(Es),o&&s(Zr),o&&s(x),y(js),y(dt),y(ct),y(Ls),y(pt),y(ut),o&&s(ea),o&&s(Ee),y(Is),o&&s(ta),o&&s(M),y(Ns),y(mt),y(ft),y(Qs),y(gt),y(_t),o&&s(sa),o&&s(xe),y(Us),o&&s(oa),o&&s(F),y(Vs),y(kt),y(zt),y(to),y(qt),y(vt)}}}const nf={local:"squeezebert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.SqueezeBertConfig",title:"SqueezeBertConfig"},{local:"transformers.SqueezeBertTokenizer",title:"SqueezeBertTokenizer"},{local:"transformers.SqueezeBertTokenizerFast",title:"SqueezeBertTokenizerFast"},{local:"transformers.SqueezeBertModel",title:"SqueezeBertModel"},{local:"transformers.SqueezeBertForMaskedLM",title:"SqueezeBertForMaskedLM"},{local:"transformers.SqueezeBertForSequenceClassification",title:"SqueezeBertForSequenceClassification"},{local:"transformers.SqueezeBertForMultipleChoice",title:"SqueezeBertForMultipleChoice"},{local:"transformers.SqueezeBertForTokenClassification",title:"SqueezeBertForTokenClassification"},{local:"transformers.SqueezeBertForQuestionAnswering",title:"SqueezeBertForQuestionAnswering"}],title:"SqueezeBERT"};function rf(T){return Bm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hf extends wm{constructor(d){super();ym(this,d,rf,of,Tm,{})}}export{hf as default,nf as metadata};
