import{S as ll,i as dl,s as cl,e as n,k as f,w as v,t as i,M as pl,c as a,d as t,m as g,a as r,x as w,h as l,b as h,N as hl,G as e,g as _,y,q as $,o as T,B as Y,v as ml,L as Ke}from"../../chunks/vendor-hf-doc-builder.js";import{T as vt}from"../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Je}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as V}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ge}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ul(M){let d,k,m,p,b;return p=new Je({props:{code:`from transformers import YosoConfig, YosoModel

# Initializing a YOSO uw-madison/yoso-4096 style configuration
configuration = YosoConfig()

# Initializing a model (with random weights) from the uw-madison/yoso-4096 style configuration
model = YosoModel(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> YosoConfig, YosoModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a YOSO uw-madison/yoso-4096 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = YosoConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the uw-madison/yoso-4096 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YosoModel(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"),k=i("Example:"),m=f(),v(p.$$.fragment)},l(s){d=a(s,"P",{});var c=r(d);k=l(c,"Example:"),c.forEach(t),m=g(s),w(p.$$.fragment,s)},m(s,c){_(s,d,c),e(d,k),_(s,m,c),y(p,s,c),b=!0},p:Ke,i(s){b||($(p.$$.fragment,s),b=!0)},o(s){T(p.$$.fragment,s),b=!1},d(s){s&&t(d),s&&t(m),Y(p,s)}}}function fl(M){let d,k,m,p,b;return{c(){d=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),p=i("Module"),b=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(s){d=a(s,"P",{});var c=r(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var q=r(m);p=l(q,"Module"),q.forEach(t),b=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(s,c){_(s,d,c),e(d,k),e(d,m),e(m,p),e(d,b)},d(s){s&&t(d)}}}function gl(M){let d,k,m,p,b;return p=new Je({props:{code:`from transformers import AutoTokenizer, YosoModel
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/yoso-4096")
model = YosoModel.from_pretrained("uw-madison/yoso-4096")

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, YosoModel
<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;uw-madison/yoso-4096&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YosoModel.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&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"),k=i("Example:"),m=f(),v(p.$$.fragment)},l(s){d=a(s,"P",{});var c=r(d);k=l(c,"Example:"),c.forEach(t),m=g(s),w(p.$$.fragment,s)},m(s,c){_(s,d,c),e(d,k),_(s,m,c),y(p,s,c),b=!0},p:Ke,i(s){b||($(p.$$.fragment,s),b=!0)},o(s){T(p.$$.fragment,s),b=!1},d(s){s&&t(d),s&&t(m),Y(p,s)}}}function _l(M){let d,k,m,p,b;return{c(){d=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),p=i("Module"),b=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(s){d=a(s,"P",{});var c=r(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var q=r(m);p=l(q,"Module"),q.forEach(t),b=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(s,c){_(s,d,c),e(d,k),e(d,m),e(m,p),e(d,b)},d(s){s&&t(d)}}}function bl(M){let d,k,m,p,b;return p=new Je({props:{code:`from transformers import AutoTokenizer, YosoForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/yoso-4096")
model = YosoForMaskedLM.from_pretrained("uw-madison/yoso-4096")

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, YosoForMaskedLM
<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;uw-madison/yoso-4096&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YosoForMaskedLM.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&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"),k=i("Example:"),m=f(),v(p.$$.fragment)},l(s){d=a(s,"P",{});var c=r(d);k=l(c,"Example:"),c.forEach(t),m=g(s),w(p.$$.fragment,s)},m(s,c){_(s,d,c),e(d,k),_(s,m,c),y(p,s,c),b=!0},p:Ke,i(s){b||($(p.$$.fragment,s),b=!0)},o(s){T(p.$$.fragment,s),b=!1},d(s){s&&t(d),s&&t(m),Y(p,s)}}}function kl(M){let d,k,m,p,b;return{c(){d=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),p=i("Module"),b=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(s){d=a(s,"P",{});var c=r(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var q=r(m);p=l(q,"Module"),q.forEach(t),b=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(s,c){_(s,d,c),e(d,k),e(d,m),e(m,p),e(d,b)},d(s){s&&t(d)}}}function vl(M){let d,k,m,p,b;return p=new Je({props:{code:`import torch
from transformers import AutoTokenizer, YosoForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("uw-madison/yoso-4096")
model = YosoForSequenceClassification.from_pretrained("uw-madison/yoso-4096")

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 = YosoForSequenceClassification.from_pretrained("uw-madison/yoso-4096", 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, YosoForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YosoForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&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 = YosoForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&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"),k=i("Example of single-label classification:"),m=f(),v(p.$$.fragment)},l(s){d=a(s,"P",{});var c=r(d);k=l(c,"Example of single-label classification:"),c.forEach(t),m=g(s),w(p.$$.fragment,s)},m(s,c){_(s,d,c),e(d,k),_(s,m,c),y(p,s,c),b=!0},p:Ke,i(s){b||($(p.$$.fragment,s),b=!0)},o(s){T(p.$$.fragment,s),b=!1},d(s){s&&t(d),s&&t(m),Y(p,s)}}}function wl(M){let d,k,m,p,b;return p=new Je({props:{code:`import torch
from transformers import AutoTokenizer, YosoForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("uw-madison/yoso-4096")
model = YosoForSequenceClassification.from_pretrained("uw-madison/yoso-4096", 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 = YosoForSequenceClassification.from_pretrained(
    "uw-madison/yoso-4096", 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, YosoForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YosoForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&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 = YosoForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;uw-madison/yoso-4096&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"),k=i("Example of multi-label classification:"),m=f(),v(p.$$.fragment)},l(s){d=a(s,"P",{});var c=r(d);k=l(c,"Example of multi-label classification:"),c.forEach(t),m=g(s),w(p.$$.fragment,s)},m(s,c){_(s,d,c),e(d,k),_(s,m,c),y(p,s,c),b=!0},p:Ke,i(s){b||($(p.$$.fragment,s),b=!0)},o(s){T(p.$$.fragment,s),b=!1},d(s){s&&t(d),s&&t(m),Y(p,s)}}}function yl(M){let d,k,m,p,b;return{c(){d=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),p=i("Module"),b=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(s){d=a(s,"P",{});var c=r(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var q=r(m);p=l(q,"Module"),q.forEach(t),b=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(s,c){_(s,d,c),e(d,k),e(d,m),e(m,p),e(d,b)},d(s){s&&t(d)}}}function $l(M){let d,k,m,p,b;return p=new Je({props:{code:`from transformers import AutoTokenizer, YosoForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/yoso-4096")
model = YosoForMultipleChoice.from_pretrained("uw-madison/yoso-4096")

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, YosoForMultipleChoice
<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;uw-madison/yoso-4096&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YosoForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&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"),k=i("Example:"),m=f(),v(p.$$.fragment)},l(s){d=a(s,"P",{});var c=r(d);k=l(c,"Example:"),c.forEach(t),m=g(s),w(p.$$.fragment,s)},m(s,c){_(s,d,c),e(d,k),_(s,m,c),y(p,s,c),b=!0},p:Ke,i(s){b||($(p.$$.fragment,s),b=!0)},o(s){T(p.$$.fragment,s),b=!1},d(s){s&&t(d),s&&t(m),Y(p,s)}}}function Tl(M){let d,k,m,p,b;return{c(){d=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),p=i("Module"),b=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(s){d=a(s,"P",{});var c=r(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var q=r(m);p=l(q,"Module"),q.forEach(t),b=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(s,c){_(s,d,c),e(d,k),e(d,m),e(m,p),e(d,b)},d(s){s&&t(d)}}}function Yl(M){let d,k,m,p,b;return p=new Je({props:{code:`from transformers import AutoTokenizer, YosoForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/yoso-4096")
model = YosoForTokenClassification.from_pretrained("uw-madison/yoso-4096")

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, YosoForTokenClassification
<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;uw-madison/yoso-4096&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YosoForTokenClassification.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&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"),k=i("Example:"),m=f(),v(p.$$.fragment)},l(s){d=a(s,"P",{});var c=r(d);k=l(c,"Example:"),c.forEach(t),m=g(s),w(p.$$.fragment,s)},m(s,c){_(s,d,c),e(d,k),_(s,m,c),y(p,s,c),b=!0},p:Ke,i(s){b||($(p.$$.fragment,s),b=!0)},o(s){T(p.$$.fragment,s),b=!1},d(s){s&&t(d),s&&t(m),Y(p,s)}}}function Ml(M){let d,k,m,p,b;return{c(){d=n("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),p=i("Module"),b=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(s){d=a(s,"P",{});var c=r(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(c,"CODE",{});var q=r(m);p=l(q,"Module"),q.forEach(t),b=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(s,c){_(s,d,c),e(d,k),e(d,m),e(m,p),e(d,b)},d(s){s&&t(d)}}}function ql(M){let d,k,m,p,b;return p=new Je({props:{code:`from transformers import AutoTokenizer, YosoForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("uw-madison/yoso-4096")
model = YosoForQuestionAnswering.from_pretrained("uw-madison/yoso-4096")

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, YosoForQuestionAnswering
<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;uw-madison/yoso-4096&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YosoForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;uw-madison/yoso-4096&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"),k=i("Example:"),m=f(),v(p.$$.fragment)},l(s){d=a(s,"P",{});var c=r(d);k=l(c,"Example:"),c.forEach(t),m=g(s),w(p.$$.fragment,s)},m(s,c){_(s,d,c),e(d,k),_(s,m,c),y(p,s,c),b=!0},p:Ke,i(s){b||($(p.$$.fragment,s),b=!0)},o(s){T(p.$$.fragment,s),b=!1},d(s){s&&t(d),s&&t(m),Y(p,s)}}}function Fl(M){let d,k,m,p,b,s,c,q,on,gs,G,ge,wt,Ze,tn,yt,sn,_s,K,nn,Xe,an,rn,ln,bs,Po,dn,ks,Lo,$t,cn,vs,No,pn,ws,Q,Tt,hn,mn,J,un,Yt,fn,gn,Mt,_n,bn,kn,Z,vn,qt,wn,yn,Ft,$n,Tn,ys,_e,Vr,$s,be,Yn,Io,Mn,qn,Ts,U,Fn,eo,xn,zn,oo,Cn,jn,Ys,X,ke,xt,to,On,zt,An,Ms,F,Ct,Do,En,Sn,jt,Wo,Pn,Ln,Ot,Ho,Nn,In,At,Qo,Dn,Wn,Et,Uo,Hn,qs,ee,ve,St,so,Qn,Pt,Un,Fs,z,no,Bn,oe,Rn,Bo,Vn,Gn,ao,Kn,Jn,Zn,te,Xn,Ro,ea,oa,Vo,ta,sa,na,we,xs,se,ye,Lt,ro,aa,Nt,ra,zs,P,io,ia,lo,la,co,da,ca,pa,j,po,ha,ne,ma,Go,ua,fa,It,ga,_a,ba,$e,ka,Te,Cs,ae,Ye,Dt,ho,va,Wt,wa,js,L,mo,ya,re,$a,Ht,Ta,Ya,uo,Ma,qa,Fa,O,fo,xa,ie,za,Ko,Ca,ja,Qt,Oa,Aa,Ea,Me,Sa,qe,Os,le,Fe,Ut,go,Pa,Bt,La,As,N,_o,Na,bo,Ia,ko,Da,Wa,Ha,x,vo,Qa,de,Ua,Jo,Ba,Ra,Rt,Va,Ga,Ka,xe,Ja,ze,Za,Ce,Es,ce,je,Vt,wo,Xa,Gt,er,Ss,I,yo,or,$o,tr,To,sr,nr,ar,A,Yo,rr,pe,ir,Zo,lr,dr,Kt,cr,pr,hr,Oe,mr,Ae,Ps,he,Ee,Jt,Mo,ur,Zt,fr,Ls,D,qo,gr,Fo,_r,xo,br,kr,vr,E,zo,wr,me,yr,Xo,$r,Tr,Xt,Yr,Mr,qr,Se,Fr,Pe,Ns,ue,Le,es,Co,xr,os,zr,Is,W,jo,Cr,H,jr,ts,Or,Ar,ss,Er,Sr,Oo,Pr,Lr,Nr,S,Ao,Ir,fe,Dr,et,Wr,Hr,ns,Qr,Ur,Br,Ne,Rr,Ie,Ds;return s=new V({}),Ze=new V({}),to=new V({}),so=new V({}),no=new C({props:{name:"class transformers.YosoConfig",anchor:"transformers.YosoConfig",parameters:[{name:"vocab_size",val:" = 50265"},{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:" = 4096"},{name:"type_vocab_size",val:" = 1"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_expectation",val:" = True"},{name:"hash_code_len",val:" = 9"},{name:"num_hash",val:" = 64"},{name:"conv_window",val:" = None"},{name:"use_fast_hash",val:" = True"},{name:"lsh_backward",val:" = True"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.YosoConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50265) &#x2014;
Vocabulary size of the YOSO 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/yoso#transformers.YosoModel">YosoModel</a>.`,name:"vocab_size"},{anchor:"transformers.YosoConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.YosoConfig.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.YosoConfig.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.YosoConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.YosoConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.YosoConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.YosoConfig.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.YosoConfig.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.YosoConfig.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/yoso#transformers.YosoModel">YosoModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.YosoConfig.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.YosoConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.YosoConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>.`,name:"position_embedding_type"},{anchor:"transformers.YosoConfig.use_expectation",description:`<strong>use_expectation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use YOSO Expectation. Overrides any effect of num_hash.`,name:"use_expectation"},{anchor:"transformers.YosoConfig.hash_code_len",description:`<strong>hash_code_len</strong> (<code>int</code>, <em>optional</em>, defaults to 9) &#x2014;
The length of hashes generated by the hash functions.`,name:"hash_code_len"},{anchor:"transformers.YosoConfig.num_hash",description:`<strong>num_hash</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Number of hash functions used in <code>YosoSelfAttention</code>.`,name:"num_hash"},{anchor:"transformers.YosoConfig.conv_window",description:`<strong>conv_window</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Kernel size of depth-wise convolution.`,name:"conv_window"},{anchor:"transformers.YosoConfig.use_fast_hash",description:`<strong>use_fast_hash</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use custom cuda kernels which perform fast random projection via hadamard transform.`,name:"use_fast_hash"},{anchor:"transformers.YosoConfig.lsh_backward",description:`<strong>lsh_backward</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to perform backpropagation using Locality Sensitive Hashing.`,name:"lsh_backward"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/yoso/configuration_yoso.py#L29"}}),we=new Ge({props:{anchor:"transformers.YosoConfig.example",$$slots:{default:[ul]},$$scope:{ctx:M}}}),ro=new V({}),io=new C({props:{name:"class transformers.YosoModel",anchor:"transformers.YosoModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.YosoModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoConfig">YosoConfig</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/yoso/modeling_yoso.py#L740"}}),po=new C({props:{name:"forward",anchor:"transformers.YosoModel.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:"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.YosoModel.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.YosoModel.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.YosoModel.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.YosoModel.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.YosoModel.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.YosoModel.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.YosoModel.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.YosoModel.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.YosoModel.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/yoso/modeling_yoso.py#L765",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithCrossAttentions</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/yoso#transformers.YosoConfig"
>YosoConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=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 of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new vt({props:{$$slots:{default:[fl]},$$scope:{ctx:M}}}),Te=new Ge({props:{anchor:"transformers.YosoModel.forward.example",$$slots:{default:[gl]},$$scope:{ctx:M}}}),ho=new V({}),mo=new C({props:{name:"class transformers.YosoForMaskedLM",anchor:"transformers.YosoForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.YosoForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoConfig">YosoConfig</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/yoso/modeling_yoso.py#L851"}}),fo=new C({props:{name:"forward",anchor:"transformers.YosoForMaskedLM.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.YosoForMaskedLM.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.YosoForMaskedLM.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.YosoForMaskedLM.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.YosoForMaskedLM.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.YosoForMaskedLM.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.YosoForMaskedLM.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.YosoForMaskedLM.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.YosoForMaskedLM.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.YosoForMaskedLM.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.YosoForMaskedLM.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/yoso/modeling_yoso.py#L873",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/yoso#transformers.YosoConfig"
>YosoConfig</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>
`}}),Me=new vt({props:{$$slots:{default:[_l]},$$scope:{ctx:M}}}),qe=new Ge({props:{anchor:"transformers.YosoForMaskedLM.forward.example",$$slots:{default:[bl]},$$scope:{ctx:M}}}),go=new V({}),_o=new C({props:{name:"class transformers.YosoForSequenceClassification",anchor:"transformers.YosoForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.YosoForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoConfig">YosoConfig</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/yoso/modeling_yoso.py#L958"}}),vo=new C({props:{name:"forward",anchor:"transformers.YosoForSequenceClassification.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.YosoForSequenceClassification.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.YosoForSequenceClassification.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.YosoForSequenceClassification.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.YosoForSequenceClassification.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.YosoForSequenceClassification.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.YosoForSequenceClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.YosoForSequenceClassification.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.YosoForSequenceClassification.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.YosoForSequenceClassification.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.YosoForSequenceClassification.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/yoso/modeling_yoso.py#L968",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/yoso#transformers.YosoConfig"
>YosoConfig</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>
`}}),xe=new vt({props:{$$slots:{default:[kl]},$$scope:{ctx:M}}}),ze=new Ge({props:{anchor:"transformers.YosoForSequenceClassification.forward.example",$$slots:{default:[vl]},$$scope:{ctx:M}}}),Ce=new Ge({props:{anchor:"transformers.YosoForSequenceClassification.forward.example-2",$$slots:{default:[wl]},$$scope:{ctx:M}}}),wo=new V({}),yo=new C({props:{name:"class transformers.YosoForMultipleChoice",anchor:"transformers.YosoForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.YosoForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoConfig">YosoConfig</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/yoso/modeling_yoso.py#L1049"}}),Yo=new C({props:{name:"forward",anchor:"transformers.YosoForMultipleChoice.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.YosoForMultipleChoice.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.YosoForMultipleChoice.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.YosoForMultipleChoice.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.YosoForMultipleChoice.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.YosoForMultipleChoice.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.YosoForMultipleChoice.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.YosoForMultipleChoice.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.YosoForMultipleChoice.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.YosoForMultipleChoice.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.YosoForMultipleChoice.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 <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/yoso/modeling_yoso.py#L1060",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/yoso#transformers.YosoConfig"
>YosoConfig</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>
`}}),Oe=new vt({props:{$$slots:{default:[yl]},$$scope:{ctx:M}}}),Ae=new Ge({props:{anchor:"transformers.YosoForMultipleChoice.forward.example",$$slots:{default:[$l]},$$scope:{ctx:M}}}),Mo=new V({}),qo=new C({props:{name:"class transformers.YosoForTokenClassification",anchor:"transformers.YosoForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.YosoForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoConfig">YosoConfig</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/yoso/modeling_yoso.py#L1140"}}),zo=new C({props:{name:"forward",anchor:"transformers.YosoForTokenClassification.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.YosoForTokenClassification.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.YosoForTokenClassification.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.YosoForTokenClassification.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.YosoForTokenClassification.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.YosoForTokenClassification.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.YosoForTokenClassification.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.YosoForTokenClassification.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.YosoForTokenClassification.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.YosoForTokenClassification.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.YosoForTokenClassification.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/yoso/modeling_yoso.py#L1152",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/yoso#transformers.YosoConfig"
>YosoConfig</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>
`}}),Se=new vt({props:{$$slots:{default:[Tl]},$$scope:{ctx:M}}}),Pe=new Ge({props:{anchor:"transformers.YosoForTokenClassification.forward.example",$$slots:{default:[Yl]},$$scope:{ctx:M}}}),Co=new V({}),jo=new C({props:{name:"class transformers.YosoForQuestionAnswering",anchor:"transformers.YosoForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.YosoForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoConfig">YosoConfig</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/yoso/modeling_yoso.py#L1225"}}),Ao=new C({props:{name:"forward",anchor:"transformers.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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 <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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.YosoForQuestionAnswering.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 (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.YosoForQuestionAnswering.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 (<code>sequence_length</code>). 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/yoso/modeling_yoso.py#L1238",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/yoso#transformers.YosoConfig"
>YosoConfig</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>
`}}),Ne=new vt({props:{$$slots:{default:[Ml]},$$scope:{ctx:M}}}),Ie=new Ge({props:{anchor:"transformers.YosoForQuestionAnswering.forward.example",$$slots:{default:[ql]},$$scope:{ctx:M}}}),{c(){d=n("meta"),k=f(),m=n("h1"),p=n("a"),b=n("span"),v(s.$$.fragment),c=f(),q=n("span"),on=i("YOSO"),gs=f(),G=n("h2"),ge=n("a"),wt=n("span"),v(Ze.$$.fragment),tn=f(),yt=n("span"),sn=i("Overview"),_s=f(),K=n("p"),nn=i("The YOSO model was proposed in "),Xe=n("a"),an=i("You Only Sample (Almost) Once: Linear Cost Self-Attention Via Bernoulli Sampling"),rn=n("br"),ln=i(`
by Zhanpeng Zeng, Yunyang Xiong, Sathya N. Ravi, Shailesh Acharya, Glenn Fung, Vikas Singh. YOSO approximates standard softmax self-attention
via a Bernoulli sampling scheme based on Locality Sensitive Hashing (LSH). In principle, all the Bernoulli random variables can be sampled with
a single hash.`),bs=f(),Po=n("p"),dn=i("The abstract from the paper is the following:"),ks=f(),Lo=n("p"),$t=n("em"),cn=i(`Transformer-based models are widely used in natural language processing (NLP). Central to the transformer model is
the self-attention mechanism, which captures the interactions of token pairs in the input sequences and depends quadratically
on the sequence length. Training such models on longer sequences is expensive. In this paper, we show that a Bernoulli sampling
attention mechanism based on Locality Sensitive Hashing (LSH), decreases the quadratic complexity of such models to linear.
We bypass the quadratic cost by considering self-attention as a sum of individual tokens associated with Bernoulli random
variables that can, in principle, be sampled at once by a single hash (although in practice, this number may be a small constant).
This leads to an efficient sampling scheme to estimate self-attention which relies on specific modifications of
LSH (to enable deployment on GPU architectures). We evaluate our algorithm on the GLUE benchmark with standard 512 sequence
length where we see favorable performance relative to a standard pretrained Transformer. On the Long Range Arena (LRA) benchmark,
for evaluating performance on long sequences, our method achieves results consistent with softmax self-attention but with sizable
speed-ups and memory savings and often outperforms other efficient self-attention methods. Our code is available at this https URL`),vs=f(),No=n("p"),pn=i("Tips:"),ws=f(),Q=n("ul"),Tt=n("li"),hn=i(`The YOSO attention algorithm is implemented through custom CUDA kernels, functions written in CUDA C++ that can be executed multiple times
in parallel on a GPU.`),mn=f(),J=n("li"),un=i("The kernels provide a "),Yt=n("code"),fn=i("fast_hash"),gn=i(` function, which approximates the random projections of the queries and keys using the Fast Hadamard Transform. Using these
hash codes, the `),Mt=n("code"),_n=i("lsh_cumulation"),bn=i(" function approximates self-attention via LSH-based Bernoulli sampling."),kn=f(),Z=n("li"),vn=i("To use the custom kernels, the user should set "),qt=n("code"),wn=i("config.use_expectation = False"),yn=i(`. To ensure that the kernels are compiled successfully,
the user must install the correct version of PyTorch and cudatoolkit. By default, `),Ft=n("code"),$n=i("config.use_expectation = True"),Tn=i(`, which uses YOSO-E and
does not require compiling CUDA kernels.`),ys=f(),_e=n("img"),$s=f(),be=n("small"),Yn=i("YOSO Attention Algorithm. Taken from the "),Io=n("a"),Mn=i("original paper"),qn=i("."),Ts=f(),U=n("p"),Fn=i("This model was contributed by "),eo=n("a"),xn=i("novice03"),zn=i(". The original code can be found "),oo=n("a"),Cn=i("here"),jn=i("."),Ys=f(),X=n("h2"),ke=n("a"),xt=n("span"),v(to.$$.fragment),On=f(),zt=n("span"),An=i("Documentation resources"),Ms=f(),F=n("ul"),Ct=n("li"),Do=n("a"),En=i("Text classification task guide"),Sn=f(),jt=n("li"),Wo=n("a"),Pn=i("Token classification task guide"),Ln=f(),Ot=n("li"),Ho=n("a"),Nn=i("Question answering task guide"),In=f(),At=n("li"),Qo=n("a"),Dn=i("Masked language modeling task guide"),Wn=f(),Et=n("li"),Uo=n("a"),Hn=i("Multiple choice task guide"),qs=f(),ee=n("h2"),ve=n("a"),St=n("span"),v(so.$$.fragment),Qn=f(),Pt=n("span"),Un=i("YosoConfig"),Fs=f(),z=n("div"),v(no.$$.fragment),Bn=f(),oe=n("p"),Rn=i("This is the configuration class to store the configuration of a "),Bo=n("a"),Vn=i("YosoModel"),Gn=i(`. It is used to instantiate an YOSO
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 YOSO
`),ao=n("a"),Kn=i("uw-madison/yoso-4096"),Jn=i(" architecture."),Zn=f(),te=n("p"),Xn=i("Configuration objects inherit from "),Ro=n("a"),ea=i("PretrainedConfig"),oa=i(` and can be used to control the model outputs. Read the
documentation from `),Vo=n("a"),ta=i("PretrainedConfig"),sa=i(" for more information."),na=f(),v(we.$$.fragment),xs=f(),se=n("h2"),ye=n("a"),Lt=n("span"),v(ro.$$.fragment),aa=f(),Nt=n("span"),ra=i("YosoModel"),zs=f(),P=n("div"),v(io.$$.fragment),ia=f(),lo=n("p"),la=i(`The bare YOSO Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),co=n("a"),da=i("torch.nn.Module"),ca=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pa=f(),j=n("div"),v(po.$$.fragment),ha=f(),ne=n("p"),ma=i("The "),Go=n("a"),ua=i("YosoModel"),fa=i(" forward method, overrides the "),It=n("code"),ga=i("__call__"),_a=i(" special method."),ba=f(),v($e.$$.fragment),ka=f(),v(Te.$$.fragment),Cs=f(),ae=n("h2"),Ye=n("a"),Dt=n("span"),v(ho.$$.fragment),va=f(),Wt=n("span"),wa=i("YosoForMaskedLM"),js=f(),L=n("div"),v(mo.$$.fragment),ya=f(),re=n("p"),$a=i("YOSO Model with a "),Ht=n("code"),Ta=i("language modeling"),Ya=i(` head on top.
This model is a PyTorch `),uo=n("a"),Ma=i("torch.nn.Module"),qa=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Fa=f(),O=n("div"),v(fo.$$.fragment),xa=f(),ie=n("p"),za=i("The "),Ko=n("a"),Ca=i("YosoForMaskedLM"),ja=i(" forward method, overrides the "),Qt=n("code"),Oa=i("__call__"),Aa=i(" special method."),Ea=f(),v(Me.$$.fragment),Sa=f(),v(qe.$$.fragment),Os=f(),le=n("h2"),Fe=n("a"),Ut=n("span"),v(go.$$.fragment),Pa=f(),Bt=n("span"),La=i("YosoForSequenceClassification"),As=f(),N=n("div"),v(_o.$$.fragment),Na=f(),bo=n("p"),Ia=i(`YOSO Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),ko=n("a"),Da=i("torch.nn.Module"),Wa=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ha=f(),x=n("div"),v(vo.$$.fragment),Qa=f(),de=n("p"),Ua=i("The "),Jo=n("a"),Ba=i("YosoForSequenceClassification"),Ra=i(" forward method, overrides the "),Rt=n("code"),Va=i("__call__"),Ga=i(" special method."),Ka=f(),v(xe.$$.fragment),Ja=f(),v(ze.$$.fragment),Za=f(),v(Ce.$$.fragment),Es=f(),ce=n("h2"),je=n("a"),Vt=n("span"),v(wo.$$.fragment),Xa=f(),Gt=n("span"),er=i("YosoForMultipleChoice"),Ss=f(),I=n("div"),v(yo.$$.fragment),or=f(),$o=n("p"),tr=i(`YOSO 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.
This model is a PyTorch `),To=n("a"),sr=i("torch.nn.Module"),nr=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ar=f(),A=n("div"),v(Yo.$$.fragment),rr=f(),pe=n("p"),ir=i("The "),Zo=n("a"),lr=i("YosoForMultipleChoice"),dr=i(" forward method, overrides the "),Kt=n("code"),cr=i("__call__"),pr=i(" special method."),hr=f(),v(Oe.$$.fragment),mr=f(),v(Ae.$$.fragment),Ps=f(),he=n("h2"),Ee=n("a"),Jt=n("span"),v(Mo.$$.fragment),ur=f(),Zt=n("span"),fr=i("YosoForTokenClassification"),Ls=f(),D=n("div"),v(qo.$$.fragment),gr=f(),Fo=n("p"),_r=i(`YOSO 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.
This model is a PyTorch `),xo=n("a"),br=i("torch.nn.Module"),kr=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vr=f(),E=n("div"),v(zo.$$.fragment),wr=f(),me=n("p"),yr=i("The "),Xo=n("a"),$r=i("YosoForTokenClassification"),Tr=i(" forward method, overrides the "),Xt=n("code"),Yr=i("__call__"),Mr=i(" special method."),qr=f(),v(Se.$$.fragment),Fr=f(),v(Pe.$$.fragment),Ns=f(),ue=n("h2"),Le=n("a"),es=n("span"),v(Co.$$.fragment),xr=f(),os=n("span"),zr=i("YosoForQuestionAnswering"),Is=f(),W=n("div"),v(jo.$$.fragment),Cr=f(),H=n("p"),jr=i(`YOSO 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 `),ts=n("code"),Or=i("span start logits"),Ar=i(" and "),ss=n("code"),Er=i("span end logits"),Sr=i(`).
This model is a PyTorch `),Oo=n("a"),Pr=i("torch.nn.Module"),Lr=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Nr=f(),S=n("div"),v(Ao.$$.fragment),Ir=f(),fe=n("p"),Dr=i("The "),et=n("a"),Wr=i("YosoForQuestionAnswering"),Hr=i(" forward method, overrides the "),ns=n("code"),Qr=i("__call__"),Ur=i(" special method."),Br=f(),v(Ne.$$.fragment),Rr=f(),v(Ie.$$.fragment),this.h()},l(o){const u=pl('[data-svelte="svelte-1phssyn"]',document.head);d=a(u,"META",{name:!0,content:!0}),u.forEach(t),k=g(o),m=a(o,"H1",{class:!0});var Eo=r(m);p=a(Eo,"A",{id:!0,class:!0,href:!0});var as=r(p);b=a(as,"SPAN",{});var rs=r(b);w(s.$$.fragment,rs),rs.forEach(t),as.forEach(t),c=g(Eo),q=a(Eo,"SPAN",{});var is=r(q);on=l(is,"YOSO"),is.forEach(t),Eo.forEach(t),gs=g(o),G=a(o,"H2",{class:!0});var So=r(G);ge=a(So,"A",{id:!0,class:!0,href:!0});var ls=r(ge);wt=a(ls,"SPAN",{});var ds=r(wt);w(Ze.$$.fragment,ds),ds.forEach(t),ls.forEach(t),tn=g(So),yt=a(So,"SPAN",{});var cs=r(yt);sn=l(cs,"Overview"),cs.forEach(t),So.forEach(t),_s=g(o),K=a(o,"P",{});var De=r(K);nn=l(De,"The YOSO model was proposed in "),Xe=a(De,"A",{href:!0,rel:!0});var ps=r(Xe);an=l(ps,"You Only Sample (Almost) Once: Linear Cost Self-Attention Via Bernoulli Sampling"),ps.forEach(t),rn=a(De,"BR",{}),ln=l(De,`
by Zhanpeng Zeng, Yunyang Xiong, Sathya N. Ravi, Shailesh Acharya, Glenn Fung, Vikas Singh. YOSO approximates standard softmax self-attention
via a Bernoulli sampling scheme based on Locality Sensitive Hashing (LSH). In principle, all the Bernoulli random variables can be sampled with
a single hash.`),De.forEach(t),bs=g(o),Po=a(o,"P",{});var hs=r(Po);dn=l(hs,"The abstract from the paper is the following:"),hs.forEach(t),ks=g(o),Lo=a(o,"P",{});var ms=r(Lo);$t=a(ms,"EM",{});var us=r($t);cn=l(us,`Transformer-based models are widely used in natural language processing (NLP). Central to the transformer model is
the self-attention mechanism, which captures the interactions of token pairs in the input sequences and depends quadratically
on the sequence length. Training such models on longer sequences is expensive. In this paper, we show that a Bernoulli sampling
attention mechanism based on Locality Sensitive Hashing (LSH), decreases the quadratic complexity of such models to linear.
We bypass the quadratic cost by considering self-attention as a sum of individual tokens associated with Bernoulli random
variables that can, in principle, be sampled at once by a single hash (although in practice, this number may be a small constant).
This leads to an efficient sampling scheme to estimate self-attention which relies on specific modifications of
LSH (to enable deployment on GPU architectures). We evaluate our algorithm on the GLUE benchmark with standard 512 sequence
length where we see favorable performance relative to a standard pretrained Transformer. On the Long Range Arena (LRA) benchmark,
for evaluating performance on long sequences, our method achieves results consistent with softmax self-attention but with sizable
speed-ups and memory savings and often outperforms other efficient self-attention methods. Our code is available at this https URL`),us.forEach(t),ms.forEach(t),vs=g(o),No=a(o,"P",{});var fs=r(No);pn=l(fs,"Tips:"),fs.forEach(t),ws=g(o),Q=a(o,"UL",{});var ot=r(Q);Tt=a(ot,"LI",{});var Gr=r(Tt);hn=l(Gr,`The YOSO attention algorithm is implemented through custom CUDA kernels, functions written in CUDA C++ that can be executed multiple times
in parallel on a GPU.`),Gr.forEach(t),mn=g(ot),J=a(ot,"LI",{});var tt=r(J);un=l(tt,"The kernels provide a "),Yt=a(tt,"CODE",{});var Kr=r(Yt);fn=l(Kr,"fast_hash"),Kr.forEach(t),gn=l(tt,` function, which approximates the random projections of the queries and keys using the Fast Hadamard Transform. Using these
hash codes, the `),Mt=a(tt,"CODE",{});var Jr=r(Mt);_n=l(Jr,"lsh_cumulation"),Jr.forEach(t),bn=l(tt," function approximates self-attention via LSH-based Bernoulli sampling."),tt.forEach(t),kn=g(ot),Z=a(ot,"LI",{});var st=r(Z);vn=l(st,"To use the custom kernels, the user should set "),qt=a(st,"CODE",{});var Zr=r(qt);wn=l(Zr,"config.use_expectation = False"),Zr.forEach(t),yn=l(st,`. To ensure that the kernels are compiled successfully,
the user must install the correct version of PyTorch and cudatoolkit. By default, `),Ft=a(st,"CODE",{});var Xr=r(Ft);$n=l(Xr,"config.use_expectation = True"),Xr.forEach(t),Tn=l(st,`, which uses YOSO-E and
does not require compiling CUDA kernels.`),st.forEach(t),ot.forEach(t),ys=g(o),_e=a(o,"IMG",{src:!0,alt:!0,width:!0}),$s=g(o),be=a(o,"SMALL",{});var Ws=r(be);Yn=l(Ws,"YOSO Attention Algorithm. Taken from the "),Io=a(Ws,"A",{href:!0});var ei=r(Io);Mn=l(ei,"original paper"),ei.forEach(t),qn=l(Ws,"."),Ws.forEach(t),Ts=g(o),U=a(o,"P",{});var nt=r(U);Fn=l(nt,"This model was contributed by "),eo=a(nt,"A",{href:!0,rel:!0});var oi=r(eo);xn=l(oi,"novice03"),oi.forEach(t),zn=l(nt,". The original code can be found "),oo=a(nt,"A",{href:!0,rel:!0});var ti=r(oo);Cn=l(ti,"here"),ti.forEach(t),jn=l(nt,"."),nt.forEach(t),Ys=g(o),X=a(o,"H2",{class:!0});var Hs=r(X);ke=a(Hs,"A",{id:!0,class:!0,href:!0});var si=r(ke);xt=a(si,"SPAN",{});var ni=r(xt);w(to.$$.fragment,ni),ni.forEach(t),si.forEach(t),On=g(Hs),zt=a(Hs,"SPAN",{});var ai=r(zt);An=l(ai,"Documentation resources"),ai.forEach(t),Hs.forEach(t),Ms=g(o),F=a(o,"UL",{});var B=r(F);Ct=a(B,"LI",{});var ri=r(Ct);Do=a(ri,"A",{href:!0});var ii=r(Do);En=l(ii,"Text classification task guide"),ii.forEach(t),ri.forEach(t),Sn=g(B),jt=a(B,"LI",{});var li=r(jt);Wo=a(li,"A",{href:!0});var di=r(Wo);Pn=l(di,"Token classification task guide"),di.forEach(t),li.forEach(t),Ln=g(B),Ot=a(B,"LI",{});var ci=r(Ot);Ho=a(ci,"A",{href:!0});var pi=r(Ho);Nn=l(pi,"Question answering task guide"),pi.forEach(t),ci.forEach(t),In=g(B),At=a(B,"LI",{});var hi=r(At);Qo=a(hi,"A",{href:!0});var mi=r(Qo);Dn=l(mi,"Masked language modeling task guide"),mi.forEach(t),hi.forEach(t),Wn=g(B),Et=a(B,"LI",{});var ui=r(Et);Uo=a(ui,"A",{href:!0});var fi=r(Uo);Hn=l(fi,"Multiple choice task guide"),fi.forEach(t),ui.forEach(t),B.forEach(t),qs=g(o),ee=a(o,"H2",{class:!0});var Qs=r(ee);ve=a(Qs,"A",{id:!0,class:!0,href:!0});var gi=r(ve);St=a(gi,"SPAN",{});var _i=r(St);w(so.$$.fragment,_i),_i.forEach(t),gi.forEach(t),Qn=g(Qs),Pt=a(Qs,"SPAN",{});var bi=r(Pt);Un=l(bi,"YosoConfig"),bi.forEach(t),Qs.forEach(t),Fs=g(o),z=a(o,"DIV",{class:!0});var We=r(z);w(no.$$.fragment,We),Bn=g(We),oe=a(We,"P",{});var at=r(oe);Rn=l(at,"This is the configuration class to store the configuration of a "),Bo=a(at,"A",{href:!0});var ki=r(Bo);Vn=l(ki,"YosoModel"),ki.forEach(t),Gn=l(at,`. It is used to instantiate an YOSO
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 YOSO
`),ao=a(at,"A",{href:!0,rel:!0});var vi=r(ao);Kn=l(vi,"uw-madison/yoso-4096"),vi.forEach(t),Jn=l(at," architecture."),at.forEach(t),Zn=g(We),te=a(We,"P",{});var rt=r(te);Xn=l(rt,"Configuration objects inherit from "),Ro=a(rt,"A",{href:!0});var wi=r(Ro);ea=l(wi,"PretrainedConfig"),wi.forEach(t),oa=l(rt,` and can be used to control the model outputs. Read the
documentation from `),Vo=a(rt,"A",{href:!0});var yi=r(Vo);ta=l(yi,"PretrainedConfig"),yi.forEach(t),sa=l(rt," for more information."),rt.forEach(t),na=g(We),w(we.$$.fragment,We),We.forEach(t),xs=g(o),se=a(o,"H2",{class:!0});var Us=r(se);ye=a(Us,"A",{id:!0,class:!0,href:!0});var $i=r(ye);Lt=a($i,"SPAN",{});var Ti=r(Lt);w(ro.$$.fragment,Ti),Ti.forEach(t),$i.forEach(t),aa=g(Us),Nt=a(Us,"SPAN",{});var Yi=r(Nt);ra=l(Yi,"YosoModel"),Yi.forEach(t),Us.forEach(t),zs=g(o),P=a(o,"DIV",{class:!0});var it=r(P);w(io.$$.fragment,it),ia=g(it),lo=a(it,"P",{});var Bs=r(lo);la=l(Bs,`The bare YOSO Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),co=a(Bs,"A",{href:!0,rel:!0});var Mi=r(co);da=l(Mi,"torch.nn.Module"),Mi.forEach(t),ca=l(Bs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bs.forEach(t),pa=g(it),j=a(it,"DIV",{class:!0});var He=r(j);w(po.$$.fragment,He),ha=g(He),ne=a(He,"P",{});var lt=r(ne);ma=l(lt,"The "),Go=a(lt,"A",{href:!0});var qi=r(Go);ua=l(qi,"YosoModel"),qi.forEach(t),fa=l(lt," forward method, overrides the "),It=a(lt,"CODE",{});var Fi=r(It);ga=l(Fi,"__call__"),Fi.forEach(t),_a=l(lt," special method."),lt.forEach(t),ba=g(He),w($e.$$.fragment,He),ka=g(He),w(Te.$$.fragment,He),He.forEach(t),it.forEach(t),Cs=g(o),ae=a(o,"H2",{class:!0});var Rs=r(ae);Ye=a(Rs,"A",{id:!0,class:!0,href:!0});var xi=r(Ye);Dt=a(xi,"SPAN",{});var zi=r(Dt);w(ho.$$.fragment,zi),zi.forEach(t),xi.forEach(t),va=g(Rs),Wt=a(Rs,"SPAN",{});var Ci=r(Wt);wa=l(Ci,"YosoForMaskedLM"),Ci.forEach(t),Rs.forEach(t),js=g(o),L=a(o,"DIV",{class:!0});var dt=r(L);w(mo.$$.fragment,dt),ya=g(dt),re=a(dt,"P",{});var ct=r(re);$a=l(ct,"YOSO Model with a "),Ht=a(ct,"CODE",{});var ji=r(Ht);Ta=l(ji,"language modeling"),ji.forEach(t),Ya=l(ct,` head on top.
This model is a PyTorch `),uo=a(ct,"A",{href:!0,rel:!0});var Oi=r(uo);Ma=l(Oi,"torch.nn.Module"),Oi.forEach(t),qa=l(ct,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ct.forEach(t),Fa=g(dt),O=a(dt,"DIV",{class:!0});var Qe=r(O);w(fo.$$.fragment,Qe),xa=g(Qe),ie=a(Qe,"P",{});var pt=r(ie);za=l(pt,"The "),Ko=a(pt,"A",{href:!0});var Ai=r(Ko);Ca=l(Ai,"YosoForMaskedLM"),Ai.forEach(t),ja=l(pt," forward method, overrides the "),Qt=a(pt,"CODE",{});var Ei=r(Qt);Oa=l(Ei,"__call__"),Ei.forEach(t),Aa=l(pt," special method."),pt.forEach(t),Ea=g(Qe),w(Me.$$.fragment,Qe),Sa=g(Qe),w(qe.$$.fragment,Qe),Qe.forEach(t),dt.forEach(t),Os=g(o),le=a(o,"H2",{class:!0});var Vs=r(le);Fe=a(Vs,"A",{id:!0,class:!0,href:!0});var Si=r(Fe);Ut=a(Si,"SPAN",{});var Pi=r(Ut);w(go.$$.fragment,Pi),Pi.forEach(t),Si.forEach(t),Pa=g(Vs),Bt=a(Vs,"SPAN",{});var Li=r(Bt);La=l(Li,"YosoForSequenceClassification"),Li.forEach(t),Vs.forEach(t),As=g(o),N=a(o,"DIV",{class:!0});var ht=r(N);w(_o.$$.fragment,ht),Na=g(ht),bo=a(ht,"P",{});var Gs=r(bo);Ia=l(Gs,`YOSO Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),ko=a(Gs,"A",{href:!0,rel:!0});var Ni=r(ko);Da=l(Ni,"torch.nn.Module"),Ni.forEach(t),Wa=l(Gs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gs.forEach(t),Ha=g(ht),x=a(ht,"DIV",{class:!0});var R=r(x);w(vo.$$.fragment,R),Qa=g(R),de=a(R,"P",{});var mt=r(de);Ua=l(mt,"The "),Jo=a(mt,"A",{href:!0});var Ii=r(Jo);Ba=l(Ii,"YosoForSequenceClassification"),Ii.forEach(t),Ra=l(mt," forward method, overrides the "),Rt=a(mt,"CODE",{});var Di=r(Rt);Va=l(Di,"__call__"),Di.forEach(t),Ga=l(mt," special method."),mt.forEach(t),Ka=g(R),w(xe.$$.fragment,R),Ja=g(R),w(ze.$$.fragment,R),Za=g(R),w(Ce.$$.fragment,R),R.forEach(t),ht.forEach(t),Es=g(o),ce=a(o,"H2",{class:!0});var Ks=r(ce);je=a(Ks,"A",{id:!0,class:!0,href:!0});var Wi=r(je);Vt=a(Wi,"SPAN",{});var Hi=r(Vt);w(wo.$$.fragment,Hi),Hi.forEach(t),Wi.forEach(t),Xa=g(Ks),Gt=a(Ks,"SPAN",{});var Qi=r(Gt);er=l(Qi,"YosoForMultipleChoice"),Qi.forEach(t),Ks.forEach(t),Ss=g(o),I=a(o,"DIV",{class:!0});var ut=r(I);w(yo.$$.fragment,ut),or=g(ut),$o=a(ut,"P",{});var Js=r($o);tr=l(Js,`YOSO 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.
This model is a PyTorch `),To=a(Js,"A",{href:!0,rel:!0});var Ui=r(To);sr=l(Ui,"torch.nn.Module"),Ui.forEach(t),nr=l(Js,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Js.forEach(t),ar=g(ut),A=a(ut,"DIV",{class:!0});var Ue=r(A);w(Yo.$$.fragment,Ue),rr=g(Ue),pe=a(Ue,"P",{});var ft=r(pe);ir=l(ft,"The "),Zo=a(ft,"A",{href:!0});var Bi=r(Zo);lr=l(Bi,"YosoForMultipleChoice"),Bi.forEach(t),dr=l(ft," forward method, overrides the "),Kt=a(ft,"CODE",{});var Ri=r(Kt);cr=l(Ri,"__call__"),Ri.forEach(t),pr=l(ft," special method."),ft.forEach(t),hr=g(Ue),w(Oe.$$.fragment,Ue),mr=g(Ue),w(Ae.$$.fragment,Ue),Ue.forEach(t),ut.forEach(t),Ps=g(o),he=a(o,"H2",{class:!0});var Zs=r(he);Ee=a(Zs,"A",{id:!0,class:!0,href:!0});var Vi=r(Ee);Jt=a(Vi,"SPAN",{});var Gi=r(Jt);w(Mo.$$.fragment,Gi),Gi.forEach(t),Vi.forEach(t),ur=g(Zs),Zt=a(Zs,"SPAN",{});var Ki=r(Zt);fr=l(Ki,"YosoForTokenClassification"),Ki.forEach(t),Zs.forEach(t),Ls=g(o),D=a(o,"DIV",{class:!0});var gt=r(D);w(qo.$$.fragment,gt),gr=g(gt),Fo=a(gt,"P",{});var Xs=r(Fo);_r=l(Xs,`YOSO 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.
This model is a PyTorch `),xo=a(Xs,"A",{href:!0,rel:!0});var Ji=r(xo);br=l(Ji,"torch.nn.Module"),Ji.forEach(t),kr=l(Xs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xs.forEach(t),vr=g(gt),E=a(gt,"DIV",{class:!0});var Be=r(E);w(zo.$$.fragment,Be),wr=g(Be),me=a(Be,"P",{});var _t=r(me);yr=l(_t,"The "),Xo=a(_t,"A",{href:!0});var Zi=r(Xo);$r=l(Zi,"YosoForTokenClassification"),Zi.forEach(t),Tr=l(_t," forward method, overrides the "),Xt=a(_t,"CODE",{});var Xi=r(Xt);Yr=l(Xi,"__call__"),Xi.forEach(t),Mr=l(_t," special method."),_t.forEach(t),qr=g(Be),w(Se.$$.fragment,Be),Fr=g(Be),w(Pe.$$.fragment,Be),Be.forEach(t),gt.forEach(t),Ns=g(o),ue=a(o,"H2",{class:!0});var en=r(ue);Le=a(en,"A",{id:!0,class:!0,href:!0});var el=r(Le);es=a(el,"SPAN",{});var ol=r(es);w(Co.$$.fragment,ol),ol.forEach(t),el.forEach(t),xr=g(en),os=a(en,"SPAN",{});var tl=r(os);zr=l(tl,"YosoForQuestionAnswering"),tl.forEach(t),en.forEach(t),Is=g(o),W=a(o,"DIV",{class:!0});var bt=r(W);w(jo.$$.fragment,bt),Cr=g(bt),H=a(bt,"P",{});var Re=r(H);jr=l(Re,`YOSO 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 `),ts=a(Re,"CODE",{});var sl=r(ts);Or=l(sl,"span start logits"),sl.forEach(t),Ar=l(Re," and "),ss=a(Re,"CODE",{});var nl=r(ss);Er=l(nl,"span end logits"),nl.forEach(t),Sr=l(Re,`).
This model is a PyTorch `),Oo=a(Re,"A",{href:!0,rel:!0});var al=r(Oo);Pr=l(al,"torch.nn.Module"),al.forEach(t),Lr=l(Re,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Re.forEach(t),Nr=g(bt),S=a(bt,"DIV",{class:!0});var Ve=r(S);w(Ao.$$.fragment,Ve),Ir=g(Ve),fe=a(Ve,"P",{});var kt=r(fe);Dr=l(kt,"The "),et=a(kt,"A",{href:!0});var rl=r(et);Wr=l(rl,"YosoForQuestionAnswering"),rl.forEach(t),Hr=l(kt," forward method, overrides the "),ns=a(kt,"CODE",{});var il=r(ns);Qr=l(il,"__call__"),il.forEach(t),Ur=l(kt," special method."),kt.forEach(t),Br=g(Ve),w(Ne.$$.fragment,Ve),Rr=g(Ve),w(Ie.$$.fragment,Ve),Ve.forEach(t),bt.forEach(t),this.h()},h(){h(d,"name","hf:doc:metadata"),h(d,"content",JSON.stringify(xl)),h(p,"id","yoso"),h(p,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(p,"href","#yoso"),h(m,"class","relative group"),h(ge,"id","overview"),h(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ge,"href","#overview"),h(G,"class","relative group"),h(Xe,"href","https://arxiv.org/abs/2111.09714"),h(Xe,"rel","nofollow"),hl(_e.src,Vr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/yoso_architecture.jpg")||h(_e,"src",Vr),h(_e,"alt","drawing"),h(_e,"width","600"),h(Io,"href","https://arxiv.org/abs/2111.09714"),h(eo,"href","https://huggingface.co/novice03"),h(eo,"rel","nofollow"),h(oo,"href","https://github.com/mlpen/YOSO"),h(oo,"rel","nofollow"),h(ke,"id","documentation-resources"),h(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"),h(ke,"href","#documentation-resources"),h(X,"class","relative group"),h(Do,"href","../tasks/sequence_classification"),h(Wo,"href","../tasks/token_classification"),h(Ho,"href","../tasks/question_answering"),h(Qo,"href","../tasks/masked_language_modeling"),h(Uo,"href","../tasks/multiple_choice"),h(ve,"id","transformers.YosoConfig"),h(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ve,"href","#transformers.YosoConfig"),h(ee,"class","relative group"),h(Bo,"href","/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoModel"),h(ao,"href","https://huggingface.co/uw-madison/yoso-4096"),h(ao,"rel","nofollow"),h(Ro,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(Vo,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),h(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ye,"id","transformers.YosoModel"),h(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ye,"href","#transformers.YosoModel"),h(se,"class","relative group"),h(co,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(co,"rel","nofollow"),h(Go,"href","/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoModel"),h(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ye,"id","transformers.YosoForMaskedLM"),h(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ye,"href","#transformers.YosoForMaskedLM"),h(ae,"class","relative group"),h(uo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(uo,"rel","nofollow"),h(Ko,"href","/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoForMaskedLM"),h(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Fe,"id","transformers.YosoForSequenceClassification"),h(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Fe,"href","#transformers.YosoForSequenceClassification"),h(le,"class","relative group"),h(ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(ko,"rel","nofollow"),h(Jo,"href","/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoForSequenceClassification"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(je,"id","transformers.YosoForMultipleChoice"),h(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(je,"href","#transformers.YosoForMultipleChoice"),h(ce,"class","relative group"),h(To,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(To,"rel","nofollow"),h(Zo,"href","/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoForMultipleChoice"),h(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ee,"id","transformers.YosoForTokenClassification"),h(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ee,"href","#transformers.YosoForTokenClassification"),h(he,"class","relative group"),h(xo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(xo,"rel","nofollow"),h(Xo,"href","/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoForTokenClassification"),h(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Le,"id","transformers.YosoForQuestionAnswering"),h(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Le,"href","#transformers.YosoForQuestionAnswering"),h(ue,"class","relative group"),h(Oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Oo,"rel","nofollow"),h(et,"href","/docs/transformers/v4.29.0/en/model_doc/yoso#transformers.YosoForQuestionAnswering"),h(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(W,"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,u){e(document.head,d),_(o,k,u),_(o,m,u),e(m,p),e(p,b),y(s,b,null),e(m,c),e(m,q),e(q,on),_(o,gs,u),_(o,G,u),e(G,ge),e(ge,wt),y(Ze,wt,null),e(G,tn),e(G,yt),e(yt,sn),_(o,_s,u),_(o,K,u),e(K,nn),e(K,Xe),e(Xe,an),e(K,rn),e(K,ln),_(o,bs,u),_(o,Po,u),e(Po,dn),_(o,ks,u),_(o,Lo,u),e(Lo,$t),e($t,cn),_(o,vs,u),_(o,No,u),e(No,pn),_(o,ws,u),_(o,Q,u),e(Q,Tt),e(Tt,hn),e(Q,mn),e(Q,J),e(J,un),e(J,Yt),e(Yt,fn),e(J,gn),e(J,Mt),e(Mt,_n),e(J,bn),e(Q,kn),e(Q,Z),e(Z,vn),e(Z,qt),e(qt,wn),e(Z,yn),e(Z,Ft),e(Ft,$n),e(Z,Tn),_(o,ys,u),_(o,_e,u),_(o,$s,u),_(o,be,u),e(be,Yn),e(be,Io),e(Io,Mn),e(be,qn),_(o,Ts,u),_(o,U,u),e(U,Fn),e(U,eo),e(eo,xn),e(U,zn),e(U,oo),e(oo,Cn),e(U,jn),_(o,Ys,u),_(o,X,u),e(X,ke),e(ke,xt),y(to,xt,null),e(X,On),e(X,zt),e(zt,An),_(o,Ms,u),_(o,F,u),e(F,Ct),e(Ct,Do),e(Do,En),e(F,Sn),e(F,jt),e(jt,Wo),e(Wo,Pn),e(F,Ln),e(F,Ot),e(Ot,Ho),e(Ho,Nn),e(F,In),e(F,At),e(At,Qo),e(Qo,Dn),e(F,Wn),e(F,Et),e(Et,Uo),e(Uo,Hn),_(o,qs,u),_(o,ee,u),e(ee,ve),e(ve,St),y(so,St,null),e(ee,Qn),e(ee,Pt),e(Pt,Un),_(o,Fs,u),_(o,z,u),y(no,z,null),e(z,Bn),e(z,oe),e(oe,Rn),e(oe,Bo),e(Bo,Vn),e(oe,Gn),e(oe,ao),e(ao,Kn),e(oe,Jn),e(z,Zn),e(z,te),e(te,Xn),e(te,Ro),e(Ro,ea),e(te,oa),e(te,Vo),e(Vo,ta),e(te,sa),e(z,na),y(we,z,null),_(o,xs,u),_(o,se,u),e(se,ye),e(ye,Lt),y(ro,Lt,null),e(se,aa),e(se,Nt),e(Nt,ra),_(o,zs,u),_(o,P,u),y(io,P,null),e(P,ia),e(P,lo),e(lo,la),e(lo,co),e(co,da),e(lo,ca),e(P,pa),e(P,j),y(po,j,null),e(j,ha),e(j,ne),e(ne,ma),e(ne,Go),e(Go,ua),e(ne,fa),e(ne,It),e(It,ga),e(ne,_a),e(j,ba),y($e,j,null),e(j,ka),y(Te,j,null),_(o,Cs,u),_(o,ae,u),e(ae,Ye),e(Ye,Dt),y(ho,Dt,null),e(ae,va),e(ae,Wt),e(Wt,wa),_(o,js,u),_(o,L,u),y(mo,L,null),e(L,ya),e(L,re),e(re,$a),e(re,Ht),e(Ht,Ta),e(re,Ya),e(re,uo),e(uo,Ma),e(re,qa),e(L,Fa),e(L,O),y(fo,O,null),e(O,xa),e(O,ie),e(ie,za),e(ie,Ko),e(Ko,Ca),e(ie,ja),e(ie,Qt),e(Qt,Oa),e(ie,Aa),e(O,Ea),y(Me,O,null),e(O,Sa),y(qe,O,null),_(o,Os,u),_(o,le,u),e(le,Fe),e(Fe,Ut),y(go,Ut,null),e(le,Pa),e(le,Bt),e(Bt,La),_(o,As,u),_(o,N,u),y(_o,N,null),e(N,Na),e(N,bo),e(bo,Ia),e(bo,ko),e(ko,Da),e(bo,Wa),e(N,Ha),e(N,x),y(vo,x,null),e(x,Qa),e(x,de),e(de,Ua),e(de,Jo),e(Jo,Ba),e(de,Ra),e(de,Rt),e(Rt,Va),e(de,Ga),e(x,Ka),y(xe,x,null),e(x,Ja),y(ze,x,null),e(x,Za),y(Ce,x,null),_(o,Es,u),_(o,ce,u),e(ce,je),e(je,Vt),y(wo,Vt,null),e(ce,Xa),e(ce,Gt),e(Gt,er),_(o,Ss,u),_(o,I,u),y(yo,I,null),e(I,or),e(I,$o),e($o,tr),e($o,To),e(To,sr),e($o,nr),e(I,ar),e(I,A),y(Yo,A,null),e(A,rr),e(A,pe),e(pe,ir),e(pe,Zo),e(Zo,lr),e(pe,dr),e(pe,Kt),e(Kt,cr),e(pe,pr),e(A,hr),y(Oe,A,null),e(A,mr),y(Ae,A,null),_(o,Ps,u),_(o,he,u),e(he,Ee),e(Ee,Jt),y(Mo,Jt,null),e(he,ur),e(he,Zt),e(Zt,fr),_(o,Ls,u),_(o,D,u),y(qo,D,null),e(D,gr),e(D,Fo),e(Fo,_r),e(Fo,xo),e(xo,br),e(Fo,kr),e(D,vr),e(D,E),y(zo,E,null),e(E,wr),e(E,me),e(me,yr),e(me,Xo),e(Xo,$r),e(me,Tr),e(me,Xt),e(Xt,Yr),e(me,Mr),e(E,qr),y(Se,E,null),e(E,Fr),y(Pe,E,null),_(o,Ns,u),_(o,ue,u),e(ue,Le),e(Le,es),y(Co,es,null),e(ue,xr),e(ue,os),e(os,zr),_(o,Is,u),_(o,W,u),y(jo,W,null),e(W,Cr),e(W,H),e(H,jr),e(H,ts),e(ts,Or),e(H,Ar),e(H,ss),e(ss,Er),e(H,Sr),e(H,Oo),e(Oo,Pr),e(H,Lr),e(W,Nr),e(W,S),y(Ao,S,null),e(S,Ir),e(S,fe),e(fe,Dr),e(fe,et),e(et,Wr),e(fe,Hr),e(fe,ns),e(ns,Qr),e(fe,Ur),e(S,Br),y(Ne,S,null),e(S,Rr),y(Ie,S,null),Ds=!0},p(o,[u]){const Eo={};u&2&&(Eo.$$scope={dirty:u,ctx:o}),we.$set(Eo);const as={};u&2&&(as.$$scope={dirty:u,ctx:o}),$e.$set(as);const rs={};u&2&&(rs.$$scope={dirty:u,ctx:o}),Te.$set(rs);const is={};u&2&&(is.$$scope={dirty:u,ctx:o}),Me.$set(is);const So={};u&2&&(So.$$scope={dirty:u,ctx:o}),qe.$set(So);const ls={};u&2&&(ls.$$scope={dirty:u,ctx:o}),xe.$set(ls);const ds={};u&2&&(ds.$$scope={dirty:u,ctx:o}),ze.$set(ds);const cs={};u&2&&(cs.$$scope={dirty:u,ctx:o}),Ce.$set(cs);const De={};u&2&&(De.$$scope={dirty:u,ctx:o}),Oe.$set(De);const ps={};u&2&&(ps.$$scope={dirty:u,ctx:o}),Ae.$set(ps);const hs={};u&2&&(hs.$$scope={dirty:u,ctx:o}),Se.$set(hs);const ms={};u&2&&(ms.$$scope={dirty:u,ctx:o}),Pe.$set(ms);const us={};u&2&&(us.$$scope={dirty:u,ctx:o}),Ne.$set(us);const fs={};u&2&&(fs.$$scope={dirty:u,ctx:o}),Ie.$set(fs)},i(o){Ds||($(s.$$.fragment,o),$(Ze.$$.fragment,o),$(to.$$.fragment,o),$(so.$$.fragment,o),$(no.$$.fragment,o),$(we.$$.fragment,o),$(ro.$$.fragment,o),$(io.$$.fragment,o),$(po.$$.fragment,o),$($e.$$.fragment,o),$(Te.$$.fragment,o),$(ho.$$.fragment,o),$(mo.$$.fragment,o),$(fo.$$.fragment,o),$(Me.$$.fragment,o),$(qe.$$.fragment,o),$(go.$$.fragment,o),$(_o.$$.fragment,o),$(vo.$$.fragment,o),$(xe.$$.fragment,o),$(ze.$$.fragment,o),$(Ce.$$.fragment,o),$(wo.$$.fragment,o),$(yo.$$.fragment,o),$(Yo.$$.fragment,o),$(Oe.$$.fragment,o),$(Ae.$$.fragment,o),$(Mo.$$.fragment,o),$(qo.$$.fragment,o),$(zo.$$.fragment,o),$(Se.$$.fragment,o),$(Pe.$$.fragment,o),$(Co.$$.fragment,o),$(jo.$$.fragment,o),$(Ao.$$.fragment,o),$(Ne.$$.fragment,o),$(Ie.$$.fragment,o),Ds=!0)},o(o){T(s.$$.fragment,o),T(Ze.$$.fragment,o),T(to.$$.fragment,o),T(so.$$.fragment,o),T(no.$$.fragment,o),T(we.$$.fragment,o),T(ro.$$.fragment,o),T(io.$$.fragment,o),T(po.$$.fragment,o),T($e.$$.fragment,o),T(Te.$$.fragment,o),T(ho.$$.fragment,o),T(mo.$$.fragment,o),T(fo.$$.fragment,o),T(Me.$$.fragment,o),T(qe.$$.fragment,o),T(go.$$.fragment,o),T(_o.$$.fragment,o),T(vo.$$.fragment,o),T(xe.$$.fragment,o),T(ze.$$.fragment,o),T(Ce.$$.fragment,o),T(wo.$$.fragment,o),T(yo.$$.fragment,o),T(Yo.$$.fragment,o),T(Oe.$$.fragment,o),T(Ae.$$.fragment,o),T(Mo.$$.fragment,o),T(qo.$$.fragment,o),T(zo.$$.fragment,o),T(Se.$$.fragment,o),T(Pe.$$.fragment,o),T(Co.$$.fragment,o),T(jo.$$.fragment,o),T(Ao.$$.fragment,o),T(Ne.$$.fragment,o),T(Ie.$$.fragment,o),Ds=!1},d(o){t(d),o&&t(k),o&&t(m),Y(s),o&&t(gs),o&&t(G),Y(Ze),o&&t(_s),o&&t(K),o&&t(bs),o&&t(Po),o&&t(ks),o&&t(Lo),o&&t(vs),o&&t(No),o&&t(ws),o&&t(Q),o&&t(ys),o&&t(_e),o&&t($s),o&&t(be),o&&t(Ts),o&&t(U),o&&t(Ys),o&&t(X),Y(to),o&&t(Ms),o&&t(F),o&&t(qs),o&&t(ee),Y(so),o&&t(Fs),o&&t(z),Y(no),Y(we),o&&t(xs),o&&t(se),Y(ro),o&&t(zs),o&&t(P),Y(io),Y(po),Y($e),Y(Te),o&&t(Cs),o&&t(ae),Y(ho),o&&t(js),o&&t(L),Y(mo),Y(fo),Y(Me),Y(qe),o&&t(Os),o&&t(le),Y(go),o&&t(As),o&&t(N),Y(_o),Y(vo),Y(xe),Y(ze),Y(Ce),o&&t(Es),o&&t(ce),Y(wo),o&&t(Ss),o&&t(I),Y(yo),Y(Yo),Y(Oe),Y(Ae),o&&t(Ps),o&&t(he),Y(Mo),o&&t(Ls),o&&t(D),Y(qo),Y(zo),Y(Se),Y(Pe),o&&t(Ns),o&&t(ue),Y(Co),o&&t(Is),o&&t(W),Y(jo),Y(Ao),Y(Ne),Y(Ie)}}}const xl={local:"yoso",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.YosoConfig",title:"YosoConfig"},{local:"transformers.YosoModel",title:"YosoModel"},{local:"transformers.YosoForMaskedLM",title:"YosoForMaskedLM"},{local:"transformers.YosoForSequenceClassification",title:"YosoForSequenceClassification"},{local:"transformers.YosoForMultipleChoice",title:"YosoForMultipleChoice"},{local:"transformers.YosoForTokenClassification",title:"YosoForTokenClassification"},{local:"transformers.YosoForQuestionAnswering",title:"YosoForQuestionAnswering"}],title:"YOSO"};function zl(M){return ml(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pl extends ll{constructor(d){super();dl(this,d,zl,Fl,cl,{})}}export{Pl as default,xl as metadata};
