import{S as Kd,i as ec,s as tc,e as n,k as m,w as b,t as r,M as oc,c as s,d as o,m as p,a,x as T,h as i,b as c,N as nc,G as e,g as u,y as w,q as M,o as k,B as V,v as sc,L as Wo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Eo}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Zo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as L}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ao}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ac(x){let d,y,_,g,v;return g=new Zo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpTFRNb2RlbCUyQyUyMFZpTFRDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwVmlMVCUyMGRhbmRlbGluJTJGdmlsdC1iMzItbWxtJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFZpTFRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBkYW5kZWxpbiUyRnZpbHQtYjMyLW1sbSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwVmlMVE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViLTModel, ViLTConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ViLT dandelin/vilt-b32-mlm style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ViLTConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the dandelin/vilt-b32-mlm style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViLTModel(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"),y=r("Example:"),_=m(),b(g.$$.fragment)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Example:"),f.forEach(o),_=p(l),T(g.$$.fragment,l)},m(l,f){u(l,d,f),e(d,y),u(l,_,f),w(g,l,f),v=!0},p:Wo,i(l){v||(M(g.$$.fragment,l),v=!0)},o(l){k(g.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(_),V(g,l)}}}function rc(x){let d,y,_,g,v;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var $=a(_);g=i($,"Module"),$.forEach(o),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,d,f),e(d,y),e(d,_),e(_,g),e(d,v)},d(l){l&&o(d)}}}function ic(x){let d,y,_,g,v;return g=new Zo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpbHRQcm9jZXNzb3IlMkMlMjBWaWx0TW9kZWwlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQSUyMyUyMHByZXBhcmUlMjBpbWFnZSUyMGFuZCUyMHRleHQlMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBdGV4dCUyMCUzRCUyMCUyMmhlbGxvJTIwd29ybGQlMjIlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBWaWx0UHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJkYW5kZWxpbiUyRnZpbHQtYjMyLW1sbSUyMiklMEFtb2RlbCUyMCUzRCUyMFZpbHRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZGFuZGVsaW4lMkZ2aWx0LWIzMi1tbG0lMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViltProcessor, ViltModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare image and text</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;hello world&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ViltProcessor.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-mlm&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViltModel.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-mlm&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, text, 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"),y=r("Examples:"),_=m(),b(g.$$.fragment)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Examples:"),f.forEach(o),_=p(l),T(g.$$.fragment,l)},m(l,f){u(l,d,f),e(d,y),u(l,_,f),w(g,l,f),v=!0},p:Wo,i(l){v||(M(g.$$.fragment,l),v=!0)},o(l){k(g.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(_),V(g,l)}}}function lc(x){let d,y,_,g,v;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var $=a(_);g=i($,"Module"),$.forEach(o),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,d,f),e(d,y),e(d,_),e(_,g),e(d,v)},d(l){l&&o(d)}}}function dc(x){let d,y,_,g,v;return g=new Zo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpbHRQcm9jZXNzb3IlMkMlMjBWaWx0Rm9yTWFza2VkTE0lMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlJTBBaW1wb3J0JTIwdG9yY2glMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBdGV4dCUyMCUzRCUyMCUyMmElMjBidW5jaCUyMG9mJTIwJTVCTUFTSyU1RCUyMGxheWluZyUyMG9uJTIwYSUyMCU1Qk1BU0slNUQuJTIyJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwVmlsdFByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZGFuZGVsaW4lMkZ2aWx0LWIzMi1tbG0lMjIpJTBBbW9kZWwlMjAlM0QlMjBWaWx0Rm9yTWFza2VkTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRhbmRlbGluJTJGdmlsdC1iMzItbWxtJTIyKSUwQSUwQSUyMyUyMHByZXBhcmUlMjBpbnB1dHMlMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZSUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMGZvcndhcmQlMjBwYXNzJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2RpbmcpJTBBJTBBdGwlMjAlM0QlMjBsZW4ocmUuZmluZGFsbCglMjIlNUMlNUJNQVNLJTVDJTVEJTIyJTJDJTIwdGV4dCkpJTBBaW5mZXJyZWRfdG9rZW4lMjAlM0QlMjAlNUJ0ZXh0JTVEJTBBJTBBJTIzJTIwZ3JhZHVhbGx5JTIwZmlsbCUyMGluJTIwdGhlJTIwTUFTSyUyMHRva2VucyUyQyUyMG9uZSUyMGJ5JTIwb25lJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGZvciUyMGklMjBpbiUyMHJhbmdlKHRsKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGVuY29kZWQlMjAlM0QlMjBwcm9jZXNzb3IudG9rZW5pemVyKGluZmVycmVkX3Rva2VuKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGlucHV0X2lkcyUyMCUzRCUyMHRvcmNoLnRlbnNvcihlbmNvZGVkLmlucHV0X2lkcyklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbmNvZGVkJTIwJTNEJTIwZW5jb2RlZCU1QiUyMmlucHV0X2lkcyUyMiU1RCU1QjAlNUQlNUIxJTNBLTElNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwcGl4ZWxfdmFsdWVzJTNEZW5jb2RpbmcucGl4ZWxfdmFsdWVzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1sbV9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyU1QjAlNUQlMjAlMjAlMjMlMjBzaGFwZSUyMChzZXFfbGVuJTJDJTIwdm9jYWJfc2l6ZSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBvbmx5JTIwdGFrZSUyMGludG8lMjBhY2NvdW50JTIwdGV4dCUyMGZlYXR1cmVzJTIwKG1pbnVzJTIwQ0xTJTIwYW5kJTIwU0VQJTIwdG9rZW4pJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWxtX2xvZ2l0cyUyMCUzRCUyMG1sbV9sb2dpdHMlNUIxJTIwJTNBJTIwaW5wdXRfaWRzLnNoYXBlJTVCMSU1RCUyMC0lMjAxJTJDJTIwJTNBJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWxtX3ZhbHVlcyUyQyUyMG1sbV9pZHMlMjAlM0QlMjBtbG1fbG9naXRzLnNvZnRtYXgoZGltJTNELTEpLm1heChkaW0lM0QtMSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBvbmx5JTIwdGFrZSUyMGludG8lMjBhY2NvdW50JTIwdGV4dCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1sbV92YWx1ZXMlNUJ0b3JjaC50ZW5zb3IoZW5jb2RlZCklMjAhJTNEJTIwMTAzJTVEJTIwJTNEJTIwMCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNlbGVjdCUyMCUzRCUyMG1sbV92YWx1ZXMuYXJnbWF4KCkuaXRlbSgpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZW5jb2RlZCU1QnNlbGVjdCU1RCUyMCUzRCUyMG1sbV9pZHMlNUJzZWxlY3QlNUQuaXRlbSgpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaW5mZXJyZWRfdG9rZW4lMjAlM0QlMjAlNUJwcm9jZXNzb3IuZGVjb2RlKGVuY29kZWQpJTVEJTBBJTBBc2VsZWN0ZWRfdG9rZW4lMjAlM0QlMjAlMjIlMjIlMEFlbmNvZGVkJTIwJTNEJTIwcHJvY2Vzc29yLnRva2VuaXplcihpbmZlcnJlZF90b2tlbiklMEFvdXRwdXQlMjAlM0QlMjBwcm9jZXNzb3IuZGVjb2RlKGVuY29kZWQuaW5wdXRfaWRzJTVCMCU1RCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSUwQXByaW50KG91dHB1dCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViltProcessor, ViltForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> re
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;a bunch of [MASK] laying on a [MASK].&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ViltProcessor.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-mlm&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViltForMaskedLM.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-mlm&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(image, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)

<span class="hljs-meta">&gt;&gt;&gt; </span>tl = <span class="hljs-built_in">len</span>(re.findall(<span class="hljs-string">&quot;\\[MASK\\]&quot;</span>, text))
<span class="hljs-meta">&gt;&gt;&gt; </span>inferred_token = [text]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># gradually fill in the MASK tokens, one by one</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(tl):
<span class="hljs-meta">... </span>        encoded = processor.tokenizer(inferred_token)
<span class="hljs-meta">... </span>        input_ids = torch.tensor(encoded.input_ids)
<span class="hljs-meta">... </span>        encoded = encoded[<span class="hljs-string">&quot;input_ids&quot;</span>][<span class="hljs-number">0</span>][<span class="hljs-number">1</span>:-<span class="hljs-number">1</span>]
<span class="hljs-meta">... </span>        outputs = model(input_ids=input_ids, pixel_values=encoding.pixel_values)
<span class="hljs-meta">... </span>        mlm_logits = outputs.logits[<span class="hljs-number">0</span>]  <span class="hljs-comment"># shape (seq_len, vocab_size)</span>
<span class="hljs-meta">... </span>        <span class="hljs-comment"># only take into account text features (minus CLS and SEP token)</span>
<span class="hljs-meta">... </span>        mlm_logits = mlm_logits[<span class="hljs-number">1</span> : input_ids.shape[<span class="hljs-number">1</span>] - <span class="hljs-number">1</span>, :]
<span class="hljs-meta">... </span>        mlm_values, mlm_ids = mlm_logits.softmax(dim=-<span class="hljs-number">1</span>).<span class="hljs-built_in">max</span>(dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>        <span class="hljs-comment"># only take into account text</span>
<span class="hljs-meta">... </span>        mlm_values[torch.tensor(encoded) != <span class="hljs-number">103</span>] = <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>        select = mlm_values.argmax().item()
<span class="hljs-meta">... </span>        encoded[select] = mlm_ids[select].item()
<span class="hljs-meta">... </span>        inferred_token = [processor.decode(encoded)]

<span class="hljs-meta">&gt;&gt;&gt; </span>selected_token = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoded = processor.tokenizer(inferred_token)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = processor.decode(encoded.input_ids[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(output)
a bunch of cats laying on a couch.`}}),{c(){d=n("p"),y=r("Examples:"),_=m(),b(g.$$.fragment)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Examples:"),f.forEach(o),_=p(l),T(g.$$.fragment,l)},m(l,f){u(l,d,f),e(d,y),u(l,_,f),w(g,l,f),v=!0},p:Wo,i(l){v||(M(g.$$.fragment,l),v=!0)},o(l){k(g.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(_),V(g,l)}}}function cc(x){let d,y,_,g,v;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var $=a(_);g=i($,"Module"),$.forEach(o),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,d,f),e(d,y),e(d,_),e(_,g),e(d,v)},d(l){l&&o(d)}}}function mc(x){let d,y,_,g,v;return g=new Zo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpbHRQcm9jZXNzb3IlMkMlMjBWaWx0Rm9yUXVlc3Rpb25BbnN3ZXJpbmclMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEF0ZXh0JTIwJTNEJTIwJTIySG93JTIwbWFueSUyMGNhdHMlMjBhcmUlMjB0aGVyZSUzRiUyMiUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMFZpbHRQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmRhbmRlbGluJTJGdmlsdC1iMzItZmluZXR1bmVkLXZxYSUyMiklMEFtb2RlbCUyMCUzRCUyMFZpbHRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZGFuZGVsaW4lMkZ2aWx0LWIzMi1maW5ldHVuZWQtdnFhJTIyKSUwQSUwQSUyMyUyMHByZXBhcmUlMjBpbnB1dHMlMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZSUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMGZvcndhcmQlMjBwYXNzJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2RpbmcpJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlMEFpZHglMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludCglMjJQcmVkaWN0ZWQlMjBhbnN3ZXIlM0ElMjIlMkMlMjBtb2RlbC5jb25maWcuaWQybGFiZWwlNUJpZHglNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViltProcessor, ViltForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;How many cats are there?&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ViltProcessor.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-finetuned-vqa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViltForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-finetuned-vqa&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(image, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted answer:&quot;</span>, model.config.id2label[idx])
Predicted answer: <span class="hljs-number">2</span>`}}),{c(){d=n("p"),y=r("Examples:"),_=m(),b(g.$$.fragment)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Examples:"),f.forEach(o),_=p(l),T(g.$$.fragment,l)},m(l,f){u(l,d,f),e(d,y),u(l,_,f),w(g,l,f),v=!0},p:Wo,i(l){v||(M(g.$$.fragment,l),v=!0)},o(l){k(g.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(_),V(g,l)}}}function pc(x){let d,y,_,g,v;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var $=a(_);g=i($,"Module"),$.forEach(o),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,d,f),e(d,y),e(d,_),e(_,g),e(d,v)},d(l){l&&o(d)}}}function hc(x){let d,y,_,g,v;return g=new Zo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpbHRQcm9jZXNzb3IlMkMlMjBWaWx0Rm9ySW1hZ2VzQW5kVGV4dENsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFpbWFnZTElMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCglMjJodHRwcyUzQSUyRiUyRmxpbC5ubHAuY29ybmVsbC5lZHUlMkZubHZyJTJGZXhzJTJGZXgwXzAuanBnJTIyJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQWltYWdlMiUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KCUyMmh0dHBzJTNBJTJGJTJGbGlsLm5scC5jb3JuZWxsLmVkdSUyRm5sdnIlMkZleHMlMkZleDBfMS5qcGclMjIlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBdGV4dCUyMCUzRCUyMCUyMlRoZSUyMGxlZnQlMjBpbWFnZSUyMGNvbnRhaW5zJTIwdHdpY2UlMjB0aGUlMjBudW1iZXIlMjBvZiUyMGRvZ3MlMjBhcyUyMHRoZSUyMHJpZ2h0JTIwaW1hZ2UuJTIyJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwVmlsdFByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZGFuZGVsaW4lMkZ2aWx0LWIzMi1maW5ldHVuZWQtbmx2cjIlMjIpJTBBbW9kZWwlMjAlM0QlMjBWaWx0Rm9ySW1hZ2VzQW5kVGV4dENsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJkYW5kZWxpbiUyRnZpbHQtYjMyLWZpbmV0dW5lZC1ubHZyMiUyMiklMEElMEElMjMlMjBwcmVwYXJlJTIwaW5wdXRzJTBBZW5jb2RpbmclMjAlM0QlMjBwcm9jZXNzb3IoJTVCaW1hZ2UxJTJDJTIwaW1hZ2UyJTVEJTJDJTIwdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwZm9yd2FyZCUyMHBhc3MlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzJTNEZW5jb2RpbmcuaW5wdXRfaWRzJTJDJTIwcGl4ZWxfdmFsdWVzJTNEZW5jb2RpbmcucGl4ZWxfdmFsdWVzLnVuc3F1ZWV6ZSgwKSklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWlkeCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KCUyMlByZWRpY3RlZCUyMGFuc3dlciUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QmlkeCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViltProcessor, ViltForImagesAndTextClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>image1 = Image.<span class="hljs-built_in">open</span>(requests.get(<span class="hljs-string">&quot;https://lil.nlp.cornell.edu/nlvr/exs/ex0_0.jpg&quot;</span>, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>image2 = Image.<span class="hljs-built_in">open</span>(requests.get(<span class="hljs-string">&quot;https://lil.nlp.cornell.edu/nlvr/exs/ex0_1.jpg&quot;</span>, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;The left image contains twice the number of dogs as the right image.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ViltProcessor.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-finetuned-nlvr2&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViltForImagesAndTextClassification.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-finetuned-nlvr2&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor([image1, image2], text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids=encoding.input_ids, pixel_values=encoding.pixel_values.unsqueeze(<span class="hljs-number">0</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted answer:&quot;</span>, model.config.id2label[idx])
Predicted answer: <span class="hljs-literal">True</span>`}}),{c(){d=n("p"),y=r("Examples:"),_=m(),b(g.$$.fragment)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Examples:"),f.forEach(o),_=p(l),T(g.$$.fragment,l)},m(l,f){u(l,d,f),e(d,y),u(l,_,f),w(g,l,f),v=!0},p:Wo,i(l){v||(M(g.$$.fragment,l),v=!0)},o(l){k(g.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(_),V(g,l)}}}function fc(x){let d,y,_,g,v;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var $=a(_);g=i($,"Module"),$.forEach(o),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,d,f),e(d,y),e(d,_),e(_,g),e(d,v)},d(l){l&&o(d)}}}function uc(x){let d,y,_,g,v;return g=new Zo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpbHRQcm9jZXNzb3IlMkMlMjBWaWx0Rm9ySW1hZ2VBbmRUZXh0UmV0cmlldmFsJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBdGV4dHMlMjAlM0QlMjAlNUIlMjJBbiUyMGltYWdlJTIwb2YlMjB0d28lMjBjYXRzJTIwY2hpbGxpbmclMjBvbiUyMGElMjBjb3VjaCUyMiUyQyUyMCUyMkElMjBmb290YmFsbCUyMHBsYXllciUyMHNjb3JpbmclMjBhJTIwZ29hbCUyMiU1RCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMFZpbHRQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmRhbmRlbGluJTJGdmlsdC1iMzItZmluZXR1bmVkLWNvY28lMjIpJTBBbW9kZWwlMjAlM0QlMjBWaWx0Rm9ySW1hZ2VBbmRUZXh0UmV0cmlldmFsLmZyb21fcHJldHJhaW5lZCglMjJkYW5kZWxpbiUyRnZpbHQtYjMyLWZpbmV0dW5lZC1jb2NvJTIyKSUwQSUwQSUyMyUyMGZvcndhcmQlMjBwYXNzJTBBc2NvcmVzJTIwJTNEJTIwZGljdCgpJTBBZm9yJTIwdGV4dCUyMGluJTIwdGV4dHMlM0ElMEElMjAlMjAlMjAlMjAlMjMlMjBwcmVwYXJlJTIwaW5wdXRzJTBBJTIwJTIwJTIwJTIwZW5jb2RpbmclMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2UlMkMlMjB0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiplbmNvZGluZyklMEElMjAlMjAlMjAlMjBzY29yZXMlNUJ0ZXh0JTVEJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlNUIwJTJDJTIwJTNBJTVELml0ZW0oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViltProcessor, ViltForImageAndTextRetrieval
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>texts = [<span class="hljs-string">&quot;An image of two cats chilling on a couch&quot;</span>, <span class="hljs-string">&quot;A football player scoring a goal&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ViltProcessor.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-finetuned-coco&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViltForImageAndTextRetrieval.from_pretrained(<span class="hljs-string">&quot;dandelin/vilt-b32-finetuned-coco&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>scores = <span class="hljs-built_in">dict</span>()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> text <span class="hljs-keyword">in</span> texts:
<span class="hljs-meta">... </span>    <span class="hljs-comment"># prepare inputs</span>
<span class="hljs-meta">... </span>    encoding = processor(image, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">... </span>    outputs = model(**encoding)
<span class="hljs-meta">... </span>    scores[text] = outputs.logits[<span class="hljs-number">0</span>, :].item()`}}),{c(){d=n("p"),y=r("Examples:"),_=m(),b(g.$$.fragment)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Examples:"),f.forEach(o),_=p(l),T(g.$$.fragment,l)},m(l,f){u(l,d,f),e(d,y),u(l,_,f),w(g,l,f),v=!0},p:Wo,i(l){v||(M(g.$$.fragment,l),v=!0)},o(l){k(g.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(_),V(g,l)}}}function gc(x){let d,y,_,g,v;return{c(){d=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){d=s(l,"P",{});var f=a(d);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var $=a(_);g=i($,"Module"),$.forEach(o),v=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,d,f),e(d,y),e(d,_),e(_,g),e(d,v)},d(l){l&&o(d)}}}function _c(x){let d,y,_,g,v,l,f,$,Xs,Xn,H,ye,Po,lt,Ds,No,Hs,Dn,be,Ys,dt,Ks,ea,Hn,Kt,ta,Yn,eo,Bo,oa,Kn,to,na,es,A,ct,sa,mt,aa,ra,ia,R,la,Lo,da,ca,Ro,ma,pa,oo,ha,fa,ua,Y,ga,So,_a,va,no,ya,ba,Ta,Go,wa,ts,Te,Ml,os,we,Ma,so,ka,Va,ns,Q,xa,pt,$a,ja,ht,Ia,Fa,ss,ao,za,as,ro,Oo,Ca,rs,K,Me,qo,ft,Ua,Qo,Ja,is,F,ut,Ea,ee,Aa,Xo,Wa,Za,gt,Pa,Na,Ba,te,La,io,Ra,Sa,lo,Ga,Oa,qa,ke,ls,oe,Ve,Do,_t,Qa,Ho,Xa,ds,ne,vt,Da,xe,yt,Ha,Yo,Ya,cs,se,$e,Ko,bt,Ka,en,er,ms,S,Tt,tr,tn,or,nr,je,wt,sr,on,ar,ps,ae,Ie,nn,Mt,rr,sn,ir,hs,z,kt,lr,an,dr,cr,I,co,mr,pr,mo,hr,fr,po,ur,gr,Vt,rn,_r,vr,yr,ln,br,Tr,wr,X,xt,Mr,re,kr,Fe,Vr,dn,xr,$r,jr,ze,Ir,cn,Fr,zr,Cr,Ur,mn,Jr,fs,ie,Ce,pn,$t,Er,hn,Ar,us,G,jt,Wr,It,Zr,fn,Pr,Nr,Br,W,Ft,Lr,le,Rr,ho,Sr,Gr,un,Or,qr,Qr,Ue,Xr,Je,gs,de,Ee,gn,zt,Dr,_n,Hr,_s,C,Ct,Yr,vn,Kr,ei,Ut,ti,yn,oi,ni,si,Z,Jt,ai,ce,ri,fo,ii,li,bn,di,ci,mi,Ae,pi,We,vs,me,Ze,Tn,Et,hi,wn,fi,ys,U,At,ui,Mn,gi,_i,Wt,vi,kn,yi,bi,Ti,P,Zt,wi,pe,Mi,uo,ki,Vi,Vn,xi,$i,ji,Pe,Ii,Ne,bs,he,Be,xn,Pt,Fi,$n,zi,Ts,O,Nt,Ci,jn,Ui,Ji,N,Bt,Ei,fe,Ai,go,Wi,Zi,In,Pi,Ni,Bi,Le,Li,Re,ws,ue,Se,Fn,Lt,Ri,zn,Si,Ms,J,Rt,Gi,Cn,Oi,qi,St,Qi,Un,Xi,Di,Hi,B,Gt,Yi,ge,Ki,_o,el,tl,Jn,ol,nl,sl,Ge,al,Oe,ks,_e,qe,En,Ot,rl,An,il,Vs,E,qt,ll,Wn,dl,cl,Qt,ml,Zn,pl,hl,fl,D,Xt,ul,ve,gl,vo,_l,vl,Pn,yl,bl,Tl,Qe,xs;return l=new L({}),lt=new L({}),ft=new L({}),ut=new j({props:{name:"class transformers.ViltConfig",anchor:"transformers.ViltConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"type_vocab_size",val:" = 2"},{name:"modality_type_vocab_size",val:" = 2"},{name:"max_position_embeddings",val:" = 40"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"image_size",val:" = 384"},{name:"patch_size",val:" = 32"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"max_image_length",val:" = -1"},{name:"tie_word_embeddings",val:" = False"},{name:"num_images",val:" = -1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViltConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the text part of the 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.32.0/en/model_doc/vilt#transformers.ViltModel">ViltModel</a>.`,name:"vocab_size"},{anchor:"transformers.ViltConfig.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.32.0/en/model_doc/vilt#transformers.ViltModel">ViltModel</a>. This is used when encoding
text.`,name:"type_vocab_size"},{anchor:"transformers.ViltConfig.modality_type_vocab_size",description:`<strong>modality_type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the modalities passed when calling <a href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltModel">ViltModel</a>. This is used after concatening the
embeddings of the text and image modalities.`,name:"modality_type_vocab_size"},{anchor:"transformers.ViltConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 40) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.ViltConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.ViltConfig.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.ViltConfig.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.ViltConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ViltConfig.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.ViltConfig.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.ViltConfig.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.ViltConfig.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.ViltConfig.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.ViltConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 384) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.ViltConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.ViltConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.ViltConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.ViltConfig.max_image_length",description:`<strong>max_image_length</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
The maximum number of patches to take as input for the Transformer encoder. If set to a positive integer,
the encoder will sample <code>max_image_length</code> patches at maximum. If set to -1, will not be taken into
account.`,name:"max_image_length"},{anchor:"transformers.ViltConfig.num_images",description:`<strong>num_images</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
The number of images to use for natural language visual reasoning. If set to a positive integer, will be
used by <a href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltForImagesAndTextClassification">ViltForImagesAndTextClassification</a> for defining the classifier head.`,name:"num_images"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/configuration_vilt.py#L28"}}),ke=new Ao({props:{anchor:"transformers.ViltConfig.example",$$slots:{default:[ac]},$$scope:{ctx:x}}}),_t=new L({}),vt=new j({props:{name:"class transformers.ViltFeatureExtractor",anchor:"transformers.ViltFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/feature_extraction_vilt.py#L26"}}),yt=new j({props:{name:"__call__",anchor:"transformers.ViltFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/image_processing_utils.py#L544"}}),bt=new L({}),Tt=new j({props:{name:"class transformers.ViltImageProcessor",anchor:"transformers.ViltImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"size_divisor",val:": int = 32"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_pad",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViltImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.ViltImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 384}</code>):
Resize the shorter side of the input to <code>size[&quot;shortest_edge&quot;]</code>. The longer side will be limited to under
<code>int((1333 / 800) * size[&quot;shortest_edge&quot;])</code> while preserving the aspect ratio. Only has an effect if
<code>do_resize</code> is set to <code>True</code>. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.ViltImageProcessor.size_divisor",description:`<strong>size_divisor</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size by which to make sure both the height and width can be divided. Only has an effect if <code>do_resize</code>
is set to <code>True</code>. Can be overridden by the <code>size_divisor</code> parameter in the <code>preprocess</code> method.`,name:"size_divisor"},{anchor:"transformers.ViltImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>. Can be
overridden by the <code>resample</code> parameter in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.ViltImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Wwhether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the
<code>do_rescale</code> parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.ViltImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>. Can be
overridden by the <code>rescale_factor</code> parameter in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.ViltImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.ViltImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method. Can be
overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.ViltImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.ViltImageProcessor.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to pad the image to the <code>(max_height, max_width)</code> of the images in the batch. Can be overridden by
the <code>do_pad</code> parameter in the <code>preprocess</code> method.`,name:"do_pad"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/image_processing_vilt.py#L119"}}),wt=new j({props:{name:"preprocess",anchor:"transformers.ViltImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"size_divisor",val:": typing.Optional[int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_pad",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViltImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.ViltImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ViltImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Controls the size of the image after <code>resize</code>. The shortest edge of the image is resized to
<code>size[&quot;shortest_edge&quot;]</code> whilst preserving the aspect ratio. If the longest edge of this resized image
is &gt; <code>int(size[&quot;shortest_edge&quot;] * (1333 / 800))</code>, then the image is resized again to make the longest
edge equal to <code>int(size[&quot;shortest_edge&quot;] * (1333 / 800))</code>.`,name:"size"},{anchor:"transformers.ViltImageProcessor.preprocess.size_divisor",description:`<strong>size_divisor</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.size_divisor</code>) &#x2014;
The image is resized to a size that is a multiple of this value.`,name:"size_divisor"},{anchor:"transformers.ViltImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ViltImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.ViltImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.ViltImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ViltImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to normalize the image by if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ViltImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to normalize the image by if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.ViltImageProcessor.preprocess.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_pad</code>) &#x2014;
Whether to pad the image to the (max_height, max_width) in the batch. If <code>True</code>, a pixel mask is also
created and returned.`,name:"do_pad"},{anchor:"transformers.ViltImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.ViltImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"},{anchor:"transformers.ViltImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/image_processing_vilt.py#L337"}}),Mt=new L({}),kt=new j({props:{name:"class transformers.ViltProcessor",anchor:"transformers.ViltProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ViltProcessor.image_processor",description:`<strong>image_processor</strong> (<code>ViltImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltImageProcessor">ViltImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.ViltProcessor.tokenizer",description:"<strong>tokenizer</strong> (<code>BertTokenizerFast</code>) &#x2014;\nAn instance of [&#x2018;BertTokenizerFast`]. The tokenizer is a required input.",name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/processing_vilt.py#L27"}}),xt=new j({props:{name:"__call__",anchor:"transformers.ViltProcessor.__call__",parameters:[{name:"images",val:""},{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/processing_vilt.py#L63"}}),$t=new L({}),jt=new j({props:{name:"class transformers.ViltModel",anchor:"transformers.ViltModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.ViltModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltConfig">ViltConfig</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.32.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.32.0/src/transformers/models/vilt/modeling_vilt.py#L725"}}),Ft=new j({props:{name:"forward",anchor:"transformers.ViltModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_token_type_idx",val:": typing.Optional[int] = 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.ViltModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.ViltModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ViltModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.ViltModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViltImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViltModel.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.ViltModel.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.ViltModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ViltModel.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.ViltModel.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.ViltModel.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.ViltModel.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.32.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.32.0/src/transformers/models/vilt/modeling_vilt.py#L753",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltConfig"
>ViltConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new Eo({props:{$$slots:{default:[rc]},$$scope:{ctx:x}}}),Je=new Ao({props:{anchor:"transformers.ViltModel.forward.example",$$slots:{default:[ic]},$$scope:{ctx:x}}}),zt=new L({}),Ct=new j({props:{name:"class transformers.ViltForMaskedLM",anchor:"transformers.ViltForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViltForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltConfig">ViltConfig</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.32.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.32.0/src/transformers/models/vilt/modeling_vilt.py#L891"}}),Jt=new j({props:{name:"forward",anchor:"transformers.ViltForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.ViltForMaskedLM.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. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.ViltForMaskedLM.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>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ViltForMaskedLM.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.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.ViltForMaskedLM.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViltImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViltForMaskedLM.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.ViltForMaskedLM.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.ViltForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ViltForMaskedLM.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.ViltForMaskedLM.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.ViltForMaskedLM.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.ViltForMaskedLM.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ViltForMaskedLM.forward.labels",description:`<strong>labels</strong> (<em>torch.LongTensor</em> of shape <em>(batch_size, sequence_length)</em>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <em>[-100, 0, &#x2026;,
config.vocab_size]</em> (see <em>input_ids</em> docstring) Tokens with indices set to <em>-100</em> are ignored (masked), the
loss is only computed for the tokens with labels in <em>[0, &#x2026;, config.vocab_size]</em>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/modeling_vilt.py#L909",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.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.32.0/en/model_doc/vilt#transformers.ViltConfig"
>ViltConfig</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.32.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ae=new Eo({props:{$$slots:{default:[lc]},$$scope:{ctx:x}}}),We=new Ao({props:{anchor:"transformers.ViltForMaskedLM.forward.example",$$slots:{default:[dc]},$$scope:{ctx:x}}}),Et=new L({}),At=new j({props:{name:"class transformers.ViltForQuestionAnswering",anchor:"transformers.ViltForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViltForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltConfig">ViltConfig</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.32.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.32.0/src/transformers/models/vilt/modeling_vilt.py#L1067"}}),Zt=new j({props:{name:"forward",anchor:"transformers.ViltForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.ViltForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.ViltForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ViltForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.ViltForQuestionAnswering.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViltImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViltForQuestionAnswering.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.ViltForQuestionAnswering.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.ViltForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ViltForQuestionAnswering.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.ViltForQuestionAnswering.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.ViltForQuestionAnswering.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.ViltForQuestionAnswering.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ViltForQuestionAnswering.forward.labels",description:`<strong>labels</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_labels)</code>, <em>optional</em>) &#x2014;
Labels for computing the visual question answering loss. This tensor must be either a one-hot encoding of
all answers that are applicable for a given example in the batch, or a soft encoding indicating which
answers are applicable, where 1.0 is the highest score.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/modeling_vilt.py#L1085",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.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.32.0/en/model_doc/vilt#transformers.ViltConfig"
>ViltConfig</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.32.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new Eo({props:{$$slots:{default:[cc]},$$scope:{ctx:x}}}),Ne=new Ao({props:{anchor:"transformers.ViltForQuestionAnswering.forward.example",$$slots:{default:[mc]},$$scope:{ctx:x}}}),Pt=new L({}),Nt=new j({props:{name:"class transformers.ViltForImagesAndTextClassification",anchor:"transformers.ViltForImagesAndTextClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViltForImagesAndTextClassification.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.ViltForImagesAndTextClassification.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ViltForImagesAndTextClassification.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.ViltForImagesAndTextClassification.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_images, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViltImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViltForImagesAndTextClassification.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_images, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.ViltForImagesAndTextClassification.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.ViltForImagesAndTextClassification.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ViltForImagesAndTextClassification.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_images, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.ViltForImagesAndTextClassification.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.ViltForImagesAndTextClassification.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.ViltForImagesAndTextClassification.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.32.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.32.0/src/transformers/models/vilt/modeling_vilt.py#L1281"}}),Bt=new j({props:{name:"forward",anchor:"transformers.ViltForImagesAndTextClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.ViltForImagesAndTextClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.ViltForImagesAndTextClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ViltForImagesAndTextClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.ViltForImagesAndTextClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViltImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViltForImagesAndTextClassification.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.ViltForImagesAndTextClassification.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.ViltForImagesAndTextClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ViltForImagesAndTextClassification.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.ViltForImagesAndTextClassification.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.ViltForImagesAndTextClassification.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.ViltForImagesAndTextClassification.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ViltForImagesAndTextClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Binary classification labels.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/modeling_vilt.py#L1300",returnDescription:`
<p>A <code>transformers.models.vilt.modeling_vilt.ViltForImagesAndTextClassificationOutput</code> 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.32.0/en/model_doc/vilt#transformers.ViltConfig"
>ViltConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><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).</li>
<li><strong>hidden_states</strong> (<code>List[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 List of tuples of <code>torch.FloatTensor</code> (one for each image-text pair, each tuple containing the output of
the embeddings + one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.
Hidden-states of the model at the output of each layer plus the initial embedding outputs.</li>
<li><strong>attentions</strong> (<code>List[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 List of tuples of <code>torch.FloatTensor</code> (one for each image-text pair, each tuple containing the attention
weights of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the
attention softmax, used to compute the weighted average in the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.vilt.modeling_vilt.ViltForImagesAndTextClassificationOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Le=new Eo({props:{$$slots:{default:[pc]},$$scope:{ctx:x}}}),Re=new Ao({props:{anchor:"transformers.ViltForImagesAndTextClassification.forward.example",$$slots:{default:[hc]},$$scope:{ctx:x}}}),Lt=new L({}),Rt=new j({props:{name:"class transformers.ViltForImageAndTextRetrieval",anchor:"transformers.ViltForImageAndTextRetrieval",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViltForImageAndTextRetrieval.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltConfig">ViltConfig</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.32.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.32.0/src/transformers/models/vilt/modeling_vilt.py#L1180"}}),Gt=new j({props:{name:"forward",anchor:"transformers.ViltForImageAndTextRetrieval.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.ViltForImageAndTextRetrieval.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.ViltForImageAndTextRetrieval.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ViltForImageAndTextRetrieval.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.ViltForImageAndTextRetrieval.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViltImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViltForImageAndTextRetrieval.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.ViltForImageAndTextRetrieval.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.ViltForImageAndTextRetrieval.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ViltForImageAndTextRetrieval.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.ViltForImageAndTextRetrieval.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.ViltForImageAndTextRetrieval.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.ViltForImageAndTextRetrieval.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ViltForImageAndTextRetrieval.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels are currently not supported.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/vilt/modeling_vilt.py#L1192",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.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.32.0/en/model_doc/vilt#transformers.ViltConfig"
>ViltConfig</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.32.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new Eo({props:{$$slots:{default:[fc]},$$scope:{ctx:x}}}),Oe=new Ao({props:{anchor:"transformers.ViltForImageAndTextRetrieval.forward.example",$$slots:{default:[uc]},$$scope:{ctx:x}}}),Ot=new L({}),qt=new j({props:{name:"class transformers.ViltForTokenClassification",anchor:"transformers.ViltForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ViltForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltConfig">ViltConfig</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.32.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.32.0/src/transformers/models/vilt/modeling_vilt.py#L1423"}}),Xt=new j({props:{name:"forward",anchor:"transformers.ViltForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.ViltForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.ViltForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.ViltForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>({0})</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.
<a href="../glossary#token-type-ids">What are token type IDs?</a></li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.ViltForTokenClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ViltImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ViltForTokenClassification.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).
<code>What are attention masks? &lt;../glossary.html#attention-mask&gt;</code>__</li>
</ul>`,name:"pixel_mask"},{anchor:"transformers.ViltForTokenClassification.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.ViltForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>({0}, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ViltForTokenClassification.forward.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>pixel_values</code>, you can choose to directly pass an embedded representation.
This is useful if you want more control over how to convert <code>pixel_values</code> into patch embeddings.`,name:"image_embeds"},{anchor:"transformers.ViltForTokenClassification.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.ViltForTokenClassification.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.ViltForTokenClassification.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.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ViltForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_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.32.0/src/transformers/models/vilt/modeling_vilt.py#L1436",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.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.32.0/en/model_doc/vilt#transformers.ViltConfig"
>ViltConfig</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.32.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qe=new Eo({props:{$$slots:{default:[gc]},$$scope:{ctx:x}}}),{c(){d=n("meta"),y=m(),_=n("h1"),g=n("a"),v=n("span"),b(l.$$.fragment),f=m(),$=n("span"),Xs=r("ViLT"),Xn=m(),H=n("h2"),ye=n("a"),Po=n("span"),b(lt.$$.fragment),Ds=m(),No=n("span"),Hs=r("Overview"),Dn=m(),be=n("p"),Ys=r("The ViLT model was proposed in "),dt=n("a"),Ks=r("ViLT: Vision-and-Language Transformer Without Convolution or Region Supervision"),ea=r(`
by Wonjae Kim, Bokyung Son, Ildoo Kim. ViLT incorporates text embeddings into a Vision Transformer (ViT), allowing it to have a minimal design
for Vision-and-Language Pre-training (VLP).`),Hn=m(),Kt=n("p"),ta=r("The abstract from the paper is the following:"),Yn=m(),eo=n("p"),Bo=n("em"),oa=r(`Vision-and-Language Pre-training (VLP) has improved performance on various joint vision-and-language downstream tasks.
Current approaches to VLP heavily rely on image feature extraction processes, most of which involve region supervision
(e.g., object detection) and the convolutional architecture (e.g., ResNet). Although disregarded in the literature, we
find it problematic in terms of both (1) efficiency/speed, that simply extracting input features requires much more
computation than the multimodal interaction steps; and (2) expressive power, as it is upper bounded to the expressive
power of the visual embedder and its predefined visual vocabulary. In this paper, we present a minimal VLP model,
Vision-and-Language Transformer (ViLT), monolithic in the sense that the processing of visual inputs is drastically
simplified to just the same convolution-free manner that we process textual inputs. We show that ViLT is up to tens of
times faster than previous VLP models, yet with competitive or better downstream task performance.`),Kn=m(),to=n("p"),na=r("Tips:"),es=m(),A=n("ul"),ct=n("li"),sa=r("The quickest way to get started with ViLT is by checking the "),mt=n("a"),aa=r("example notebooks"),ra=r(`
(which showcase both inference and fine-tuning on custom data).`),ia=m(),R=n("li"),la=r("ViLT is a model that takes both "),Lo=n("code"),da=r("pixel_values"),ca=r(" and "),Ro=n("code"),ma=r("input_ids"),pa=r(" as input. One can use "),oo=n("a"),ha=r("ViltProcessor"),fa=r(` to prepare data for the model.
This processor wraps a image processor (for the image modality) and a tokenizer (for the language modality) into one.`),ua=m(),Y=n("li"),ga=r(`ViLT is trained with images of various sizes: the authors resize the shorter edge of input images to 384 and limit the longer edge to
under 640 while preserving the aspect ratio. To make batching of images possible, the authors use a `),So=n("code"),_a=r("pixel_mask"),va=r(` that indicates
which pixel values are real and which are padding. `),no=n("a"),ya=r("ViltProcessor"),ba=r(" automatically creates this for you."),Ta=m(),Go=n("li"),wa=r(`The design of ViLT is very similar to that of a standard Vision Transformer (ViT). The only difference is that the model includes
additional embedding layers for the language modality.`),ts=m(),Te=n("img"),os=m(),we=n("small"),Ma=r("ViLT architecture. Taken from the "),so=n("a"),ka=r("original paper"),Va=r("."),ns=m(),Q=n("p"),xa=r("This model was contributed by "),pt=n("a"),$a=r("nielsr"),ja=r(". The original code can be found "),ht=n("a"),Ia=r("here"),Fa=r("."),ss=m(),ao=n("p"),za=r("Tips:"),as=m(),ro=n("ul"),Oo=n("li"),Ca=r("The PyTorch version of this model is only available in torch 1.10 and higher."),rs=m(),K=n("h2"),Me=n("a"),qo=n("span"),b(ft.$$.fragment),Ua=m(),Qo=n("span"),Ja=r("ViltConfig"),is=m(),F=n("div"),b(ut.$$.fragment),Ea=m(),ee=n("p"),Aa=r("This is the configuration class to store the configuration of a "),Xo=n("code"),Wa=r("ViLTModel"),Za=r(`. It is used to instantiate an ViLT
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 ViLT
`),gt=n("a"),Pa=r("dandelin/vilt-b32-mlm"),Na=r(" architecture."),Ba=m(),te=n("p"),La=r("Configuration objects inherit from "),io=n("a"),Ra=r("PretrainedConfig"),Sa=r(` and can be used to control the model outputs. Read the
documentation from `),lo=n("a"),Ga=r("PretrainedConfig"),Oa=r(" for more information."),qa=m(),b(ke.$$.fragment),ls=m(),oe=n("h2"),Ve=n("a"),Do=n("span"),b(_t.$$.fragment),Qa=m(),Ho=n("span"),Xa=r("ViltFeatureExtractor"),ds=m(),ne=n("div"),b(vt.$$.fragment),Da=m(),xe=n("div"),b(yt.$$.fragment),Ha=m(),Yo=n("p"),Ya=r("Preprocess an image or a batch of images."),cs=m(),se=n("h2"),$e=n("a"),Ko=n("span"),b(bt.$$.fragment),Ka=m(),en=n("span"),er=r("ViltImageProcessor"),ms=m(),S=n("div"),b(Tt.$$.fragment),tr=m(),tn=n("p"),or=r("Constructs a ViLT image processor."),nr=m(),je=n("div"),b(wt.$$.fragment),sr=m(),on=n("p"),ar=r("Preprocess an image or batch of images."),ps=m(),ae=n("h2"),Ie=n("a"),nn=n("span"),b(Mt.$$.fragment),rr=m(),sn=n("span"),ir=r("ViltProcessor"),hs=m(),z=n("div"),b(kt.$$.fragment),lr=m(),an=n("p"),dr=r("Constructs a ViLT processor which wraps a BERT tokenizer and ViLT image processor into a single processor."),cr=m(),I=n("p"),co=n("a"),mr=r("ViltProcessor"),pr=r(" offers all the functionalities of "),mo=n("a"),hr=r("ViltImageProcessor"),fr=r(" and "),po=n("a"),ur=r("BertTokenizerFast"),gr=r(`. See the
docstring of `),Vt=n("a"),rn=n("strong"),_r=r("call"),vr=r("()"),yr=r(" and "),ln=n("code"),br=r("decode()"),Tr=r(" for more information."),wr=m(),X=n("div"),b(xt.$$.fragment),Mr=m(),re=n("p"),kr=r("This method uses "),Fe=n("a"),Vr=r("ViltImageProcessor."),dn=n("strong"),xr=r("call"),$r=r("()"),jr=r(` method to prepare image(s) for the model, and
`),ze=n("a"),Ir=r("BertTokenizerFast."),cn=n("strong"),Fr=r("call"),zr=r("()"),Cr=r(" to prepare text for the model."),Ur=m(),mn=n("p"),Jr=r("Please refer to the docstring of the above two methods for more information."),fs=m(),ie=n("h2"),Ce=n("a"),pn=n("span"),b($t.$$.fragment),Er=m(),hn=n("span"),Ar=r("ViltModel"),us=m(),G=n("div"),b(jt.$$.fragment),Wr=m(),It=n("p"),Zr=r(`The bare ViLT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),fn=n("code"),Pr=r("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Nr=r(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Br=m(),W=n("div"),b(Ft.$$.fragment),Lr=m(),le=n("p"),Rr=r("The "),ho=n("a"),Sr=r("ViltModel"),Gr=r(" forward method, overrides the "),un=n("code"),Or=r("__call__"),qr=r(" special method."),Qr=m(),b(Ue.$$.fragment),Xr=m(),b(Je.$$.fragment),gs=m(),de=n("h2"),Ee=n("a"),gn=n("span"),b(zt.$$.fragment),Dr=m(),_n=n("span"),Hr=r("ViltForMaskedLM"),_s=m(),C=n("div"),b(Ct.$$.fragment),Yr=m(),vn=n("p"),Kr=r("ViLT Model with a language modeling head on top as done during pretraining."),ei=m(),Ut=n("p"),ti=r("This model is a PyTorch "),yn=n("code"),oi=r("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),ni=r(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),si=m(),Z=n("div"),b(Jt.$$.fragment),ai=m(),ce=n("p"),ri=r("The "),fo=n("a"),ii=r("ViltForMaskedLM"),li=r(" forward method, overrides the "),bn=n("code"),di=r("__call__"),ci=r(" special method."),mi=m(),b(Ae.$$.fragment),pi=m(),b(We.$$.fragment),vs=m(),me=n("h2"),Ze=n("a"),Tn=n("span"),b(Et.$$.fragment),hi=m(),wn=n("span"),fi=r("ViltForQuestionAnswering"),ys=m(),U=n("div"),b(At.$$.fragment),ui=m(),Mn=n("p"),gi=r(`Vilt Model transformer with a classifier head on top (a linear layer on top of the final hidden state of the [CLS]
token) for visual question answering, e.g. for VQAv2.`),_i=m(),Wt=n("p"),vi=r("This model is a PyTorch "),kn=n("code"),yi=r("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),bi=r(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ti=m(),P=n("div"),b(Zt.$$.fragment),wi=m(),pe=n("p"),Mi=r("The "),uo=n("a"),ki=r("ViltForQuestionAnswering"),Vi=r(" forward method, overrides the "),Vn=n("code"),xi=r("__call__"),$i=r(" special method."),ji=m(),b(Pe.$$.fragment),Ii=m(),b(Ne.$$.fragment),bs=m(),he=n("h2"),Be=n("a"),xn=n("span"),b(Pt.$$.fragment),Fi=m(),$n=n("span"),zi=r("ViltForImagesAndTextClassification"),Ts=m(),O=n("div"),b(Nt.$$.fragment),Ci=m(),jn=n("p"),Ui=r("Vilt Model transformer with a classifier head on top for natural language visual reasoning, e.g. NLVR2."),Ji=m(),N=n("div"),b(Bt.$$.fragment),Ei=m(),fe=n("p"),Ai=r("The "),go=n("a"),Wi=r("ViltForImagesAndTextClassification"),Zi=r(" forward method, overrides the "),In=n("code"),Pi=r("__call__"),Ni=r(" special method."),Bi=m(),b(Le.$$.fragment),Li=m(),b(Re.$$.fragment),ws=m(),ue=n("h2"),Se=n("a"),Fn=n("span"),b(Lt.$$.fragment),Ri=m(),zn=n("span"),Si=r("ViltForImageAndTextRetrieval"),Ms=m(),J=n("div"),b(Rt.$$.fragment),Gi=m(),Cn=n("p"),Oi=r(`Vilt Model transformer with a classifier head on top (a linear layer on top of the final hidden state of the [CLS]
token) for image-to-text or text-to-image retrieval, e.g. MSCOCO and F30K.`),qi=m(),St=n("p"),Qi=r("This model is a PyTorch "),Un=n("code"),Xi=r("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Di=r(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Hi=m(),B=n("div"),b(Gt.$$.fragment),Yi=m(),ge=n("p"),Ki=r("The "),_o=n("a"),el=r("ViltForImageAndTextRetrieval"),tl=r(" forward method, overrides the "),Jn=n("code"),ol=r("__call__"),nl=r(" special method."),sl=m(),b(Ge.$$.fragment),al=m(),b(Oe.$$.fragment),ks=m(),_e=n("h2"),qe=n("a"),En=n("span"),b(Ot.$$.fragment),rl=m(),An=n("span"),il=r("ViltForTokenClassification"),Vs=m(),E=n("div"),b(qt.$$.fragment),ll=m(),Wn=n("p"),dl=r(`ViLT Model with a token classification head on top (a linear layer on top of the final hidden-states of the text
tokens) e.g. for Named-Entity-Recognition (NER) tasks.`),cl=m(),Qt=n("p"),ml=r("This model is a PyTorch "),Zn=n("code"),pl=r("torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),hl=r(`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),fl=m(),D=n("div"),b(Xt.$$.fragment),ul=m(),ve=n("p"),gl=r("The "),vo=n("a"),_l=r("ViltForTokenClassification"),vl=r(" forward method, overrides the "),Pn=n("code"),yl=r("__call__"),bl=r(" special method."),Tl=m(),b(Qe.$$.fragment),this.h()},l(t){const h=oc('[data-svelte="svelte-1phssyn"]',document.head);d=s(h,"META",{name:!0,content:!0}),h.forEach(o),y=p(t),_=s(t,"H1",{class:!0});var Dt=a(_);g=s(Dt,"A",{id:!0,class:!0,href:!0});var Nn=a(g);v=s(Nn,"SPAN",{});var Bn=a(v);T(l.$$.fragment,Bn),Bn.forEach(o),Nn.forEach(o),f=p(Dt),$=s(Dt,"SPAN",{});var Ln=a($);Xs=i(Ln,"ViLT"),Ln.forEach(o),Dt.forEach(o),Xn=p(t),H=s(t,"H2",{class:!0});var Ht=a(H);ye=s(Ht,"A",{id:!0,class:!0,href:!0});var Rn=a(ye);Po=s(Rn,"SPAN",{});var Sn=a(Po);T(lt.$$.fragment,Sn),Sn.forEach(o),Rn.forEach(o),Ds=p(Ht),No=s(Ht,"SPAN",{});var Gn=a(No);Hs=i(Gn,"Overview"),Gn.forEach(o),Ht.forEach(o),Dn=p(t),be=s(t,"P",{});var Yt=a(be);Ys=i(Yt,"The ViLT model was proposed in "),dt=s(Yt,"A",{href:!0,rel:!0});var On=a(dt);Ks=i(On,"ViLT: Vision-and-Language Transformer Without Convolution or Region Supervision"),On.forEach(o),ea=i(Yt,`
by Wonjae Kim, Bokyung Son, Ildoo Kim. ViLT incorporates text embeddings into a Vision Transformer (ViT), allowing it to have a minimal design
for Vision-and-Language Pre-training (VLP).`),Yt.forEach(o),Hn=p(t),Kt=s(t,"P",{});var qn=a(Kt);ta=i(qn,"The abstract from the paper is the following:"),qn.forEach(o),Yn=p(t),eo=s(t,"P",{});var Qn=a(eo);Bo=s(Qn,"EM",{});var kl=a(Bo);oa=i(kl,`Vision-and-Language Pre-training (VLP) has improved performance on various joint vision-and-language downstream tasks.
Current approaches to VLP heavily rely on image feature extraction processes, most of which involve region supervision
(e.g., object detection) and the convolutional architecture (e.g., ResNet). Although disregarded in the literature, we
find it problematic in terms of both (1) efficiency/speed, that simply extracting input features requires much more
computation than the multimodal interaction steps; and (2) expressive power, as it is upper bounded to the expressive
power of the visual embedder and its predefined visual vocabulary. In this paper, we present a minimal VLP model,
Vision-and-Language Transformer (ViLT), monolithic in the sense that the processing of visual inputs is drastically
simplified to just the same convolution-free manner that we process textual inputs. We show that ViLT is up to tens of
times faster than previous VLP models, yet with competitive or better downstream task performance.`),kl.forEach(o),Qn.forEach(o),Kn=p(t),to=s(t,"P",{});var Vl=a(to);na=i(Vl,"Tips:"),Vl.forEach(o),es=p(t),A=s(t,"UL",{});var Xe=a(A);ct=s(Xe,"LI",{});var $s=a(ct);sa=i($s,"The quickest way to get started with ViLT is by checking the "),mt=s($s,"A",{href:!0,rel:!0});var xl=a(mt);aa=i(xl,"example notebooks"),xl.forEach(o),ra=i($s,`
(which showcase both inference and fine-tuning on custom data).`),$s.forEach(o),ia=p(Xe),R=s(Xe,"LI",{});var De=a(R);la=i(De,"ViLT is a model that takes both "),Lo=s(De,"CODE",{});var $l=a(Lo);da=i($l,"pixel_values"),$l.forEach(o),ca=i(De," and "),Ro=s(De,"CODE",{});var jl=a(Ro);ma=i(jl,"input_ids"),jl.forEach(o),pa=i(De," as input. One can use "),oo=s(De,"A",{href:!0});var Il=a(oo);ha=i(Il,"ViltProcessor"),Il.forEach(o),fa=i(De,` to prepare data for the model.
This processor wraps a image processor (for the image modality) and a tokenizer (for the language modality) into one.`),De.forEach(o),ua=p(Xe),Y=s(Xe,"LI",{});var yo=a(Y);ga=i(yo,`ViLT is trained with images of various sizes: the authors resize the shorter edge of input images to 384 and limit the longer edge to
under 640 while preserving the aspect ratio. To make batching of images possible, the authors use a `),So=s(yo,"CODE",{});var Fl=a(So);_a=i(Fl,"pixel_mask"),Fl.forEach(o),va=i(yo,` that indicates
which pixel values are real and which are padding. `),no=s(yo,"A",{href:!0});var zl=a(no);ya=i(zl,"ViltProcessor"),zl.forEach(o),ba=i(yo," automatically creates this for you."),yo.forEach(o),Ta=p(Xe),Go=s(Xe,"LI",{});var Cl=a(Go);wa=i(Cl,`The design of ViLT is very similar to that of a standard Vision Transformer (ViT). The only difference is that the model includes
additional embedding layers for the language modality.`),Cl.forEach(o),Xe.forEach(o),ts=p(t),Te=s(t,"IMG",{src:!0,alt:!0,width:!0}),os=p(t),we=s(t,"SMALL",{});var js=a(we);Ma=i(js,"ViLT architecture. Taken from the "),so=s(js,"A",{href:!0});var Ul=a(so);ka=i(Ul,"original paper"),Ul.forEach(o),Va=i(js,"."),js.forEach(o),ns=p(t),Q=s(t,"P",{});var bo=a(Q);xa=i(bo,"This model was contributed by "),pt=s(bo,"A",{href:!0,rel:!0});var Jl=a(pt);$a=i(Jl,"nielsr"),Jl.forEach(o),ja=i(bo,". The original code can be found "),ht=s(bo,"A",{href:!0,rel:!0});var El=a(ht);Ia=i(El,"here"),El.forEach(o),Fa=i(bo,"."),bo.forEach(o),ss=p(t),ao=s(t,"P",{});var Al=a(ao);za=i(Al,"Tips:"),Al.forEach(o),as=p(t),ro=s(t,"UL",{});var Wl=a(ro);Oo=s(Wl,"LI",{});var Zl=a(Oo);Ca=i(Zl,"The PyTorch version of this model is only available in torch 1.10 and higher."),Zl.forEach(o),Wl.forEach(o),rs=p(t),K=s(t,"H2",{class:!0});var Is=a(K);Me=s(Is,"A",{id:!0,class:!0,href:!0});var Pl=a(Me);qo=s(Pl,"SPAN",{});var Nl=a(qo);T(ft.$$.fragment,Nl),Nl.forEach(o),Pl.forEach(o),Ua=p(Is),Qo=s(Is,"SPAN",{});var Bl=a(Qo);Ja=i(Bl,"ViltConfig"),Bl.forEach(o),Is.forEach(o),is=p(t),F=s(t,"DIV",{class:!0});var He=a(F);T(ut.$$.fragment,He),Ea=p(He),ee=s(He,"P",{});var To=a(ee);Aa=i(To,"This is the configuration class to store the configuration of a "),Xo=s(To,"CODE",{});var Ll=a(Xo);Wa=i(Ll,"ViLTModel"),Ll.forEach(o),Za=i(To,`. It is used to instantiate an ViLT
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 ViLT
`),gt=s(To,"A",{href:!0,rel:!0});var Rl=a(gt);Pa=i(Rl,"dandelin/vilt-b32-mlm"),Rl.forEach(o),Na=i(To," architecture."),To.forEach(o),Ba=p(He),te=s(He,"P",{});var wo=a(te);La=i(wo,"Configuration objects inherit from "),io=s(wo,"A",{href:!0});var Sl=a(io);Ra=i(Sl,"PretrainedConfig"),Sl.forEach(o),Sa=i(wo,` and can be used to control the model outputs. Read the
documentation from `),lo=s(wo,"A",{href:!0});var Gl=a(lo);Ga=i(Gl,"PretrainedConfig"),Gl.forEach(o),Oa=i(wo," for more information."),wo.forEach(o),qa=p(He),T(ke.$$.fragment,He),He.forEach(o),ls=p(t),oe=s(t,"H2",{class:!0});var Fs=a(oe);Ve=s(Fs,"A",{id:!0,class:!0,href:!0});var Ol=a(Ve);Do=s(Ol,"SPAN",{});var ql=a(Do);T(_t.$$.fragment,ql),ql.forEach(o),Ol.forEach(o),Qa=p(Fs),Ho=s(Fs,"SPAN",{});var Ql=a(Ho);Xa=i(Ql,"ViltFeatureExtractor"),Ql.forEach(o),Fs.forEach(o),ds=p(t),ne=s(t,"DIV",{class:!0});var zs=a(ne);T(vt.$$.fragment,zs),Da=p(zs),xe=s(zs,"DIV",{class:!0});var Cs=a(xe);T(yt.$$.fragment,Cs),Ha=p(Cs),Yo=s(Cs,"P",{});var Xl=a(Yo);Ya=i(Xl,"Preprocess an image or a batch of images."),Xl.forEach(o),Cs.forEach(o),zs.forEach(o),cs=p(t),se=s(t,"H2",{class:!0});var Us=a(se);$e=s(Us,"A",{id:!0,class:!0,href:!0});var Dl=a($e);Ko=s(Dl,"SPAN",{});var Hl=a(Ko);T(bt.$$.fragment,Hl),Hl.forEach(o),Dl.forEach(o),Ka=p(Us),en=s(Us,"SPAN",{});var Yl=a(en);er=i(Yl,"ViltImageProcessor"),Yl.forEach(o),Us.forEach(o),ms=p(t),S=s(t,"DIV",{class:!0});var Mo=a(S);T(Tt.$$.fragment,Mo),tr=p(Mo),tn=s(Mo,"P",{});var Kl=a(tn);or=i(Kl,"Constructs a ViLT image processor."),Kl.forEach(o),nr=p(Mo),je=s(Mo,"DIV",{class:!0});var Js=a(je);T(wt.$$.fragment,Js),sr=p(Js),on=s(Js,"P",{});var ed=a(on);ar=i(ed,"Preprocess an image or batch of images."),ed.forEach(o),Js.forEach(o),Mo.forEach(o),ps=p(t),ae=s(t,"H2",{class:!0});var Es=a(ae);Ie=s(Es,"A",{id:!0,class:!0,href:!0});var td=a(Ie);nn=s(td,"SPAN",{});var od=a(nn);T(Mt.$$.fragment,od),od.forEach(o),td.forEach(o),rr=p(Es),sn=s(Es,"SPAN",{});var nd=a(sn);ir=i(nd,"ViltProcessor"),nd.forEach(o),Es.forEach(o),hs=p(t),z=s(t,"DIV",{class:!0});var Ye=a(z);T(kt.$$.fragment,Ye),lr=p(Ye),an=s(Ye,"P",{});var sd=a(an);dr=i(sd,"Constructs a ViLT processor which wraps a BERT tokenizer and ViLT image processor into a single processor."),sd.forEach(o),cr=p(Ye),I=s(Ye,"P",{});var q=a(I);co=s(q,"A",{href:!0});var ad=a(co);mr=i(ad,"ViltProcessor"),ad.forEach(o),pr=i(q," offers all the functionalities of "),mo=s(q,"A",{href:!0});var rd=a(mo);hr=i(rd,"ViltImageProcessor"),rd.forEach(o),fr=i(q," and "),po=s(q,"A",{href:!0});var id=a(po);ur=i(id,"BertTokenizerFast"),id.forEach(o),gr=i(q,`. See the
docstring of `),Vt=s(q,"A",{href:!0});var wl=a(Vt);rn=s(wl,"STRONG",{});var ld=a(rn);_r=i(ld,"call"),ld.forEach(o),vr=i(wl,"()"),wl.forEach(o),yr=i(q," and "),ln=s(q,"CODE",{});var dd=a(ln);br=i(dd,"decode()"),dd.forEach(o),Tr=i(q," for more information."),q.forEach(o),wr=p(Ye),X=s(Ye,"DIV",{class:!0});var ko=a(X);T(xt.$$.fragment,ko),Mr=p(ko),re=s(ko,"P",{});var Vo=a(re);kr=i(Vo,"This method uses "),Fe=s(Vo,"A",{href:!0});var As=a(Fe);Vr=i(As,"ViltImageProcessor."),dn=s(As,"STRONG",{});var cd=a(dn);xr=i(cd,"call"),cd.forEach(o),$r=i(As,"()"),As.forEach(o),jr=i(Vo,` method to prepare image(s) for the model, and
`),ze=s(Vo,"A",{href:!0});var Ws=a(ze);Ir=i(Ws,"BertTokenizerFast."),cn=s(Ws,"STRONG",{});var md=a(cn);Fr=i(md,"call"),md.forEach(o),zr=i(Ws,"()"),Ws.forEach(o),Cr=i(Vo," to prepare text for the model."),Vo.forEach(o),Ur=p(ko),mn=s(ko,"P",{});var pd=a(mn);Jr=i(pd,"Please refer to the docstring of the above two methods for more information."),pd.forEach(o),ko.forEach(o),Ye.forEach(o),fs=p(t),ie=s(t,"H2",{class:!0});var Zs=a(ie);Ce=s(Zs,"A",{id:!0,class:!0,href:!0});var hd=a(Ce);pn=s(hd,"SPAN",{});var fd=a(pn);T($t.$$.fragment,fd),fd.forEach(o),hd.forEach(o),Er=p(Zs),hn=s(Zs,"SPAN",{});var ud=a(hn);Ar=i(ud,"ViltModel"),ud.forEach(o),Zs.forEach(o),us=p(t),G=s(t,"DIV",{class:!0});var xo=a(G);T(jt.$$.fragment,xo),Wr=p(xo),It=s(xo,"P",{});var Ps=a(It);Zr=i(Ps,`The bare ViLT Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),fn=s(Ps,"CODE",{});var gd=a(fn);Pr=i(gd,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),gd.forEach(o),Nr=i(Ps,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ps.forEach(o),Br=p(xo),W=s(xo,"DIV",{class:!0});var Ke=a(W);T(Ft.$$.fragment,Ke),Lr=p(Ke),le=s(Ke,"P",{});var $o=a(le);Rr=i($o,"The "),ho=s($o,"A",{href:!0});var _d=a(ho);Sr=i(_d,"ViltModel"),_d.forEach(o),Gr=i($o," forward method, overrides the "),un=s($o,"CODE",{});var vd=a(un);Or=i(vd,"__call__"),vd.forEach(o),qr=i($o," special method."),$o.forEach(o),Qr=p(Ke),T(Ue.$$.fragment,Ke),Xr=p(Ke),T(Je.$$.fragment,Ke),Ke.forEach(o),xo.forEach(o),gs=p(t),de=s(t,"H2",{class:!0});var Ns=a(de);Ee=s(Ns,"A",{id:!0,class:!0,href:!0});var yd=a(Ee);gn=s(yd,"SPAN",{});var bd=a(gn);T(zt.$$.fragment,bd),bd.forEach(o),yd.forEach(o),Dr=p(Ns),_n=s(Ns,"SPAN",{});var Td=a(_n);Hr=i(Td,"ViltForMaskedLM"),Td.forEach(o),Ns.forEach(o),_s=p(t),C=s(t,"DIV",{class:!0});var et=a(C);T(Ct.$$.fragment,et),Yr=p(et),vn=s(et,"P",{});var wd=a(vn);Kr=i(wd,"ViLT Model with a language modeling head on top as done during pretraining."),wd.forEach(o),ei=p(et),Ut=s(et,"P",{});var Bs=a(Ut);ti=i(Bs,"This model is a PyTorch "),yn=s(Bs,"CODE",{});var Md=a(yn);oi=i(Md,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Md.forEach(o),ni=i(Bs,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bs.forEach(o),si=p(et),Z=s(et,"DIV",{class:!0});var tt=a(Z);T(Jt.$$.fragment,tt),ai=p(tt),ce=s(tt,"P",{});var jo=a(ce);ri=i(jo,"The "),fo=s(jo,"A",{href:!0});var kd=a(fo);ii=i(kd,"ViltForMaskedLM"),kd.forEach(o),li=i(jo," forward method, overrides the "),bn=s(jo,"CODE",{});var Vd=a(bn);di=i(Vd,"__call__"),Vd.forEach(o),ci=i(jo," special method."),jo.forEach(o),mi=p(tt),T(Ae.$$.fragment,tt),pi=p(tt),T(We.$$.fragment,tt),tt.forEach(o),et.forEach(o),vs=p(t),me=s(t,"H2",{class:!0});var Ls=a(me);Ze=s(Ls,"A",{id:!0,class:!0,href:!0});var xd=a(Ze);Tn=s(xd,"SPAN",{});var $d=a(Tn);T(Et.$$.fragment,$d),$d.forEach(o),xd.forEach(o),hi=p(Ls),wn=s(Ls,"SPAN",{});var jd=a(wn);fi=i(jd,"ViltForQuestionAnswering"),jd.forEach(o),Ls.forEach(o),ys=p(t),U=s(t,"DIV",{class:!0});var ot=a(U);T(At.$$.fragment,ot),ui=p(ot),Mn=s(ot,"P",{});var Id=a(Mn);gi=i(Id,`Vilt Model transformer with a classifier head on top (a linear layer on top of the final hidden state of the [CLS]
token) for visual question answering, e.g. for VQAv2.`),Id.forEach(o),_i=p(ot),Wt=s(ot,"P",{});var Rs=a(Wt);vi=i(Rs,"This model is a PyTorch "),kn=s(Rs,"CODE",{});var Fd=a(kn);yi=i(Fd,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Fd.forEach(o),bi=i(Rs,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Rs.forEach(o),Ti=p(ot),P=s(ot,"DIV",{class:!0});var nt=a(P);T(Zt.$$.fragment,nt),wi=p(nt),pe=s(nt,"P",{});var Io=a(pe);Mi=i(Io,"The "),uo=s(Io,"A",{href:!0});var zd=a(uo);ki=i(zd,"ViltForQuestionAnswering"),zd.forEach(o),Vi=i(Io," forward method, overrides the "),Vn=s(Io,"CODE",{});var Cd=a(Vn);xi=i(Cd,"__call__"),Cd.forEach(o),$i=i(Io," special method."),Io.forEach(o),ji=p(nt),T(Pe.$$.fragment,nt),Ii=p(nt),T(Ne.$$.fragment,nt),nt.forEach(o),ot.forEach(o),bs=p(t),he=s(t,"H2",{class:!0});var Ss=a(he);Be=s(Ss,"A",{id:!0,class:!0,href:!0});var Ud=a(Be);xn=s(Ud,"SPAN",{});var Jd=a(xn);T(Pt.$$.fragment,Jd),Jd.forEach(o),Ud.forEach(o),Fi=p(Ss),$n=s(Ss,"SPAN",{});var Ed=a($n);zi=i(Ed,"ViltForImagesAndTextClassification"),Ed.forEach(o),Ss.forEach(o),Ts=p(t),O=s(t,"DIV",{class:!0});var Fo=a(O);T(Nt.$$.fragment,Fo),Ci=p(Fo),jn=s(Fo,"P",{});var Ad=a(jn);Ui=i(Ad,"Vilt Model transformer with a classifier head on top for natural language visual reasoning, e.g. NLVR2."),Ad.forEach(o),Ji=p(Fo),N=s(Fo,"DIV",{class:!0});var st=a(N);T(Bt.$$.fragment,st),Ei=p(st),fe=s(st,"P",{});var zo=a(fe);Ai=i(zo,"The "),go=s(zo,"A",{href:!0});var Wd=a(go);Wi=i(Wd,"ViltForImagesAndTextClassification"),Wd.forEach(o),Zi=i(zo," forward method, overrides the "),In=s(zo,"CODE",{});var Zd=a(In);Pi=i(Zd,"__call__"),Zd.forEach(o),Ni=i(zo," special method."),zo.forEach(o),Bi=p(st),T(Le.$$.fragment,st),Li=p(st),T(Re.$$.fragment,st),st.forEach(o),Fo.forEach(o),ws=p(t),ue=s(t,"H2",{class:!0});var Gs=a(ue);Se=s(Gs,"A",{id:!0,class:!0,href:!0});var Pd=a(Se);Fn=s(Pd,"SPAN",{});var Nd=a(Fn);T(Lt.$$.fragment,Nd),Nd.forEach(o),Pd.forEach(o),Ri=p(Gs),zn=s(Gs,"SPAN",{});var Bd=a(zn);Si=i(Bd,"ViltForImageAndTextRetrieval"),Bd.forEach(o),Gs.forEach(o),Ms=p(t),J=s(t,"DIV",{class:!0});var at=a(J);T(Rt.$$.fragment,at),Gi=p(at),Cn=s(at,"P",{});var Ld=a(Cn);Oi=i(Ld,`Vilt Model transformer with a classifier head on top (a linear layer on top of the final hidden state of the [CLS]
token) for image-to-text or text-to-image retrieval, e.g. MSCOCO and F30K.`),Ld.forEach(o),qi=p(at),St=s(at,"P",{});var Os=a(St);Qi=i(Os,"This model is a PyTorch "),Un=s(Os,"CODE",{});var Rd=a(Un);Xi=i(Rd,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Rd.forEach(o),Di=i(Os,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Os.forEach(o),Hi=p(at),B=s(at,"DIV",{class:!0});var rt=a(B);T(Gt.$$.fragment,rt),Yi=p(rt),ge=s(rt,"P",{});var Co=a(ge);Ki=i(Co,"The "),_o=s(Co,"A",{href:!0});var Sd=a(_o);el=i(Sd,"ViltForImageAndTextRetrieval"),Sd.forEach(o),tl=i(Co," forward method, overrides the "),Jn=s(Co,"CODE",{});var Gd=a(Jn);ol=i(Gd,"__call__"),Gd.forEach(o),nl=i(Co," special method."),Co.forEach(o),sl=p(rt),T(Ge.$$.fragment,rt),al=p(rt),T(Oe.$$.fragment,rt),rt.forEach(o),at.forEach(o),ks=p(t),_e=s(t,"H2",{class:!0});var qs=a(_e);qe=s(qs,"A",{id:!0,class:!0,href:!0});var Od=a(qe);En=s(Od,"SPAN",{});var qd=a(En);T(Ot.$$.fragment,qd),qd.forEach(o),Od.forEach(o),rl=p(qs),An=s(qs,"SPAN",{});var Qd=a(An);il=i(Qd,"ViltForTokenClassification"),Qd.forEach(o),qs.forEach(o),Vs=p(t),E=s(t,"DIV",{class:!0});var it=a(E);T(qt.$$.fragment,it),ll=p(it),Wn=s(it,"P",{});var Xd=a(Wn);dl=i(Xd,`ViLT Model with a token classification head on top (a linear layer on top of the final hidden-states of the text
tokens) e.g. for Named-Entity-Recognition (NER) tasks.`),Xd.forEach(o),cl=p(it),Qt=s(it,"P",{});var Qs=a(Qt);ml=i(Qs,"This model is a PyTorch "),Zn=s(Qs,"CODE",{});var Dd=a(Zn);pl=i(Dd,"torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>"),Dd.forEach(o),hl=i(Qs,`_ subclass. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qs.forEach(o),fl=p(it),D=s(it,"DIV",{class:!0});var Uo=a(D);T(Xt.$$.fragment,Uo),ul=p(Uo),ve=s(Uo,"P",{});var Jo=a(ve);gl=i(Jo,"The "),vo=s(Jo,"A",{href:!0});var Hd=a(vo);_l=i(Hd,"ViltForTokenClassification"),Hd.forEach(o),vl=i(Jo," forward method, overrides the "),Pn=s(Jo,"CODE",{});var Yd=a(Pn);yl=i(Yd,"__call__"),Yd.forEach(o),bl=i(Jo," special method."),Jo.forEach(o),Tl=p(Uo),T(Qe.$$.fragment,Uo),Uo.forEach(o),it.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(vc)),c(g,"id","vilt"),c(g,"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"),c(g,"href","#vilt"),c(_,"class","relative group"),c(ye,"id","overview"),c(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"),c(ye,"href","#overview"),c(H,"class","relative group"),c(dt,"href","https://arxiv.org/abs/2102.03334"),c(dt,"rel","nofollow"),c(mt,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/ViLT"),c(mt,"rel","nofollow"),c(oo,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltProcessor"),c(no,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltProcessor"),nc(Te.src,Ml="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/vilt_architecture.jpg")||c(Te,"src",Ml),c(Te,"alt","drawing"),c(Te,"width","600"),c(so,"href","https://arxiv.org/abs/2102.03334"),c(pt,"href","https://huggingface.co/nielsr"),c(pt,"rel","nofollow"),c(ht,"href","https://github.com/dandelin/ViLT"),c(ht,"rel","nofollow"),c(Me,"id","transformers.ViltConfig"),c(Me,"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"),c(Me,"href","#transformers.ViltConfig"),c(K,"class","relative group"),c(gt,"href","https://huggingface.co/dandelin/vilt-b32-mlm"),c(gt,"rel","nofollow"),c(io,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(lo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ve,"id","transformers.ViltFeatureExtractor"),c(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"),c(Ve,"href","#transformers.ViltFeatureExtractor"),c(oe,"class","relative group"),c(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($e,"id","transformers.ViltImageProcessor"),c($e,"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"),c($e,"href","#transformers.ViltImageProcessor"),c(se,"class","relative group"),c(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ie,"id","transformers.ViltProcessor"),c(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ie,"href","#transformers.ViltProcessor"),c(ae,"class","relative group"),c(co,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltProcessor"),c(mo,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltImageProcessor"),c(po,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizerFast"),c(Vt,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltProcessor.__call__"),c(Fe,"href","/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__"),c(ze,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ce,"id","transformers.ViltModel"),c(Ce,"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"),c(Ce,"href","#transformers.ViltModel"),c(ie,"class","relative group"),c(ho,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltModel"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ee,"id","transformers.ViltForMaskedLM"),c(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"),c(Ee,"href","#transformers.ViltForMaskedLM"),c(de,"class","relative group"),c(fo,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltForMaskedLM"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ze,"id","transformers.ViltForQuestionAnswering"),c(Ze,"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"),c(Ze,"href","#transformers.ViltForQuestionAnswering"),c(me,"class","relative group"),c(uo,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltForQuestionAnswering"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Be,"id","transformers.ViltForImagesAndTextClassification"),c(Be,"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"),c(Be,"href","#transformers.ViltForImagesAndTextClassification"),c(he,"class","relative group"),c(go,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltForImagesAndTextClassification"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Se,"id","transformers.ViltForImageAndTextRetrieval"),c(Se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Se,"href","#transformers.ViltForImageAndTextRetrieval"),c(ue,"class","relative group"),c(_o,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltForImageAndTextRetrieval"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(qe,"id","transformers.ViltForTokenClassification"),c(qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(qe,"href","#transformers.ViltForTokenClassification"),c(_e,"class","relative group"),c(vo,"href","/docs/transformers/v4.32.0/en/model_doc/vilt#transformers.ViltForTokenClassification"),c(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,d),u(t,y,h),u(t,_,h),e(_,g),e(g,v),w(l,v,null),e(_,f),e(_,$),e($,Xs),u(t,Xn,h),u(t,H,h),e(H,ye),e(ye,Po),w(lt,Po,null),e(H,Ds),e(H,No),e(No,Hs),u(t,Dn,h),u(t,be,h),e(be,Ys),e(be,dt),e(dt,Ks),e(be,ea),u(t,Hn,h),u(t,Kt,h),e(Kt,ta),u(t,Yn,h),u(t,eo,h),e(eo,Bo),e(Bo,oa),u(t,Kn,h),u(t,to,h),e(to,na),u(t,es,h),u(t,A,h),e(A,ct),e(ct,sa),e(ct,mt),e(mt,aa),e(ct,ra),e(A,ia),e(A,R),e(R,la),e(R,Lo),e(Lo,da),e(R,ca),e(R,Ro),e(Ro,ma),e(R,pa),e(R,oo),e(oo,ha),e(R,fa),e(A,ua),e(A,Y),e(Y,ga),e(Y,So),e(So,_a),e(Y,va),e(Y,no),e(no,ya),e(Y,ba),e(A,Ta),e(A,Go),e(Go,wa),u(t,ts,h),u(t,Te,h),u(t,os,h),u(t,we,h),e(we,Ma),e(we,so),e(so,ka),e(we,Va),u(t,ns,h),u(t,Q,h),e(Q,xa),e(Q,pt),e(pt,$a),e(Q,ja),e(Q,ht),e(ht,Ia),e(Q,Fa),u(t,ss,h),u(t,ao,h),e(ao,za),u(t,as,h),u(t,ro,h),e(ro,Oo),e(Oo,Ca),u(t,rs,h),u(t,K,h),e(K,Me),e(Me,qo),w(ft,qo,null),e(K,Ua),e(K,Qo),e(Qo,Ja),u(t,is,h),u(t,F,h),w(ut,F,null),e(F,Ea),e(F,ee),e(ee,Aa),e(ee,Xo),e(Xo,Wa),e(ee,Za),e(ee,gt),e(gt,Pa),e(ee,Na),e(F,Ba),e(F,te),e(te,La),e(te,io),e(io,Ra),e(te,Sa),e(te,lo),e(lo,Ga),e(te,Oa),e(F,qa),w(ke,F,null),u(t,ls,h),u(t,oe,h),e(oe,Ve),e(Ve,Do),w(_t,Do,null),e(oe,Qa),e(oe,Ho),e(Ho,Xa),u(t,ds,h),u(t,ne,h),w(vt,ne,null),e(ne,Da),e(ne,xe),w(yt,xe,null),e(xe,Ha),e(xe,Yo),e(Yo,Ya),u(t,cs,h),u(t,se,h),e(se,$e),e($e,Ko),w(bt,Ko,null),e(se,Ka),e(se,en),e(en,er),u(t,ms,h),u(t,S,h),w(Tt,S,null),e(S,tr),e(S,tn),e(tn,or),e(S,nr),e(S,je),w(wt,je,null),e(je,sr),e(je,on),e(on,ar),u(t,ps,h),u(t,ae,h),e(ae,Ie),e(Ie,nn),w(Mt,nn,null),e(ae,rr),e(ae,sn),e(sn,ir),u(t,hs,h),u(t,z,h),w(kt,z,null),e(z,lr),e(z,an),e(an,dr),e(z,cr),e(z,I),e(I,co),e(co,mr),e(I,pr),e(I,mo),e(mo,hr),e(I,fr),e(I,po),e(po,ur),e(I,gr),e(I,Vt),e(Vt,rn),e(rn,_r),e(Vt,vr),e(I,yr),e(I,ln),e(ln,br),e(I,Tr),e(z,wr),e(z,X),w(xt,X,null),e(X,Mr),e(X,re),e(re,kr),e(re,Fe),e(Fe,Vr),e(Fe,dn),e(dn,xr),e(Fe,$r),e(re,jr),e(re,ze),e(ze,Ir),e(ze,cn),e(cn,Fr),e(ze,zr),e(re,Cr),e(X,Ur),e(X,mn),e(mn,Jr),u(t,fs,h),u(t,ie,h),e(ie,Ce),e(Ce,pn),w($t,pn,null),e(ie,Er),e(ie,hn),e(hn,Ar),u(t,us,h),u(t,G,h),w(jt,G,null),e(G,Wr),e(G,It),e(It,Zr),e(It,fn),e(fn,Pr),e(It,Nr),e(G,Br),e(G,W),w(Ft,W,null),e(W,Lr),e(W,le),e(le,Rr),e(le,ho),e(ho,Sr),e(le,Gr),e(le,un),e(un,Or),e(le,qr),e(W,Qr),w(Ue,W,null),e(W,Xr),w(Je,W,null),u(t,gs,h),u(t,de,h),e(de,Ee),e(Ee,gn),w(zt,gn,null),e(de,Dr),e(de,_n),e(_n,Hr),u(t,_s,h),u(t,C,h),w(Ct,C,null),e(C,Yr),e(C,vn),e(vn,Kr),e(C,ei),e(C,Ut),e(Ut,ti),e(Ut,yn),e(yn,oi),e(Ut,ni),e(C,si),e(C,Z),w(Jt,Z,null),e(Z,ai),e(Z,ce),e(ce,ri),e(ce,fo),e(fo,ii),e(ce,li),e(ce,bn),e(bn,di),e(ce,ci),e(Z,mi),w(Ae,Z,null),e(Z,pi),w(We,Z,null),u(t,vs,h),u(t,me,h),e(me,Ze),e(Ze,Tn),w(Et,Tn,null),e(me,hi),e(me,wn),e(wn,fi),u(t,ys,h),u(t,U,h),w(At,U,null),e(U,ui),e(U,Mn),e(Mn,gi),e(U,_i),e(U,Wt),e(Wt,vi),e(Wt,kn),e(kn,yi),e(Wt,bi),e(U,Ti),e(U,P),w(Zt,P,null),e(P,wi),e(P,pe),e(pe,Mi),e(pe,uo),e(uo,ki),e(pe,Vi),e(pe,Vn),e(Vn,xi),e(pe,$i),e(P,ji),w(Pe,P,null),e(P,Ii),w(Ne,P,null),u(t,bs,h),u(t,he,h),e(he,Be),e(Be,xn),w(Pt,xn,null),e(he,Fi),e(he,$n),e($n,zi),u(t,Ts,h),u(t,O,h),w(Nt,O,null),e(O,Ci),e(O,jn),e(jn,Ui),e(O,Ji),e(O,N),w(Bt,N,null),e(N,Ei),e(N,fe),e(fe,Ai),e(fe,go),e(go,Wi),e(fe,Zi),e(fe,In),e(In,Pi),e(fe,Ni),e(N,Bi),w(Le,N,null),e(N,Li),w(Re,N,null),u(t,ws,h),u(t,ue,h),e(ue,Se),e(Se,Fn),w(Lt,Fn,null),e(ue,Ri),e(ue,zn),e(zn,Si),u(t,Ms,h),u(t,J,h),w(Rt,J,null),e(J,Gi),e(J,Cn),e(Cn,Oi),e(J,qi),e(J,St),e(St,Qi),e(St,Un),e(Un,Xi),e(St,Di),e(J,Hi),e(J,B),w(Gt,B,null),e(B,Yi),e(B,ge),e(ge,Ki),e(ge,_o),e(_o,el),e(ge,tl),e(ge,Jn),e(Jn,ol),e(ge,nl),e(B,sl),w(Ge,B,null),e(B,al),w(Oe,B,null),u(t,ks,h),u(t,_e,h),e(_e,qe),e(qe,En),w(Ot,En,null),e(_e,rl),e(_e,An),e(An,il),u(t,Vs,h),u(t,E,h),w(qt,E,null),e(E,ll),e(E,Wn),e(Wn,dl),e(E,cl),e(E,Qt),e(Qt,ml),e(Qt,Zn),e(Zn,pl),e(Qt,hl),e(E,fl),e(E,D),w(Xt,D,null),e(D,ul),e(D,ve),e(ve,gl),e(ve,vo),e(vo,_l),e(ve,vl),e(ve,Pn),e(Pn,yl),e(ve,bl),e(D,Tl),w(Qe,D,null),xs=!0},p(t,[h]){const Dt={};h&2&&(Dt.$$scope={dirty:h,ctx:t}),ke.$set(Dt);const Nn={};h&2&&(Nn.$$scope={dirty:h,ctx:t}),Ue.$set(Nn);const Bn={};h&2&&(Bn.$$scope={dirty:h,ctx:t}),Je.$set(Bn);const Ln={};h&2&&(Ln.$$scope={dirty:h,ctx:t}),Ae.$set(Ln);const Ht={};h&2&&(Ht.$$scope={dirty:h,ctx:t}),We.$set(Ht);const Rn={};h&2&&(Rn.$$scope={dirty:h,ctx:t}),Pe.$set(Rn);const Sn={};h&2&&(Sn.$$scope={dirty:h,ctx:t}),Ne.$set(Sn);const Gn={};h&2&&(Gn.$$scope={dirty:h,ctx:t}),Le.$set(Gn);const Yt={};h&2&&(Yt.$$scope={dirty:h,ctx:t}),Re.$set(Yt);const On={};h&2&&(On.$$scope={dirty:h,ctx:t}),Ge.$set(On);const qn={};h&2&&(qn.$$scope={dirty:h,ctx:t}),Oe.$set(qn);const Qn={};h&2&&(Qn.$$scope={dirty:h,ctx:t}),Qe.$set(Qn)},i(t){xs||(M(l.$$.fragment,t),M(lt.$$.fragment,t),M(ft.$$.fragment,t),M(ut.$$.fragment,t),M(ke.$$.fragment,t),M(_t.$$.fragment,t),M(vt.$$.fragment,t),M(yt.$$.fragment,t),M(bt.$$.fragment,t),M(Tt.$$.fragment,t),M(wt.$$.fragment,t),M(Mt.$$.fragment,t),M(kt.$$.fragment,t),M(xt.$$.fragment,t),M($t.$$.fragment,t),M(jt.$$.fragment,t),M(Ft.$$.fragment,t),M(Ue.$$.fragment,t),M(Je.$$.fragment,t),M(zt.$$.fragment,t),M(Ct.$$.fragment,t),M(Jt.$$.fragment,t),M(Ae.$$.fragment,t),M(We.$$.fragment,t),M(Et.$$.fragment,t),M(At.$$.fragment,t),M(Zt.$$.fragment,t),M(Pe.$$.fragment,t),M(Ne.$$.fragment,t),M(Pt.$$.fragment,t),M(Nt.$$.fragment,t),M(Bt.$$.fragment,t),M(Le.$$.fragment,t),M(Re.$$.fragment,t),M(Lt.$$.fragment,t),M(Rt.$$.fragment,t),M(Gt.$$.fragment,t),M(Ge.$$.fragment,t),M(Oe.$$.fragment,t),M(Ot.$$.fragment,t),M(qt.$$.fragment,t),M(Xt.$$.fragment,t),M(Qe.$$.fragment,t),xs=!0)},o(t){k(l.$$.fragment,t),k(lt.$$.fragment,t),k(ft.$$.fragment,t),k(ut.$$.fragment,t),k(ke.$$.fragment,t),k(_t.$$.fragment,t),k(vt.$$.fragment,t),k(yt.$$.fragment,t),k(bt.$$.fragment,t),k(Tt.$$.fragment,t),k(wt.$$.fragment,t),k(Mt.$$.fragment,t),k(kt.$$.fragment,t),k(xt.$$.fragment,t),k($t.$$.fragment,t),k(jt.$$.fragment,t),k(Ft.$$.fragment,t),k(Ue.$$.fragment,t),k(Je.$$.fragment,t),k(zt.$$.fragment,t),k(Ct.$$.fragment,t),k(Jt.$$.fragment,t),k(Ae.$$.fragment,t),k(We.$$.fragment,t),k(Et.$$.fragment,t),k(At.$$.fragment,t),k(Zt.$$.fragment,t),k(Pe.$$.fragment,t),k(Ne.$$.fragment,t),k(Pt.$$.fragment,t),k(Nt.$$.fragment,t),k(Bt.$$.fragment,t),k(Le.$$.fragment,t),k(Re.$$.fragment,t),k(Lt.$$.fragment,t),k(Rt.$$.fragment,t),k(Gt.$$.fragment,t),k(Ge.$$.fragment,t),k(Oe.$$.fragment,t),k(Ot.$$.fragment,t),k(qt.$$.fragment,t),k(Xt.$$.fragment,t),k(Qe.$$.fragment,t),xs=!1},d(t){o(d),t&&o(y),t&&o(_),V(l),t&&o(Xn),t&&o(H),V(lt),t&&o(Dn),t&&o(be),t&&o(Hn),t&&o(Kt),t&&o(Yn),t&&o(eo),t&&o(Kn),t&&o(to),t&&o(es),t&&o(A),t&&o(ts),t&&o(Te),t&&o(os),t&&o(we),t&&o(ns),t&&o(Q),t&&o(ss),t&&o(ao),t&&o(as),t&&o(ro),t&&o(rs),t&&o(K),V(ft),t&&o(is),t&&o(F),V(ut),V(ke),t&&o(ls),t&&o(oe),V(_t),t&&o(ds),t&&o(ne),V(vt),V(yt),t&&o(cs),t&&o(se),V(bt),t&&o(ms),t&&o(S),V(Tt),V(wt),t&&o(ps),t&&o(ae),V(Mt),t&&o(hs),t&&o(z),V(kt),V(xt),t&&o(fs),t&&o(ie),V($t),t&&o(us),t&&o(G),V(jt),V(Ft),V(Ue),V(Je),t&&o(gs),t&&o(de),V(zt),t&&o(_s),t&&o(C),V(Ct),V(Jt),V(Ae),V(We),t&&o(vs),t&&o(me),V(Et),t&&o(ys),t&&o(U),V(At),V(Zt),V(Pe),V(Ne),t&&o(bs),t&&o(he),V(Pt),t&&o(Ts),t&&o(O),V(Nt),V(Bt),V(Le),V(Re),t&&o(ws),t&&o(ue),V(Lt),t&&o(Ms),t&&o(J),V(Rt),V(Gt),V(Ge),V(Oe),t&&o(ks),t&&o(_e),V(Ot),t&&o(Vs),t&&o(E),V(qt),V(Xt),V(Qe)}}}const vc={local:"vilt",sections:[{local:"overview",title:"Overview"},{local:"transformers.ViltConfig",title:"ViltConfig"},{local:"transformers.ViltFeatureExtractor",title:"ViltFeatureExtractor"},{local:"transformers.ViltImageProcessor",title:"ViltImageProcessor"},{local:"transformers.ViltProcessor",title:"ViltProcessor"},{local:"transformers.ViltModel",title:"ViltModel"},{local:"transformers.ViltForMaskedLM",title:"ViltForMaskedLM"},{local:"transformers.ViltForQuestionAnswering",title:"ViltForQuestionAnswering"},{local:"transformers.ViltForImagesAndTextClassification",title:"ViltForImagesAndTextClassification"},{local:"transformers.ViltForImageAndTextRetrieval",title:"ViltForImageAndTextRetrieval"},{local:"transformers.ViltForTokenClassification",title:"ViltForTokenClassification"}],title:"ViLT"};function yc(x){return sc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xc extends Kd{constructor(d){super();ec(this,d,yc,_c,tc,{})}}export{xc as default,vc as metadata};
