import{S as cp,i as mp,s as pp,e as a,k as m,w as b,t as s,M as fp,c as n,d as t,m as p,a as r,x as k,h as i,b as d,G as e,g as u,y,q as F,o as T,B as w,v as hp,L as yo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ot}from"../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Fo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as C}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ko}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function gp(x){let c,M,_,g,v;return g=new Fo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXZhQ29uZmlnJTJDJTIwRmxhdmFNb2RlbCUyQyUyMEZsYXZhRm9yUHJlVHJhaW5pbmclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRmxhdmFDb25maWclMjB3aXRoJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEZsYXZhQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRmxhdmFNb2RlbCUyMGFuZCUyMEZsYXZhRm9yUHJlVHJhaW5pbmclMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBGbGF2YU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBbW9kZWxfcHJlJTIwJTNEJTIwRmxhdmFGb3JQcmVUcmFpbmluZyhjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWclMEFjb25maWd1cmF0aW9uX3ByZSUyMCUzRCUyMG1vZGVsX3ByZS5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlavaConfig, FlavaModel, FlavaForPreTraining

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaModel and FlavaForPreTraining model (with random weights) from the style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaModel(configuration)
<span class="hljs-meta">&gt;&gt;&gt; </span>model_pre = FlavaForPreTraining(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
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration_pre = model_pre.config`}}),{c(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Example:"),f.forEach(t),_=p(l),k(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,M),u(l,_,f),y(g,l,f),v=!0},p:yo,i(l){v||(F(g.$$.fragment,l),v=!0)},o(l){T(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(_),w(g,l)}}}function up(x){let c,M,_,g,v;return g=new Fo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXZhVGV4dENvbmZpZyUyQyUyMEZsYXZhVGV4dE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEZsYXZhVGV4dE1vZGVsJTIwd2l0aCUyMCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBGbGF2YVRleHRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBGbGF2YVRleHRNb2RlbCUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEZsYXZhVGV4dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlavaTextConfig, FlavaTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaTextModel with  style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = FlavaTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaTextModel model (with random weights) from the style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaTextModel(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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Example:"),f.forEach(t),_=p(l),k(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,M),u(l,_,f),y(g,l,f),v=!0},p:yo,i(l){v||(F(g.$$.fragment,l),v=!0)},o(l){T(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(_),w(g,l)}}}function _p(x){let c,M,_,g,v;return g=new Fo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXZhSW1hZ2VDb25maWclMkMlMjBGbGF2YUltYWdlTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRmxhdmFJbWFnZU1vZGVsJTIwd2l0aCUyMCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBGbGF2YUltYWdlQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwRmxhdmFJbWFnZU1vZGVsJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwRmxhdmFJbWFnZU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlavaImageConfig, FlavaImageModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaImageModel with  style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = FlavaImageConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaImageModel model (with random weights) from the style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaImageModel(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(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Example:"),f.forEach(t),_=p(l),k(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,M),u(l,_,f),y(g,l,f),v=!0},p:yo,i(l){v||(F(g.$$.fragment,l),v=!0)},o(l){T(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(_),w(g,l)}}}function vp(x){let c,M,_,g,v;return g=new Fo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZsYXZhTXVsdGltb2RhbENvbmZpZyUyQyUyMEZsYXZhTXVsdGltb2RhbE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEZsYXZhTXVsdGltb2RhbE1vZGVsJTIwd2l0aCUyMCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBGbGF2YU11bHRpbW9kYWxDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBGbGF2YU11bHRpbW9kYWxNb2RlbCUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEZsYXZhTXVsdGltb2RhbE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FlavaMultimodalConfig, FlavaMultimodalModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FlavaMultimodalModel with  style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = FlavaMultimodalConfig()

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaModel.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</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>inputs = processor(text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.contrastive_logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),{c(){c=a("p"),M=s("Examples:"),_=m(),b(g.$$.fragment)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Examples:"),f.forEach(t),_=p(l),k(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,M),u(l,_,f),y(g,l,f),v=!0},p:yo,i(l){v||(F(g.$$.fragment,l),v=!0)},o(l){T(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(_),w(g,l)}}}function Fp(x){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=i(I,"Module"),I.forEach(t),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(t)},m(l,f){u(l,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(l){l&&t(c)}}}function Tp(x){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=i(I,"Module"),I.forEach(t),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(t)},m(l,f){u(l,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(l){l&&t(c)}}}function wp(x){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=i(I,"Module"),I.forEach(t),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(t)},m(l,f){u(l,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(l){l&&t(c)}}}function Mp(x){let c,M,_,g,v;return g=new Fo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF2YVRleHRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZmbGF2YS1mdWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxhdmFUZXh0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZmxhdmEtZnVsbCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlavaTextModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaTextModel.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Example:"),f.forEach(t),_=p(l),k(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,M),u(l,_,f),y(g,l,f),v=!0},p:yo,i(l){v||(F(g.$$.fragment,l),v=!0)},o(l){T(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(_),w(g,l)}}}function xp(x){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=i(I,"Module"),I.forEach(t),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(t)},m(l,f){u(l,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(l){l&&t(c)}}}function $p(x){let c,M,_,g,v;return g=new Fo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXZhSW1hZ2VNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZmbGF2YS1mdWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxhdmFJbWFnZU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmZsYXZhLWZ1bGwlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlavaImageModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaImageModel.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">197</span>, <span class="hljs-number">768</span>]`}}),{c(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Example:"),f.forEach(t),_=p(l),k(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,M),u(l,_,f),y(g,l,f),v=!0},p:yo,i(l){v||(F(g.$$.fragment,l),v=!0)},o(l){T(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(_),w(g,l)}}}function Ip(x){let c,M,_,g,v;return{c(){c=a("p"),M=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=s("Module"),v=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(f,"CODE",{});var I=r(_);g=i(I,"Module"),I.forEach(t),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(t)},m(l,f){u(l,c,f),e(c,M),e(c,_),e(_,g),e(c,v)},d(l){l&&t(c)}}}function zp(x){let c,M,_,g,v;return g=new Fo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF2YU11bHRpbW9kYWxNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZmbGF2YS1mdWxsJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxhdmFNdWx0aW1vZGFsTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZmxhdmEtZnVsbCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlavaMultimodalModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlavaMultimodalModel.from_pretrained(<span class="hljs-string">&quot;facebook/flava-full&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){c=a("p"),M=s("Example:"),_=m(),b(g.$$.fragment)},l(l){c=n(l,"P",{});var f=r(c);M=i(f,"Example:"),f.forEach(t),_=p(l),k(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,M),u(l,_,f),y(g,l,f),v=!0},p:yo,i(l){v||(F(g.$$.fragment,l),v=!0)},o(l){T(g.$$.fragment,l),v=!1},d(l){l&&t(c),l&&t(_),w(g,l)}}}function Cp(x){let c,M,_,g,v,l,f,I,ls,On,se,Ae,Sa,To,ds,La,cs,Dn,We,ms,wo,ps,fs,Xn,Dt,hs,Yn,Xt,gs,Hn,Yt,Oa,us,Qn,X,_s,Mo,vs,bs,xo,ks,ys,Kn,ie,je,Da,$o,Fs,Xa,Ts,er,P,Io,ws,Y,Ht,Ms,xs,Qt,$s,Is,zo,zs,Cs,Ps,le,Es,Kt,As,Ws,ea,js,Us,Ns,Ue,Zs,Ne,Co,Js,Po,Vs,oa,Bs,Rs,or,de,Ze,Ya,Eo,Gs,Ha,qs,tr,E,Ao,Ss,Wo,Ls,ta,Os,Ds,Xs,jo,Ys,Uo,Hs,Qs,Ks,ce,ei,aa,oi,ti,na,ai,ni,ri,Je,ar,me,Ve,Qa,No,si,Ka,ii,nr,A,Zo,li,Jo,di,ra,ci,mi,pi,Vo,fi,Bo,hi,gi,ui,pe,_i,sa,vi,bi,ia,ki,yi,Fi,Be,rr,fe,Re,en,Ro,Ti,on,wi,sr,W,Go,Mi,qo,xi,la,$i,Ii,zi,So,Ci,Lo,Pi,Ei,Ai,he,Wi,da,ji,Ui,ca,Ni,Zi,Ji,Ge,ir,ge,qe,tn,Oo,Vi,an,Bi,lr,Do,Xo,dr,ue,Se,nn,Yo,Ri,rn,Gi,cr,j,Ho,qi,sn,Si,Li,N,ma,Oi,Di,pa,Xi,Yi,fa,Hi,Qi,ln,Ki,el,ha,ol,tl,al,Le,Qo,nl,Ko,rl,ga,sl,il,ll,Oe,et,dl,ot,cl,ua,ml,pl,mr,_e,De,dn,tt,fl,cn,hl,pr,at,nt,fr,ve,Xe,mn,rt,gl,pn,ul,hr,q,st,_l,fn,vl,bl,Ye,it,kl,hn,yl,gr,be,He,gn,lt,Fl,un,Tl,ur,Z,dt,wl,_n,Ml,xl,ct,$l,mt,Il,zl,Cl,H,pt,Pl,ke,El,_a,Al,Wl,vn,jl,Ul,Nl,Qe,_r,ye,Ke,bn,ft,Zl,kn,Jl,vr,U,ht,Vl,gt,Bl,ut,Rl,Gl,ql,J,_t,Sl,Fe,Ll,va,Ol,Dl,yn,Xl,Yl,Hl,eo,Ql,oo,Kl,Q,vt,ed,Te,od,ba,td,ad,Fn,nd,rd,sd,to,id,K,bt,ld,we,dd,ka,cd,md,Tn,pd,fd,hd,ao,br,Me,no,wn,kt,gd,Mn,ud,kr,z,yt,_d,Ft,vd,xn,bd,kd,yd,Tt,Fd,wt,Td,wd,Md,ya,Mt,xd,Fa,xt,$d,Ta,$t,yr,xe,ro,$n,It,Id,In,zd,Fr,S,zt,Cd,Ct,Pd,Pt,Ed,Ad,Wd,V,Et,jd,$e,Ud,wa,Nd,Zd,zn,Jd,Vd,Bd,so,Rd,io,Tr,Ie,lo,Cn,At,Gd,Pn,qd,wr,L,Wt,Sd,jt,Ld,Ut,Od,Dd,Xd,B,Nt,Yd,ze,Hd,Ma,Qd,Kd,En,ec,oc,tc,co,ac,mo,Mr,Ce,po,An,Zt,nc,Wn,rc,xr,O,Jt,sc,Vt,ic,Bt,lc,dc,cc,R,Rt,mc,Pe,pc,xa,fc,hc,jn,gc,uc,_c,fo,vc,ho,$r;return l=new C({}),To=new C({}),$o=new C({}),Io=new $({props:{name:"class transformers.FlavaConfig",anchor:"transformers.FlavaConfig",parameters:[{name:"image_config",val:": typing.Dict[str, typing.Any] = None"},{name:"text_config",val:": typing.Dict[str, typing.Any] = None"},{name:"multimodal_config",val:": typing.Dict[str, typing.Any] = None"},{name:"image_codebook_config",val:": typing.Dict[str, typing.Any] = None"},{name:"hidden_size",val:": int = 768"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"projection_dim",val:": int = 768"},{name:"init_codebook",val:": bool = True"},{name:"logit_scale_init_value",val:": float = 2.6592"},{name:"initializer_range",val:": float = 0.02"},{name:"ce_ignore_index",val:": int = -100"},{name:"mim_weight",val:": float = 1.0"},{name:"mlm_weight",val:": float = 1.0"},{name:"global_contrastive_weight",val:": float = 1.0"},{name:"itm_weight",val:": float = 1.0"},{name:"mmm_image_weight",val:": float = 1.0"},{name:"mmm_text_weight",val:": float = 1.0"},{name:"global_backprop_contrastive",val:": bool = True"},{name:"skip_unmasked_multimodal_encoder",val:": bool = True"},{name:"return_loss",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextConfig">FlavaTextConfig</a>.`,name:"text_config"},{anchor:"transformers.FlavaConfig.image_config",description:`<strong>image_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageConfig">FlavaImageConfig</a>.`,name:"image_config"},{anchor:"transformers.FlavaConfig.multimodal_config",description:`<strong>multimodal_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaMultimodalConfig">FlavaMultimodalConfig</a>.`,name:"multimodal_config"},{anchor:"transformers.FlavaConfig.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.FlavaConfig.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.FlavaConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimentionality of text and image projection layers.`,name:"projection_dim"},{anchor:"transformers.FlavaConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> paramter. Default is used as per the original FLAVA/CLIP
implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.FlavaConfig.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.FlavaConfig.ce_ignore_index",description:`<strong>ce_ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to -100) &#x2014;
Cross entropy index to ignore.`,name:"ce_ignore_index"},{anchor:"transformers.FlavaConfig.mim_weight",description:`<strong>mim_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to MIM (Masked Image Modeling) unimodal loss`,name:"mim_weight"},{anchor:"transformers.FlavaConfig.mlm_weight",description:`<strong>mlm_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to MLM (Masked Language Modeling) unimodal loss`,name:"mlm_weight"},{anchor:"transformers.FlavaConfig.global_contrastive_weight",description:`<strong>global_contrastive_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to global contrastive cross-alignment loss.`,name:"global_contrastive_weight"},{anchor:"transformers.FlavaConfig.itm_weight",description:`<strong>itm_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to image-text matching multimodal loss.`,name:"itm_weight"},{anchor:"transformers.FlavaConfig.mmm_image_weight",description:`<strong>mmm_image_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to MMM loss&#x2019;s image part.`,name:"mmm_image_weight"},{anchor:"transformers.FlavaConfig.mmm_text_weight",description:`<strong>mmm_text_weight</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Weight to be assigned to MMM loss&#x2019;s text part.`,name:"mmm_text_weight"},{anchor:"transformers.FlavaConfig.global_backprop_contrastive",description:`<strong>global_backprop_contrastive</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use global backpropgation through all workers in contrastive loss.`,name:"global_backprop_contrastive"},{anchor:"transformers.FlavaConfig.skip_unmasked_multimodal_encoder",description:`<strong>skip_unmasked_multimodal_encoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to skip running unmasked multimodal encoder whose outputs are not used by FLAVA losses.`,name:"skip_unmasked_multimodal_encoder"},{anchor:"transformers.FlavaConfig.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to return loss or not`,name:"return_loss"},{anchor:"transformers.FlavaConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/configuration_flava.py#L467"}}),Ue=new ko({props:{anchor:"transformers.FlavaConfig.example",$$slots:{default:[gp]},$$scope:{ctx:x}}}),Co=new $({props:{name:"from_configs",anchor:"transformers.FlavaConfig.from_configs",parameters:[{name:"image_config",val:": FlavaImageConfig"},{name:"text_config",val:": FlavaTextConfig"},{name:"multimodal_config",val:": FlavaMultimodalConfig"},{name:"image_codebook_config",val:": FlavaImageCodebookConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/configuration_flava.py#L741",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaConfig"
>FlavaConfig</a></p>
`}}),Eo=new C({}),Ao=new $({props:{name:"class transformers.FlavaTextConfig",anchor:"transformers.FlavaTextConfig",parameters:[{name:"vocab_size",val:": int = 30522"},{name:"type_vocab_size",val:": int = 2"},{name:"max_position_embeddings",val:": int = 512"},{name:"position_embedding_type",val:": str = 'absolute'"},{name:"hidden_size",val:": int = 768"},{name:"num_hidden_layers",val:": int = 12"},{name:"num_attention_heads",val:": int = 12"},{name:"intermediate_size",val:": int = 3072"},{name:"hidden_act",val:": str = 'gelu'"},{name:"hidden_dropout_prob",val:": float = 0.0"},{name:"attention_probs_dropout_prob",val:": float = 0.0"},{name:"initializer_range",val:": float = 0.02"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"pad_token_id",val:": int = 0"},{name:"qkv_bias",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel">FlavaTextModel</a>.`,name:"vocab_size"},{anchor:"transformers.FlavaTextConfig.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/main/en/model_doc/flava#transformers.FlavaTextModel">FlavaTextModel</a>. Note that even though
text encoder allows <code>token_type_ids</code>&#x2019;s value as 2, for text-only pretraining and fine-tuning, only 1 is
used similar to RoBERTa.`,name:"type_vocab_size"},{anchor:"transformers.FlavaTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048). For VL, max_length passed to model is 77.`,name:"max_position_embeddings"},{anchor:"transformers.FlavaTextConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.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.FlavaTextConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.FlavaTextConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.FlavaTextConfig.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.FlavaTextConfig.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/configuration_flava.py#L150"}}),Je=new ko({props:{anchor:"transformers.FlavaTextConfig.example",$$slots:{default:[up]},$$scope:{ctx:x}}}),No=new C({}),Zo=new $({props:{name:"class transformers.FlavaImageConfig",anchor:"transformers.FlavaImageConfig",parameters:[{name:"hidden_size",val:": int = 768"},{name:"num_hidden_layers",val:": int = 12"},{name:"num_attention_heads",val:": int = 12"},{name:"intermediate_size",val:": int = 3072"},{name:"hidden_act",val:": int = 'gelu'"},{name:"hidden_dropout_prob",val:": float = 0.0"},{name:"attention_probs_dropout_prob",val:": float = 0.0"},{name:"initializer_range",val:": float = 0.02"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"image_size",val:": int = 224"},{name:"patch_size",val:": int = 16"},{name:"num_channels",val:": int = 3"},{name:"qkv_bias",val:": bool = True"},{name:"mask_token",val:": bool = True"},{name:"vocab_size",val:": int = 8192"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.FlavaImageConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.FlavaImageConfig.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.FlavaImageConfig.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.FlavaImageConfig.mask_token",description:`<strong>mask_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use a mask token or not. Used in MIM (Masked Image Modeling) loss for FLAVA.`,name:"mask_token"},{anchor:"transformers.FlavaImageConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Vocabulary size of the <a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageCodebook">FlavaImageCodebook</a> used in conjunction with <a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel">FlavaImageModel</a> for MIM (Masked
Image Modeling) loss for FLAVA.`,name:"vocab_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/configuration_flava.py#L31"}}),Be=new ko({props:{anchor:"transformers.FlavaImageConfig.example",$$slots:{default:[_p]},$$scope:{ctx:x}}}),Ro=new C({}),Go=new $({props:{name:"class transformers.FlavaMultimodalConfig",anchor:"transformers.FlavaMultimodalConfig",parameters:[{name:"hidden_size",val:": int = 768"},{name:"num_hidden_layers",val:": int = 6"},{name:"num_attention_heads",val:": int = 12"},{name:"intermediate_size",val:": int = 3072"},{name:"hidden_act",val:": int = 'gelu'"},{name:"hidden_dropout_prob",val:": int = 0.0"},{name:"attention_probs_dropout_prob",val:": int = 0.0"},{name:"initializer_range",val:": float = 0.02"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"qkv_bias",val:": bool = True"},{name:"use_cls_token",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.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.FlavaMultimodalConfig.use_cls_token",description:`<strong>use_cls_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use an extra CLS token for multimodal settings. Usually needed by the FLAVA model.`,name:"use_cls_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/configuration_flava.py#L279"}}),Ge=new ko({props:{anchor:"transformers.FlavaMultimodalConfig.example",$$slots:{default:[vp]},$$scope:{ctx:x}}}),Oo=new C({}),Xo=new $({props:{name:"class transformers.FlavaImageCodebookConfig",anchor:"transformers.FlavaImageCodebookConfig",parameters:[{name:"num_groups",val:": int = 4"},{name:"input_channels",val:": int = 3"},{name:"num_blocks_per_group",val:": int = 2"},{name:"hidden_size",val:": int = 256"},{name:"vocab_size",val:": int = 8192"},{name:"freeze",val:": int = True"},{name:"initializer_range",val:": float = 0.02"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/configuration_flava.py#L382"}}),Yo=new C({}),Ho=new $({props:{name:"class transformers.FlavaProcessor",anchor:"transformers.FlavaProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaProcessor.image_processor",description:'<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageProcessor">FlavaImageProcessor</a>) &#x2014; The image processor is a required input.',name:"image_processor"},{anchor:"transformers.FlavaProcessor.tokenizer",description:'<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>) &#x2014; The tokenizer is a required input.',name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/processing_flava.py#L28"}}),Qo=new $({props:{name:"batch_decode",anchor:"transformers.FlavaProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/processing_flava.py#L130"}}),et=new $({props:{name:"decode",anchor:"transformers.FlavaProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/processing_flava.py#L137"}}),tt=new C({}),nt=new $({props:{name:"class transformers.FlavaFeatureExtractor",anchor:"transformers.FlavaFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/feature_extraction_flava.py#L26"}}),rt=new C({}),st=new $({props:{name:"class transformers.FlavaImageProcessor",anchor:"transformers.FlavaImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{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.Iterable[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"return_image_mask",val:": bool = False"},{name:"input_size_patches",val:": int = 14"},{name:"total_mask_patches",val:": int = 75"},{name:"mask_group_min_patches",val:": int = 16"},{name:"mask_group_max_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_aspect_ratio",val:": float = 0.3"},{name:"mask_group_max_aspect_ratio",val:": typing.Optional[float] = None"},{name:"return_codebook_pixels",val:": bool = False"},{name:"codebook_do_resize",val:": bool = True"},{name:"codebook_size",val:": bool = None"},{name:"codebook_resample",val:": int = <Resampling.LANCZOS: 1>"},{name:"codebook_do_center_crop",val:": bool = True"},{name:"codebook_crop_size",val:": int = None"},{name:"codebook_do_rescale",val:": bool = True"},{name:"codebook_rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"codebook_do_map_pixels",val:": bool = True"},{name:"codebook_do_normalize",val:": bool = True"},{name:"codebook_image_mean",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"codebook_image_std",val:": typing.Union[float, typing.Iterable[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlavaImageProcessor.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 <code>preprocess</code>.`,name:"do_resize"},{anchor:"transformers.FlavaImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of the image after resizing. Can be overridden by the <code>size</code> parameter in <code>preprocess</code>.`,name:"size"},{anchor:"transformers.FlavaImageProcessor.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. Can be overridden by the <code>resample</code> parameter in
<code>preprocess</code>.`,name:"resample"},{anchor:"transformers.FlavaImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the images. Can be overridden by the <code>do_center_crop</code> parameter in <code>preprocess</code>.`,name:"do_center_crop"},{anchor:"transformers.FlavaImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Size of image after the center crop <code>(crop_size[&quot;height&quot;], crop_size[&quot;width&quot;])</code>. Can be overridden by the
<code>crop_size</code> parameter in <code>preprocess</code>.`,name:"crop_size"},{anchor:"transformers.FlavaImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in <code>preprocess</code>.`,name:"do_rescale"},{anchor:"transformers.FlavaImageProcessor.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. Can be overridden by the <code>rescale_factor</code> parameter in
<code>preprocess</code>.`,name:"rescale_factor"},{anchor:"transformers.FlavaImageProcessor.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 <code>preprocess</code>.`,name:"do_normalize"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_mean"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_std"},{anchor:"transformers.FlavaImageProcessor.return_image_mask",description:`<strong>return_image_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to return the image mask. Can be overridden by the <code>return_image_mask</code> parameter in <code>preprocess</code>.`,name:"return_image_mask"},{anchor:"transformers.FlavaImageProcessor.input_size_patches",description:`<strong>input_size_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 14) &#x2014;
Number of patches in the image in height and width direction. 14x14 = 196 total patches. Can be overridden
by the <code>input_size_patches</code> parameter in <code>preprocess</code>.`,name:"input_size_patches"},{anchor:"transformers.FlavaImageProcessor.total_mask_patches",description:`<strong>total_mask_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 75) &#x2014;
Total number of patches that should be masked. Can be overridden by the <code>total_mask_patches</code> parameter in
<code>preprocess</code>.`,name:"total_mask_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_min_patches",description:`<strong>mask_group_min_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Minimum number of patches that should be masked. Can be overridden by the <code>mask_group_min_patches</code>
parameter in <code>preprocess</code>.`,name:"mask_group_min_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_max_patches",description:`<strong>mask_group_max_patches</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum number of patches that should be masked. Can be overridden by the <code>mask_group_max_patches</code>
parameter in <code>preprocess</code>.`,name:"mask_group_max_patches"},{anchor:"transformers.FlavaImageProcessor.mask_group_min_aspect_ratio",description:`<strong>mask_group_min_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
Minimum aspect ratio of the mask window. Can be overridden by the <code>mask_group_min_aspect_ratio</code> parameter
in <code>preprocess</code>.`,name:"mask_group_min_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.mask_group_max_aspect_ratio",description:`<strong>mask_group_max_aspect_ratio</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Maximum aspect ratio of the mask window. Can be overridden by the <code>mask_group_max_aspect_ratio</code> parameter
in <code>preprocess</code>.`,name:"mask_group_max_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.codebook_do_resize",description:`<strong>codebook_do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the input for codebook to a certain. Can be overridden by the <code>codebook_do_resize</code>
parameter in <code>preprocess</code>. <code>codebook_size</code>.`,name:"codebook_do_resize"},{anchor:"transformers.FlavaImageProcessor.codebook_size",description:`<strong>codebook_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Resize the input for codebook to the given size. Can be overridden by the <code>codebook_size</code> parameter in
<code>preprocess</code>.`,name:"codebook_size"},{anchor:"transformers.FlavaImageProcessor.codebook_resample",description:`<strong>codebook_resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.LANCZOS</code>) &#x2014;
Resampling filter to use if resizing the codebook image. Can be overridden by the <code>codebook_resample</code>
parameter in <code>preprocess</code>.`,name:"codebook_resample"},{anchor:"transformers.FlavaImageProcessor.codebook_do_center_crop",description:`<strong>codebook_do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to crop the input for codebook at the center. If the input size is smaller than
<code>codebook_crop_size</code> along any edge, the image is padded with 0&#x2019;s and then center cropped. Can be
overridden by the <code>codebook_do_center_crop</code> parameter in <code>preprocess</code>.`,name:"codebook_do_center_crop"},{anchor:"transformers.FlavaImageProcessor.codebook_crop_size",description:`<strong>codebook_crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 224, &quot;width&quot;: 224}</code>):
Desired output size for codebook input when applying center-cropping. Can be overridden by the
<code>codebook_crop_size</code> parameter in <code>preprocess</code>.`,name:"codebook_crop_size"},{anchor:"transformers.FlavaImageProcessor.codebook_do_rescale",description:`<strong>codebook_do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the input for codebook by the specified scale <code>codebook_rescale_factor</code>. Can be
overridden by the <code>codebook_do_rescale</code> parameter in <code>preprocess</code>.`,name:"codebook_do_rescale"},{anchor:"transformers.FlavaImageProcessor.codebook_rescale_factor",description:`<strong>codebook_rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Defines the scale factor to use if rescaling the codebook image. Can be overridden by the
<code>codebook_rescale_factor</code> parameter in <code>preprocess</code>.`,name:"codebook_rescale_factor"},{anchor:"transformers.FlavaImageProcessor.codebook_do_map_pixels",description:`<strong>codebook_do_map_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to map the pixel values of the codebook input to (1 - 2e)x + e. Can be overridden by the
<code>codebook_do_map_pixels</code> parameter in <code>preprocess</code>.`,name:"codebook_do_map_pixels"},{anchor:"transformers.FlavaImageProcessor.codebook_do_normalize",description:`<strong>codebook_do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the input for codebook with <code>codebook_image_mean</code> and <code>codebook_image_std</code>. Can
be overridden by the <code>codebook_do_normalize</code> parameter in <code>preprocess</code>.`,name:"codebook_do_normalize"},{anchor:"transformers.FlavaImageProcessor.codebook_image_mean",description:`<strong>codebook_image_mean</strong> (<code>Optional[Union[float, Iterable[float]]]</code>, <em>optional</em>, defaults to <code>[0, 0, 0]</code>) &#x2014;
The sequence of means for each channel, to be used when normalizing images for codebook. Can be overridden
by the <code>codebook_image_mean</code> parameter in <code>preprocess</code>.`,name:"codebook_image_mean"},{anchor:"transformers.FlavaImageProcessor.codebook_image_std",description:`<strong>codebook_image_std</strong> (<code>Optional[Union[float, Iterable[float]]]</code>, <em>optional</em>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images for codebook. Can
be overridden by the <code>codebook_image_std</code> parameter in <code>preprocess</code>.`,name:"codebook_image_std"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/image_processing_flava.py#L135"}}),it=new $({props:{name:"preprocess",anchor:"transformers.FlavaImageProcessor.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.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = 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:"return_image_mask",val:": typing.Optional[bool] = None"},{name:"input_size_patches",val:": typing.Optional[int] = None"},{name:"total_mask_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_patches",val:": typing.Optional[int] = None"},{name:"mask_group_max_patches",val:": typing.Optional[int] = None"},{name:"mask_group_min_aspect_ratio",val:": typing.Optional[float] = None"},{name:"mask_group_max_aspect_ratio",val:": typing.Optional[float] = None"},{name:"return_codebook_pixels",val:": typing.Optional[bool] = None"},{name:"codebook_do_resize",val:": typing.Optional[bool] = None"},{name:"codebook_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"codebook_resample",val:": typing.Optional[int] = None"},{name:"codebook_do_center_crop",val:": typing.Optional[bool] = None"},{name:"codebook_crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"codebook_do_rescale",val:": typing.Optional[bool] = None"},{name:"codebook_rescale_factor",val:": typing.Optional[float] = None"},{name:"codebook_do_map_pixels",val:": typing.Optional[bool] = None"},{name:"codebook_do_normalize",val:": typing.Optional[bool] = None"},{name:"codebook_image_mean",val:": typing.Optional[typing.Iterable[float]] = None"},{name:"codebook_image_std",val:": typing.Optional[typing.Iterable[float]] = 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.FlavaImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image.`,name:"size"},{anchor:"transformers.FlavaImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>, Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.FlavaImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.FlavaImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.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.FlavaImageProcessor.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.FlavaImageProcessor.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.`,name:"image_mean"},{anchor:"transformers.FlavaImageProcessor.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.`,name:"image_std"},{anchor:"transformers.FlavaImageProcessor.preprocess.return_image_mask",description:`<strong>return_image_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.return_image_mask</code>) &#x2014;
Whether to return the image mask.`,name:"return_image_mask"},{anchor:"transformers.FlavaImageProcessor.preprocess.input_size_patches",description:`<strong>input_size_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.input_size_patches</code>) &#x2014;
Size of the patches to extract from the image.`,name:"input_size_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.total_mask_patches",description:`<strong>total_mask_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.total_mask_patches</code>) &#x2014;
Total number of patches to extract from the image.`,name:"total_mask_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_min_patches",description:`<strong>mask_group_min_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.mask_group_min_patches</code>) &#x2014;
Minimum number of patches to extract from the image.`,name:"mask_group_min_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_max_patches",description:`<strong>mask_group_max_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.mask_group_max_patches</code>) &#x2014;
Maximum number of patches to extract from the image.`,name:"mask_group_max_patches"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_min_aspect_ratio",description:`<strong>mask_group_min_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.mask_group_min_aspect_ratio</code>) &#x2014;
Minimum aspect ratio of the patches to extract from the image.`,name:"mask_group_min_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.preprocess.mask_group_max_aspect_ratio",description:`<strong>mask_group_max_aspect_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.mask_group_max_aspect_ratio</code>) &#x2014;
Maximum aspect ratio of the patches to extract from the image.`,name:"mask_group_max_aspect_ratio"},{anchor:"transformers.FlavaImageProcessor.preprocess.return_codebook_pixels",description:`<strong>return_codebook_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.return_codebook_pixels</code>) &#x2014;
Whether to return the codebook pixels.`,name:"return_codebook_pixels"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_resize",description:`<strong>codebook_do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_resize</code>) &#x2014;
Whether to resize the codebook pixels.`,name:"codebook_do_resize"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_size",description:`<strong>codebook_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.codebook_size</code>) &#x2014;
Size of the codebook pixels.`,name:"codebook_size"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_resample",description:`<strong>codebook_resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.codebook_resample</code>) &#x2014;
Resampling filter to use if resizing the codebook pixels. This can be one of the enum
<code>PILImageResampling</code>, Only has an effect if <code>codebook_do_resize</code> is set to <code>True</code>.`,name:"codebook_resample"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_center_crop",description:`<strong>codebook_do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_center_crop</code>) &#x2014;
Whether to center crop the codebook pixels.`,name:"codebook_do_center_crop"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_crop_size",description:`<strong>codebook_crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.codebook_crop_size</code>) &#x2014;
Size of the center crop of the codebook pixels. Only has an effect if <code>codebook_do_center_crop</code> is set
to <code>True</code>.`,name:"codebook_crop_size"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_rescale",description:`<strong>codebook_do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_rescale</code>) &#x2014;
Whether to rescale the codebook pixels values between [0 - 1].`,name:"codebook_do_rescale"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_rescale_factor",description:`<strong>codebook_rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.codebook_rescale_factor</code>) &#x2014;
Rescale factor to rescale the codebook pixels by if <code>codebook_do_rescale</code> is set to <code>True</code>.`,name:"codebook_rescale_factor"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_map_pixels",description:`<strong>codebook_do_map_pixels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_map_pixels</code>) &#x2014;
Whether to map the codebook pixels values.`,name:"codebook_do_map_pixels"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_do_normalize",description:`<strong>codebook_do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.codebook_do_normalize</code>) &#x2014;
Whether to normalize the codebook pixels.`,name:"codebook_do_normalize"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_image_mean",description:`<strong>codebook_image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.codebook_image_mean</code>) &#x2014;
Codebook pixels mean to normalize the codebook pixels by if <code>codebook_do_normalize</code> is set to <code>True</code>.`,name:"codebook_image_mean"},{anchor:"transformers.FlavaImageProcessor.preprocess.codebook_image_std",description:`<strong>codebook_image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.codebook_image_std</code>) &#x2014;
Codebook pixels standard deviation to normalize the codebook pixels by if <code>codebook_do_normalize</code> is
set to <code>True</code>.`,name:"codebook_image_std"},{anchor:"transformers.FlavaImageProcessor.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.FlavaImageProcessor.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.FlavaImageProcessor.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/main/src/transformers/models/flava/image_processing_flava.py#L447"}}),lt=new C({}),dt=new $({props:{name:"class transformers.FlavaForPreTraining",anchor:"transformers.FlavaForPreTraining",parameters:[{name:"config",val:": FlavaConfig"},{name:"image_codebook",val:": typing.Optional[torch.nn.modules.module.Module] = None"}],parametersDescription:[{anchor:"transformers.FlavaForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaConfig">FlavaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlavaForPreTraining.image_codebook",description:`<strong>image_codebook</strong> (<code>nn.Module</code>) &#x2014; If passed, the image codebook will be set to this. Otherwise. it will
be initialized using the image_codebook_config defined in the config first as the first parameter.`,name:"image_codebook"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1727"}}),pt=new $({props:{name:"forward",anchor:"transformers.FlavaForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_ids_masked",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"codebook_pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"image_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"skip_unmasked_multimodal_encoder",val:": bool = None"},{name:"mlm_labels",val:": typing.Optional[torch.Tensor] = None"},{name:"mim_labels",val:": typing.Optional[torch.Tensor] = None"},{name:"itm_labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": bool = True"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaForPreTraining.forward.input_ids_masked",description:`<strong>input_ids_masked</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_len)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. These ones are the masked version of the original task
to be used with MLM. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> along with
<code>DataCollatorForMaskedLanguageModeling</code>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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_masked"},{anchor:"transformers.FlavaForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_len)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.FlavaForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_len)</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.FlavaForPreTraining.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">FlavaImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlavaForPreTraining.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.FlavaForPreTraining.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.FlavaForPreTraining.forward.image_attention_mask",description:`<strong>image_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices specifically for images. 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:"image_attention_mask"},{anchor:"transformers.FlavaForPreTraining.forward.skip_unmasked_multimodal_encoder",description:`<strong>skip_unmasked_multimodal_encoder</strong> (<em>bool</em>, <em>optional</em>) &#x2014;
Skip any calculations for multimodal encoder for unmasked inputs. FLAVA pretraining doesn&#x2019;t need unmasked
multimodal embeddings or outputs as of now.`,name:"skip_unmasked_multimodal_encoder"},{anchor:"transformers.FlavaForPreTraining.forward.mlm_labels",description:`<strong>mlm_labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_len)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language and multimodal masked modeling loss (next word prediction).
Indices should be in <code>[-100, 0, ..., text_config.vocab_size - 1]</code> (see <code>input_ids</code> docstring). Tokens with
indices set to <code>-100</code> are ignored (masked), the loss is only computed for the tokens with labels in <code>[0, ..., text_config.vocab_size - 1]</code>.`,name:"mlm_labels"},{anchor:"transformers.FlavaForPreTraining.forward.mim_labels",description:`<strong>mim_labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, image_num_patches)</code>, <em>optional</em>) &#x2014;
Labels for computing the image and multimodal masked modeling loss. Indices should be in <code>[-100, 0, ..., image_config.vocab_size - 1]</code>. Tokens with indices set to <code>-100</code> are ignored (masked), the loss is only
computed for the tokens with labels in <code>[0, ..., image_config.vocab_size - 1]</code>. If not passed, they are
generated automatically using the image codebook assigned to the model. By default, it uses
<a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageCodebook">FlavaImageCodebook</a>. See <a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageCodebook">FlavaImageCodebook</a> to understand how to generate mim_labels.`,name:"mim_labels"},{anchor:"transformers.FlavaForPreTraining.forward.itm_labels",description:`<strong>itm_labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 1)</code>, <em>optional</em>) &#x2014;
Labels for computing the image-text matching loss. 0 means the pairs don&#x2019;t match and 1 means they match.
The pairs with 0 will be skipped for calculation of MMM and global contrastive losses as well.`,name:"itm_labels"},{anchor:"transformers.FlavaForPreTraining.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>, default to None) &#x2014;
Whether to return calculated loss or not.`,name:"return_loss"},{anchor:"transformers.FlavaForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_len)</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.FlavaForPreTraining.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.FlavaForPreTraining.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.FlavaForPreTraining.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.FlavaForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>Examples &#x2014;`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1771",returnDescription:`
<p>A <code>transformers.models.flava.modeling_flava.FlavaForPreTrainingOutput</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 (<code>&lt;class 'transformers.models.flava.configuration_flava.FlavaConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code>, <em>optional</em>, returned when <code>return_loss</code> is True) \u2014 Total loss calculated for this model.</p>
</li>
<li>
<p><strong>loss_info</strong> (<code>FlavaLosses</code>) \u2014 Detailed info for FLAVA Pretraining losses. Check <code>FlavaLosses</code> class description for the information on
the keys.</p>
</li>
<li>
<p><strong>image_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The image embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>.</p>
</li>
<li>
<p><strong>image_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>.</p>
</li>
<li>
<p><strong>text_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> are present) \u2014 The text embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>text_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>input_ids</code> are present) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>multimodal_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> and <code>pixel_values</code> are present and <code>skip_unmasked_multimodal_encoder</code> is <code>None</code> or <code>False</code>) \u2014 The multimodal embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>multimodal_output</strong> (<code>BaseModelOutputWithPooling</code>, returned when <code>input_ids</code> and <code>pixel_values</code> are present and <code>skip_unmasked_multimodal_encoder</code> is <code>None</code> or <code>False</code>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaMultimodalModel"
>FlavaMultimodalModel</a>.</p>
</li>
<li>
<p><strong>image_masked_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The image embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>. Uses <code>bool_masked_pos</code>
to create masked images.</p>
</li>
<li>
<p><strong>image_masked_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>. Uses <code>bool_masked_pos</code> to create masked images.</p>
</li>
<li>
<p><strong>text_masked_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids_masked</code> are present) \u2014 The text embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>text_masked_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>input_ids_masked</code> are present) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>multimodal_masked_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> and <code>pixel_values</code> are present) \u2014 The multimodal embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</p>
</li>
<li>
<p><strong>multimodal_masked_output</strong> (<code>BaseModelOutputWithPooling</code>, returned when <code>input_ids_masked</code> and <code>pixel_values</code> are present) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaMultimodalModel"
>FlavaMultimodalModel</a>.</p>
</li>
<li>
<p><strong>mim_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_image_patches, image_vocab_size)</code> or of shape <code>(total_masked_patches, image_vocab_size)</code> , <em>optional</em>, returned when <code>pixel_values</code> are present and <code>input_ids_masked</code> are not) \u2014 The logits for MIM unimodal loss. Uses <code>book_masked_pos</code> to get masked patches. The flattened output is
returned when <code>bool_masked_pos</code> has some of the patches masked.</p>
</li>
<li>
<p><strong>mlm_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_length, text_vocab_size)</code> or of shape <code>(total_masked_seq_length, text_vocab_size)</code>, <em>optional</em>, returned when <code>input_ids_masked</code> are present and <code>pixel_values</code> are not) \u2014 The logits for MLM unimodal loss. The flattened output is returned when <code>input_ids_masked</code> has some of
the tokens masked.</p>
</li>
<li>
<p><strong>itm_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 2)</code>, <em>optional</em>, returned when <code>input_ids_masked</code> and <code>pixel_values</code> are present) \u2014 The logits for ITM loss. Note that ITM loss is calculated on masked pairs in FLAVA.</p>
</li>
<li>
<p><strong>mmm_image_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_image_patches, image_vocab_size)</code> or of shape<code>(total_masked_patches, image_vocab_size)</code>, <em>optional</em>, returned when <code>pixel_values</code> and <code>input_ids_masked</code> are present) \u2014 The logits for MMM image multimodal loss. Uses <code>book_masked_pos</code> to get masked patches. The flattened
output is returned when <code>bool_masked_pos</code> has some of the patches masked.</p>
</li>
<li>
<p><strong>mmm_text_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_length, text_vocab_size)</code> or of shape <code>(</code>(total_masked_seq_length, text_vocab_size)<code>), *optional*, returned when </code>pixel_values<code>and</code>input_ids_masked<code>are present) -- The logits for MMM text multimodal loss. The flattened output is returned when</code>input_ids_masked\` has
some of the tokens masked.</p>
</li>
<li>
<p><strong>contrastive_logits_per_image</strong> (<code>torch.FloatTensor</code> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeddings</code> and <code>text_embeddings</code> but passed through FLAVA\u2019s
<code>image_projection</code> and <code>text_projection</code> layers respectively. This represents the image-text similarity
scores. This is calculated on unmasked images and texts.</p>
</li>
<li>
<p><strong>contrastive_logits_per_text</strong> (<code>torch.FloatTensor</code> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeddings</code> and <code>image_embeddings</code> but passed through FLAVA\u2019s
<code>text_projection</code> and <code>image_projection</code> layers respectively. This is calculated on unmasked images and
texts.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.flava.modeling_flava.FlavaForPreTrainingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qe=new Ot({props:{$$slots:{default:[bp]},$$scope:{ctx:x}}}),ft=new C({}),ht=new $({props:{name:"class transformers.FlavaModel",anchor:"transformers.FlavaModel",parameters:[{name:"config",val:": FlavaConfig"}],parametersDescription:[{anchor:"transformers.FlavaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaConfig">FlavaConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1193"}}),_t=new $({props:{name:"forward",anchor:"transformers.FlavaModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"image_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"skip_multimodal_encoder",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": bool = True"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">FlavaImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlavaModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.FlavaModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.FlavaModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.FlavaModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len)</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.FlavaModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len)</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.FlavaModel.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.FlavaModel.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.FlavaModel.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.FlavaModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FlavaModel.forward.skip_multimodal_encoder",description:`<strong>skip_multimodal_encoder</strong> (<em>bool</em>, <em>optional</em>) &#x2014;
Skip any calculations for multimodal encoder. Useful if multimodal encoding is not going to be used.`,name:"skip_multimodal_encoder"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1337",returnDescription:`
<p>A <code>transformers.models.flava.modeling_flava.FlavaModelOutput</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 (<code>&lt;class 'transformers.models.flava.configuration_flava.FlavaConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>image_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The image embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>.</li>
<li><strong>image_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>pixel_values</code> are present) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel"
>FlavaImageModel</a>.</li>
<li><strong>text_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> are present) \u2014 The text embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</li>
<li><strong>text_output</strong> (<code>BaseModelOutputWithPooling</code>, <em>optional</em>, returned when <code>input_ids</code> are present) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</li>
<li><strong>multimodal_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code>, <em>optional</em>, returned when <code>input_ids</code> and <code>pixel_values</code> are present and <code>skip_multimodal_encoder</code> is <code>None</code> or <code>False</code>) \u2014 The multimodal embeddings which are basically the pooled output of <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"
>FlavaTextModel</a>.</li>
<li><strong>multimodal_output</strong> (<code>BaseModelOutputWithPooling</code>, returned when <code>input_ids</code> and <code>pixel_values</code> are present and <code>skip_multimodal_encoder</code> is <code>None</code> or <code>False</code>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaMultimodalModel"
>FlavaMultimodalModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.flava.modeling_flava.FlavaModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),eo=new Ot({props:{$$slots:{default:[kp]},$$scope:{ctx:x}}}),oo=new ko({props:{anchor:"transformers.FlavaModel.forward.example",$$slots:{default:[yp]},$$scope:{ctx:x}}}),vt=new $({props:{name:"get_text_features",anchor:"transformers.FlavaModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"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.FlavaModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.FlavaModel.get_text_features.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_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.FlavaModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_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.FlavaModel.get_text_features.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.FlavaModel.get_text_features.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.FlavaModel.get_text_features.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.FlavaModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1239"}}),to=new Ot({props:{$$slots:{default:[Fp]},$$scope:{ctx:x}}}),bt=new $({props:{name:"get_image_features",anchor:"transformers.FlavaModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaModel.get_image_features.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">FlavaImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlavaModel.get_image_features.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.FlavaModel.get_image_features.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.FlavaModel.get_image_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches)</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.FlavaModel.get_image_features.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.FlavaModel.get_image_features.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.FlavaModel.get_image_features.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.FlavaModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1285"}}),ao=new Ot({props:{$$slots:{default:[Tp]},$$scope:{ctx:x}}}),kt=new C({}),yt=new $({props:{name:"class transformers.FlavaImageCodebook",anchor:"transformers.FlavaImageCodebook",parameters:[{name:"config",val:": FlavaImageCodebookConfig"},{name:"**kwargs",val:": typing.Any"}],parametersDescription:[{anchor:"transformers.FlavaImageCodebook.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageCodebookConfig">FlavaImageCodebookConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1511"}}),Mt=new $({props:{name:"forward",anchor:"transformers.FlavaImageCodebook.forward",parameters:[{name:"pixel_values",val:": FloatTensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1595"}}),xt=new $({props:{name:"get_codebook_indices",anchor:"transformers.FlavaImageCodebook.get_codebook_indices",parameters:[{name:"pixel_values",val:": Tensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1561"}}),$t=new $({props:{name:"get_codebook_probs",anchor:"transformers.FlavaImageCodebook.get_codebook_probs",parameters:[{name:"pixel_values",val:": Tensor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1591"}}),It=new C({}),zt=new $({props:{name:"class transformers.FlavaTextModel",anchor:"transformers.FlavaTextModel",parameters:[{name:"config",val:": FlavaTextConfig"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.FlavaTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextConfig">FlavaTextConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L990"}}),Et=new $({props:{name:"forward",anchor:"transformers.FlavaTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"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.FlavaTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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.FlavaTextModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, text_seq_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.FlavaTextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, text_seq_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.FlavaTextModel.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.FlavaTextModel.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.FlavaTextModel.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.FlavaTextModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1021",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextConfig"
>FlavaTextConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),so=new Ot({props:{$$slots:{default:[wp]},$$scope:{ctx:x}}}),io=new ko({props:{anchor:"transformers.FlavaTextModel.forward.example",$$slots:{default:[Mp]},$$scope:{ctx:x}}}),At=new C({}),Wt=new $({props:{name:"class transformers.FlavaImageModel",anchor:"transformers.FlavaImageModel",parameters:[{name:"config",val:": FlavaImageConfig"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.FlavaImageModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageConfig">FlavaImageConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L891"}}),Nt=new $({props:{name:"forward",anchor:"transformers.FlavaImageModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"bool_masked_pos",val:": typing.Optional[torch.BoolTensor] = None"},{name:"interpolate_pos_encoding",val:": typing.Optional[bool] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaImageModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">FlavaImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlavaImageModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_num_patches)</code>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.FlavaImageModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{anchor:"transformers.FlavaImageModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches)</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.FlavaImageModel.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.FlavaImageModel.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.FlavaImageModel.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.FlavaImageModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L924",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageConfig"
>FlavaImageConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),co=new Ot({props:{$$slots:{default:[xp]},$$scope:{ctx:x}}}),mo=new ko({props:{anchor:"transformers.FlavaImageModel.forward.example",$$slots:{default:[$p]},$$scope:{ctx:x}}}),Zt=new C({}),Jt=new $({props:{name:"class transformers.FlavaMultimodalModel",anchor:"transformers.FlavaMultimodalModel",parameters:[{name:"config",val:": FlavaMultimodalConfig"},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.FlavaMultimodalModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaMultimodalConfig">FlavaMultimodalConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1095"}}),Rt=new $({props:{name:"forward",anchor:"transformers.FlavaMultimodalModel.forward",parameters:[{name:"hidden_states",val:": Tensor"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.FlavaMultimodalModel.forward.hidden_states",description:`<strong>hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len, hidden_size)</code>) &#x2014;
The concatenated hidden states of unimodal encoders.`,name:"hidden_states"},{anchor:"transformers.FlavaMultimodalModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, image_num_patches + text_seq_len)</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.FlavaMultimodalModel.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.FlavaMultimodalModel.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.FlavaMultimodalModel.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.FlavaMultimodalModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/flava/modeling_flava.py#L1123",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/flava#transformers.FlavaMultimodalConfig"
>FlavaMultimodalConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fo=new Ot({props:{$$slots:{default:[Ip]},$$scope:{ctx:x}}}),ho=new ko({props:{anchor:"transformers.FlavaMultimodalModel.forward.example",$$slots:{default:[zp]},$$scope:{ctx:x}}}),{c(){c=a("meta"),M=m(),_=a("h1"),g=a("a"),v=a("span"),b(l.$$.fragment),f=m(),I=a("span"),ls=s("FLAVA"),On=m(),se=a("h2"),Ae=a("a"),Sa=a("span"),b(To.$$.fragment),ds=m(),La=a("span"),cs=s("Overview"),Dn=m(),We=a("p"),ms=s("The FLAVA model was proposed in "),wo=a("a"),ps=s("FLAVA: A Foundational Language And Vision Alignment Model"),fs=s(" by Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela and is accepted at CVPR 2022."),Xn=m(),Dt=a("p"),hs=s(`The paper aims at creating a single unified foundation model which can work across vision, language
as well as vision-and-language multimodal tasks.`),Yn=m(),Xt=a("p"),gs=s("The abstract from the paper is the following:"),Hn=m(),Yt=a("p"),Oa=a("em"),us=s(`State-of-the-art vision and vision-and-language models rely on large-scale visio-linguistic pretraining for obtaining good performance on a variety
of downstream tasks. Generally, such models are often either cross-modal (contrastive) or multi-modal
(with earlier fusion) but not both; and they often only target specific modalities or tasks. A promising
direction would be to use a single holistic universal model, as a \u201Cfoundation\u201D, that targets all modalities
at once \u2014 a true vision and language foundation model should be good at vision tasks, language tasks, and
cross- and multi-modal vision and language tasks. We introduce FLAVA as such a model and demonstrate
impressive performance on a wide range of 35 tasks spanning these target modalities.`),Qn=m(),X=a("p"),_s=s("This model was contributed by "),Mo=a("a"),vs=s("aps"),bs=s(". The original code can be found "),xo=a("a"),ks=s("here"),ys=s("."),Kn=m(),ie=a("h2"),je=a("a"),Da=a("span"),b($o.$$.fragment),Fs=m(),Xa=a("span"),Ts=s("FlavaConfig"),er=m(),P=a("div"),b(Io.$$.fragment),ws=m(),Y=a("p"),Ht=a("a"),Ms=s("FlavaConfig"),xs=s(" is the configuration class to store the configuration of a "),Qt=a("a"),$s=s("FlavaModel"),Is=s(`. It is used to
instantiate FLAVA model according to the specified arguments, defining the text model, image model, image codebook
and multimodal model configs. Instantiating a configuration with the defaults will yield a similar configuration to
that of the FLAVA `),zo=a("a"),zs=s("facebook/flava-full"),Cs=s(" architecture."),Ps=m(),le=a("p"),Es=s("Configuration objects inherit from "),Kt=a("a"),As=s("PretrainedConfig"),Ws=s(` and can be used to control the model outputs. Read the
documentation from `),ea=a("a"),js=s("PretrainedConfig"),Us=s(" for more information."),Ns=m(),b(Ue.$$.fragment),Zs=m(),Ne=a("div"),b(Co.$$.fragment),Js=m(),Po=a("p"),Vs=s("Instantiate a "),oa=a("a"),Bs=s("FlavaConfig"),Rs=s(` (or a derived class) from flava text model configuration, flava image model
configuration, flava multimodal model and flava codebook model configuration.`),or=m(),de=a("h2"),Ze=a("a"),Ya=a("span"),b(Eo.$$.fragment),Gs=m(),Ha=a("span"),qs=s("FlavaTextConfig"),tr=m(),E=a("div"),b(Ao.$$.fragment),Ss=m(),Wo=a("p"),Ls=s("This is the configuration class to store the configuration of a "),ta=a("a"),Os=s("FlavaTextModel"),Ds=s(`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),Xs=m(),jo=a("p"),Ys=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Uo=a("a"),Hs=s("facebook/flava-full"),Qs=s(" architecture."),Ks=m(),ce=a("p"),ei=s("Configuration objects inherit from "),aa=a("a"),oi=s("PretrainedConfig"),ti=s(` and can be used to control the model outputs. Read the
documentation from `),na=a("a"),ai=s("PretrainedConfig"),ni=s(" for more information."),ri=m(),b(Je.$$.fragment),ar=m(),me=a("h2"),Ve=a("a"),Qa=a("span"),b(No.$$.fragment),si=m(),Ka=a("span"),ii=s("FlavaImageConfig"),nr=m(),A=a("div"),b(Zo.$$.fragment),li=m(),Jo=a("p"),di=s("This is the configuration class to store the configuration of a "),ra=a("a"),ci=s("FlavaImageModel"),mi=s(`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),pi=m(),Vo=a("p"),fi=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Bo=a("a"),hi=s("facebook/flava-full"),gi=s(" architecture."),ui=m(),pe=a("p"),_i=s("Configuration objects inherit from "),sa=a("a"),vi=s("PretrainedConfig"),bi=s(` and can be used to control the model outputs. Read the
documentation from `),ia=a("a"),ki=s("PretrainedConfig"),yi=s(" for more information."),Fi=m(),b(Be.$$.fragment),rr=m(),fe=a("h2"),Re=a("a"),en=a("span"),b(Ro.$$.fragment),Ti=m(),on=a("span"),wi=s("FlavaMultimodalConfig"),sr=m(),W=a("div"),b(Go.$$.fragment),Mi=m(),qo=a("p"),xi=s("This is the configuration class to store the configuration of a "),la=a("a"),$i=s("FlavaMultimodalModel"),Ii=s(`. It is used to instantiate
an FLAVA model according to the specified arguments, defining the model architecture.`),zi=m(),So=a("p"),Ci=s(`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Lo=a("a"),Pi=s("facebook/flava-full"),Ei=s(" architecture."),Ai=m(),he=a("p"),Wi=s("Configuration objects inherit from "),da=a("a"),ji=s("PretrainedConfig"),Ui=s(` and can be used to control the model outputs. Read the
documentation from `),ca=a("a"),Ni=s("PretrainedConfig"),Zi=s(" for more information."),Ji=m(),b(Ge.$$.fragment),ir=m(),ge=a("h2"),qe=a("a"),tn=a("span"),b(Oo.$$.fragment),Vi=m(),an=a("span"),Bi=s("FlavaImageCodebookConfig"),lr=m(),Do=a("div"),b(Xo.$$.fragment),dr=m(),ue=a("h2"),Se=a("a"),nn=a("span"),b(Yo.$$.fragment),Ri=m(),rn=a("span"),Gi=s("FlavaProcessor"),cr=m(),j=a("div"),b(Ho.$$.fragment),qi=m(),sn=a("p"),Si=s("Constructs a FLAVA processor which wraps a FLAVA image processor and a FLAVA tokenizer into a single processor."),Li=m(),N=a("p"),ma=a("a"),Oi=s("FlavaProcessor"),Di=s(" offers all the functionalities of "),pa=a("a"),Xi=s("FlavaImageProcessor"),Yi=s(" and "),fa=a("a"),Hi=s("BertTokenizerFast"),Qi=s(`. See the
`),ln=a("code"),Ki=s("__call__()"),el=s(" and "),ha=a("a"),ol=s("decode()"),tl=s(" for more information."),al=m(),Le=a("div"),b(Qo.$$.fragment),nl=m(),Ko=a("p"),rl=s("This method forwards all its arguments to BertTokenizerFast\u2019s "),ga=a("a"),sl=s("batch_decode()"),il=s(`. Please
refer to the docstring of this method for more information.`),ll=m(),Oe=a("div"),b(et.$$.fragment),dl=m(),ot=a("p"),cl=s("This method forwards all its arguments to BertTokenizerFast\u2019s "),ua=a("a"),ml=s("decode()"),pl=s(`. Please refer to
the docstring of this method for more information.`),mr=m(),_e=a("h2"),De=a("a"),dn=a("span"),b(tt.$$.fragment),fl=m(),cn=a("span"),hl=s("FlavaFeatureExtractor"),pr=m(),at=a("div"),b(nt.$$.fragment),fr=m(),ve=a("h2"),Xe=a("a"),mn=a("span"),b(rt.$$.fragment),gl=m(),pn=a("span"),ul=s("FlavaImageProcessor"),hr=m(),q=a("div"),b(st.$$.fragment),_l=m(),fn=a("p"),vl=s("Constructs a Flava image processor."),bl=m(),Ye=a("div"),b(it.$$.fragment),kl=m(),hn=a("p"),yl=s("Preprocess an image or batch of images."),gr=m(),be=a("h2"),He=a("a"),gn=a("span"),b(lt.$$.fragment),Fl=m(),un=a("span"),Tl=s("FlavaForPreTraining"),ur=m(),Z=a("div"),b(dt.$$.fragment),wl=m(),_n=a("p"),Ml=s("The FLAVA model for pretraining which outputs losses, embeddings, logits and transformer outputs."),xl=m(),ct=a("p"),$l=s("This model is a PyTorch "),mt=a("a"),Il=s("torch.nn.Module"),zl=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cl=m(),H=a("div"),b(pt.$$.fragment),Pl=m(),ke=a("p"),El=s("The "),_a=a("a"),Al=s("FlavaForPreTraining"),Wl=s(" forward method, overrides the "),vn=a("code"),jl=s("__call__"),Ul=s(" special method."),Nl=m(),b(Qe.$$.fragment),_r=m(),ye=a("h2"),Ke=a("a"),bn=a("span"),b(ft.$$.fragment),Zl=m(),kn=a("span"),Jl=s("FlavaModel"),vr=m(),U=a("div"),b(ht.$$.fragment),Vl=m(),gt=a("p"),Bl=s(`The bare FLAVA Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ut=a("a"),Rl=s("torch.nn.Module"),Gl=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ql=m(),J=a("div"),b(_t.$$.fragment),Sl=m(),Fe=a("p"),Ll=s("The "),va=a("a"),Ol=s("FlavaModel"),Dl=s(" forward method, overrides the "),yn=a("code"),Xl=s("__call__"),Yl=s(" special method."),Hl=m(),b(eo.$$.fragment),Ql=m(),b(oo.$$.fragment),Kl=m(),Q=a("div"),b(vt.$$.fragment),ed=m(),Te=a("p"),od=s("The "),ba=a("a"),td=s("FlavaModel"),ad=s(" forward method, overrides the "),Fn=a("code"),nd=s("__call__"),rd=s(" special method."),sd=m(),b(to.$$.fragment),id=m(),K=a("div"),b(bt.$$.fragment),ld=m(),we=a("p"),dd=s("The "),ka=a("a"),cd=s("FlavaModel"),md=s(" forward method, overrides the "),Tn=a("code"),pd=s("__call__"),fd=s(" special method."),hd=m(),b(ao.$$.fragment),br=m(),Me=a("h2"),no=a("a"),wn=a("span"),b(kt.$$.fragment),gd=m(),Mn=a("span"),ud=s("FlavaImageCodebook"),kr=m(),z=a("div"),b(yt.$$.fragment),_d=m(),Ft=a("p"),vd=s(`The FLAVA\u2019s image codebook model inspired from DALL-E\u2019s original encoder. Outputs raw hidden states and can be used
to generate image tokens for an image based on DALL-E\u2019s vocab. Used to generate labels for MIM. Use
`),xn=a("code"),bd=s("get_codebook_indices"),kd=s(" to get image tokens for an image."),yd=m(),Tt=a("p"),Fd=s("This model is a PyTorch "),wt=a("a"),Td=s("torch.nn.Module"),wd=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Md=m(),ya=a("div"),b(Mt.$$.fragment),xd=m(),Fa=a("div"),b(xt.$$.fragment),$d=m(),Ta=a("div"),b($t.$$.fragment),yr=m(),xe=a("h2"),ro=a("a"),$n=a("span"),b(It.$$.fragment),Id=m(),In=a("span"),zd=s("FlavaTextModel"),Fr=m(),S=a("div"),b(zt.$$.fragment),Cd=m(),Ct=a("p"),Pd=s(`The bare FLAVA Text Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Pt=a("a"),Ed=s("torch.nn.Module"),Ad=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wd=m(),V=a("div"),b(Et.$$.fragment),jd=m(),$e=a("p"),Ud=s("The "),wa=a("a"),Nd=s("FlavaTextModel"),Zd=s(" forward method, overrides the "),zn=a("code"),Jd=s("__call__"),Vd=s(" special method."),Bd=m(),b(so.$$.fragment),Rd=m(),b(io.$$.fragment),Tr=m(),Ie=a("h2"),lo=a("a"),Cn=a("span"),b(At.$$.fragment),Gd=m(),Pn=a("span"),qd=s("FlavaImageModel"),wr=m(),L=a("div"),b(Wt.$$.fragment),Sd=m(),jt=a("p"),Ld=s(`The bare FLAVA Image Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ut=a("a"),Od=s("torch.nn.Module"),Dd=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xd=m(),B=a("div"),b(Nt.$$.fragment),Yd=m(),ze=a("p"),Hd=s("The "),Ma=a("a"),Qd=s("FlavaImageModel"),Kd=s(" forward method, overrides the "),En=a("code"),ec=s("__call__"),oc=s(" special method."),tc=m(),b(co.$$.fragment),ac=m(),b(mo.$$.fragment),Mr=m(),Ce=a("h2"),po=a("a"),An=a("span"),b(Zt.$$.fragment),nc=m(),Wn=a("span"),rc=s("FlavaMultimodalModel"),xr=m(),O=a("div"),b(Jt.$$.fragment),sc=m(),Vt=a("p"),ic=s(`The bare FLAVA Multimodal Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Bt=a("a"),lc=s("torch.nn.Module"),dc=s(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),cc=m(),R=a("div"),b(Rt.$$.fragment),mc=m(),Pe=a("p"),pc=s("The "),xa=a("a"),fc=s("FlavaMultimodalModel"),hc=s(" forward method, overrides the "),jn=a("code"),gc=s("__call__"),uc=s(" special method."),_c=m(),b(fo.$$.fragment),vc=m(),b(ho.$$.fragment),this.h()},l(o){const h=fp('[data-svelte="svelte-1phssyn"]',document.head);c=n(h,"META",{name:!0,content:!0}),h.forEach(t),M=p(o),_=n(o,"H1",{class:!0});var Gt=r(_);g=n(Gt,"A",{id:!0,class:!0,href:!0});var Un=r(g);v=n(Un,"SPAN",{});var Nn=r(v);k(l.$$.fragment,Nn),Nn.forEach(t),Un.forEach(t),f=p(Gt),I=n(Gt,"SPAN",{});var Zn=r(I);ls=i(Zn,"FLAVA"),Zn.forEach(t),Gt.forEach(t),On=p(o),se=n(o,"H2",{class:!0});var qt=r(se);Ae=n(qt,"A",{id:!0,class:!0,href:!0});var Jn=r(Ae);Sa=n(Jn,"SPAN",{});var Vn=r(Sa);k(To.$$.fragment,Vn),Vn.forEach(t),Jn.forEach(t),ds=p(qt),La=n(qt,"SPAN",{});var Bn=r(La);cs=i(Bn,"Overview"),Bn.forEach(t),qt.forEach(t),Dn=p(o),We=n(o,"P",{});var St=r(We);ms=i(St,"The FLAVA model was proposed in "),wo=n(St,"A",{href:!0,rel:!0});var Rn=r(wo);ps=i(Rn,"FLAVA: A Foundational Language And Vision Alignment Model"),Rn.forEach(t),fs=i(St," by Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela and is accepted at CVPR 2022."),St.forEach(t),Xn=p(o),Dt=n(o,"P",{});var Gn=r(Dt);hs=i(Gn,`The paper aims at creating a single unified foundation model which can work across vision, language
as well as vision-and-language multimodal tasks.`),Gn.forEach(t),Yn=p(o),Xt=n(o,"P",{});var qn=r(Xt);gs=i(qn,"The abstract from the paper is the following:"),qn.forEach(t),Hn=p(o),Yt=n(o,"P",{});var Sn=r(Yt);Oa=n(Sn,"EM",{});var Ln=r(Oa);us=i(Ln,`State-of-the-art vision and vision-and-language models rely on large-scale visio-linguistic pretraining for obtaining good performance on a variety
of downstream tasks. Generally, such models are often either cross-modal (contrastive) or multi-modal
(with earlier fusion) but not both; and they often only target specific modalities or tasks. A promising
direction would be to use a single holistic universal model, as a \u201Cfoundation\u201D, that targets all modalities
at once \u2014 a true vision and language foundation model should be good at vision tasks, language tasks, and
cross- and multi-modal vision and language tasks. We introduce FLAVA as such a model and demonstrate
impressive performance on a wide range of 35 tasks spanning these target modalities.`),Ln.forEach(t),Sn.forEach(t),Qn=p(o),X=n(o,"P",{});var Ee=r(X);_s=i(Ee,"This model was contributed by "),Mo=n(Ee,"A",{href:!0,rel:!0});var bc=r(Mo);vs=i(bc,"aps"),bc.forEach(t),bs=i(Ee,". The original code can be found "),xo=n(Ee,"A",{href:!0,rel:!0});var kc=r(xo);ks=i(kc,"here"),kc.forEach(t),ys=i(Ee,"."),Ee.forEach(t),Kn=p(o),ie=n(o,"H2",{class:!0});var Ir=r(ie);je=n(Ir,"A",{id:!0,class:!0,href:!0});var yc=r(je);Da=n(yc,"SPAN",{});var Fc=r(Da);k($o.$$.fragment,Fc),Fc.forEach(t),yc.forEach(t),Fs=p(Ir),Xa=n(Ir,"SPAN",{});var Tc=r(Xa);Ts=i(Tc,"FlavaConfig"),Tc.forEach(t),Ir.forEach(t),er=p(o),P=n(o,"DIV",{class:!0});var ee=r(P);k(Io.$$.fragment,ee),ws=p(ee),Y=n(ee,"P",{});var Lt=r(Y);Ht=n(Lt,"A",{href:!0});var wc=r(Ht);Ms=i(wc,"FlavaConfig"),wc.forEach(t),xs=i(Lt," is the configuration class to store the configuration of a "),Qt=n(Lt,"A",{href:!0});var Mc=r(Qt);$s=i(Mc,"FlavaModel"),Mc.forEach(t),Is=i(Lt,`. It is used to
instantiate FLAVA model according to the specified arguments, defining the text model, image model, image codebook
and multimodal model configs. Instantiating a configuration with the defaults will yield a similar configuration to
that of the FLAVA `),zo=n(Lt,"A",{href:!0,rel:!0});var xc=r(zo);zs=i(xc,"facebook/flava-full"),xc.forEach(t),Cs=i(Lt," architecture."),Lt.forEach(t),Ps=p(ee),le=n(ee,"P",{});var $a=r(le);Es=i($a,"Configuration objects inherit from "),Kt=n($a,"A",{href:!0});var $c=r(Kt);As=i($c,"PretrainedConfig"),$c.forEach(t),Ws=i($a,` and can be used to control the model outputs. Read the
documentation from `),ea=n($a,"A",{href:!0});var Ic=r(ea);js=i(Ic,"PretrainedConfig"),Ic.forEach(t),Us=i($a," for more information."),$a.forEach(t),Ns=p(ee),k(Ue.$$.fragment,ee),Zs=p(ee),Ne=n(ee,"DIV",{class:!0});var zr=r(Ne);k(Co.$$.fragment,zr),Js=p(zr),Po=n(zr,"P",{});var Cr=r(Po);Vs=i(Cr,"Instantiate a "),oa=n(Cr,"A",{href:!0});var zc=r(oa);Bs=i(zc,"FlavaConfig"),zc.forEach(t),Rs=i(Cr,` (or a derived class) from flava text model configuration, flava image model
configuration, flava multimodal model and flava codebook model configuration.`),Cr.forEach(t),zr.forEach(t),ee.forEach(t),or=p(o),de=n(o,"H2",{class:!0});var Pr=r(de);Ze=n(Pr,"A",{id:!0,class:!0,href:!0});var Cc=r(Ze);Ya=n(Cc,"SPAN",{});var Pc=r(Ya);k(Eo.$$.fragment,Pc),Pc.forEach(t),Cc.forEach(t),Gs=p(Pr),Ha=n(Pr,"SPAN",{});var Ec=r(Ha);qs=i(Ec,"FlavaTextConfig"),Ec.forEach(t),Pr.forEach(t),tr=p(o),E=n(o,"DIV",{class:!0});var oe=r(E);k(Ao.$$.fragment,oe),Ss=p(oe),Wo=n(oe,"P",{});var Er=r(Wo);Ls=i(Er,"This is the configuration class to store the configuration of a "),ta=n(Er,"A",{href:!0});var Ac=r(ta);Os=i(Ac,"FlavaTextModel"),Ac.forEach(t),Ds=i(Er,`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),Er.forEach(t),Xs=p(oe),jo=n(oe,"P",{});var Ar=r(jo);Ys=i(Ar,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Uo=n(Ar,"A",{href:!0,rel:!0});var Wc=r(Uo);Hs=i(Wc,"facebook/flava-full"),Wc.forEach(t),Qs=i(Ar," architecture."),Ar.forEach(t),Ks=p(oe),ce=n(oe,"P",{});var Ia=r(ce);ei=i(Ia,"Configuration objects inherit from "),aa=n(Ia,"A",{href:!0});var jc=r(aa);oi=i(jc,"PretrainedConfig"),jc.forEach(t),ti=i(Ia,` and can be used to control the model outputs. Read the
documentation from `),na=n(Ia,"A",{href:!0});var Uc=r(na);ai=i(Uc,"PretrainedConfig"),Uc.forEach(t),ni=i(Ia," for more information."),Ia.forEach(t),ri=p(oe),k(Je.$$.fragment,oe),oe.forEach(t),ar=p(o),me=n(o,"H2",{class:!0});var Wr=r(me);Ve=n(Wr,"A",{id:!0,class:!0,href:!0});var Nc=r(Ve);Qa=n(Nc,"SPAN",{});var Zc=r(Qa);k(No.$$.fragment,Zc),Zc.forEach(t),Nc.forEach(t),si=p(Wr),Ka=n(Wr,"SPAN",{});var Jc=r(Ka);ii=i(Jc,"FlavaImageConfig"),Jc.forEach(t),Wr.forEach(t),nr=p(o),A=n(o,"DIV",{class:!0});var te=r(A);k(Zo.$$.fragment,te),li=p(te),Jo=n(te,"P",{});var jr=r(Jo);di=i(jr,"This is the configuration class to store the configuration of a "),ra=n(jr,"A",{href:!0});var Vc=r(ra);ci=i(Vc,"FlavaImageModel"),Vc.forEach(t),mi=i(jr,`. It is used to instantiate an
FLAVA model according to the specified arguments, defining the model architecture.`),jr.forEach(t),pi=p(te),Vo=n(te,"P",{});var Ur=r(Vo);fi=i(Ur,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Bo=n(Ur,"A",{href:!0,rel:!0});var Bc=r(Bo);hi=i(Bc,"facebook/flava-full"),Bc.forEach(t),gi=i(Ur," architecture."),Ur.forEach(t),ui=p(te),pe=n(te,"P",{});var za=r(pe);_i=i(za,"Configuration objects inherit from "),sa=n(za,"A",{href:!0});var Rc=r(sa);vi=i(Rc,"PretrainedConfig"),Rc.forEach(t),bi=i(za,` and can be used to control the model outputs. Read the
documentation from `),ia=n(za,"A",{href:!0});var Gc=r(ia);ki=i(Gc,"PretrainedConfig"),Gc.forEach(t),yi=i(za," for more information."),za.forEach(t),Fi=p(te),k(Be.$$.fragment,te),te.forEach(t),rr=p(o),fe=n(o,"H2",{class:!0});var Nr=r(fe);Re=n(Nr,"A",{id:!0,class:!0,href:!0});var qc=r(Re);en=n(qc,"SPAN",{});var Sc=r(en);k(Ro.$$.fragment,Sc),Sc.forEach(t),qc.forEach(t),Ti=p(Nr),on=n(Nr,"SPAN",{});var Lc=r(on);wi=i(Lc,"FlavaMultimodalConfig"),Lc.forEach(t),Nr.forEach(t),sr=p(o),W=n(o,"DIV",{class:!0});var ae=r(W);k(Go.$$.fragment,ae),Mi=p(ae),qo=n(ae,"P",{});var Zr=r(qo);xi=i(Zr,"This is the configuration class to store the configuration of a "),la=n(Zr,"A",{href:!0});var Oc=r(la);$i=i(Oc,"FlavaMultimodalModel"),Oc.forEach(t),Ii=i(Zr,`. It is used to instantiate
an FLAVA model according to the specified arguments, defining the model architecture.`),Zr.forEach(t),zi=p(ae),So=n(ae,"P",{});var Jr=r(So);Ci=i(Jr,`Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
`),Lo=n(Jr,"A",{href:!0,rel:!0});var Dc=r(Lo);Pi=i(Dc,"facebook/flava-full"),Dc.forEach(t),Ei=i(Jr," architecture."),Jr.forEach(t),Ai=p(ae),he=n(ae,"P",{});var Ca=r(he);Wi=i(Ca,"Configuration objects inherit from "),da=n(Ca,"A",{href:!0});var Xc=r(da);ji=i(Xc,"PretrainedConfig"),Xc.forEach(t),Ui=i(Ca,` and can be used to control the model outputs. Read the
documentation from `),ca=n(Ca,"A",{href:!0});var Yc=r(ca);Ni=i(Yc,"PretrainedConfig"),Yc.forEach(t),Zi=i(Ca," for more information."),Ca.forEach(t),Ji=p(ae),k(Ge.$$.fragment,ae),ae.forEach(t),ir=p(o),ge=n(o,"H2",{class:!0});var Vr=r(ge);qe=n(Vr,"A",{id:!0,class:!0,href:!0});var Hc=r(qe);tn=n(Hc,"SPAN",{});var Qc=r(tn);k(Oo.$$.fragment,Qc),Qc.forEach(t),Hc.forEach(t),Vi=p(Vr),an=n(Vr,"SPAN",{});var Kc=r(an);Bi=i(Kc,"FlavaImageCodebookConfig"),Kc.forEach(t),Vr.forEach(t),lr=p(o),Do=n(o,"DIV",{class:!0});var em=r(Do);k(Xo.$$.fragment,em),em.forEach(t),dr=p(o),ue=n(o,"H2",{class:!0});var Br=r(ue);Se=n(Br,"A",{id:!0,class:!0,href:!0});var om=r(Se);nn=n(om,"SPAN",{});var tm=r(nn);k(Yo.$$.fragment,tm),tm.forEach(t),om.forEach(t),Ri=p(Br),rn=n(Br,"SPAN",{});var am=r(rn);Gi=i(am,"FlavaProcessor"),am.forEach(t),Br.forEach(t),cr=p(o),j=n(o,"DIV",{class:!0});var ne=r(j);k(Ho.$$.fragment,ne),qi=p(ne),sn=n(ne,"P",{});var nm=r(sn);Si=i(nm,"Constructs a FLAVA processor which wraps a FLAVA image processor and a FLAVA tokenizer into a single processor."),nm.forEach(t),Li=p(ne),N=n(ne,"P",{});var D=r(N);ma=n(D,"A",{href:!0});var rm=r(ma);Oi=i(rm,"FlavaProcessor"),rm.forEach(t),Di=i(D," offers all the functionalities of "),pa=n(D,"A",{href:!0});var sm=r(pa);Xi=i(sm,"FlavaImageProcessor"),sm.forEach(t),Yi=i(D," and "),fa=n(D,"A",{href:!0});var im=r(fa);Hi=i(im,"BertTokenizerFast"),im.forEach(t),Qi=i(D,`. See the
`),ln=n(D,"CODE",{});var lm=r(ln);Ki=i(lm,"__call__()"),lm.forEach(t),el=i(D," and "),ha=n(D,"A",{href:!0});var dm=r(ha);ol=i(dm,"decode()"),dm.forEach(t),tl=i(D," for more information."),D.forEach(t),al=p(ne),Le=n(ne,"DIV",{class:!0});var Rr=r(Le);k(Qo.$$.fragment,Rr),nl=p(Rr),Ko=n(Rr,"P",{});var Gr=r(Ko);rl=i(Gr,"This method forwards all its arguments to BertTokenizerFast\u2019s "),ga=n(Gr,"A",{href:!0});var cm=r(ga);sl=i(cm,"batch_decode()"),cm.forEach(t),il=i(Gr,`. Please
refer to the docstring of this method for more information.`),Gr.forEach(t),Rr.forEach(t),ll=p(ne),Oe=n(ne,"DIV",{class:!0});var qr=r(Oe);k(et.$$.fragment,qr),dl=p(qr),ot=n(qr,"P",{});var Sr=r(ot);cl=i(Sr,"This method forwards all its arguments to BertTokenizerFast\u2019s "),ua=n(Sr,"A",{href:!0});var mm=r(ua);ml=i(mm,"decode()"),mm.forEach(t),pl=i(Sr,`. Please refer to
the docstring of this method for more information.`),Sr.forEach(t),qr.forEach(t),ne.forEach(t),mr=p(o),_e=n(o,"H2",{class:!0});var Lr=r(_e);De=n(Lr,"A",{id:!0,class:!0,href:!0});var pm=r(De);dn=n(pm,"SPAN",{});var fm=r(dn);k(tt.$$.fragment,fm),fm.forEach(t),pm.forEach(t),fl=p(Lr),cn=n(Lr,"SPAN",{});var hm=r(cn);hl=i(hm,"FlavaFeatureExtractor"),hm.forEach(t),Lr.forEach(t),pr=p(o),at=n(o,"DIV",{class:!0});var gm=r(at);k(nt.$$.fragment,gm),gm.forEach(t),fr=p(o),ve=n(o,"H2",{class:!0});var Or=r(ve);Xe=n(Or,"A",{id:!0,class:!0,href:!0});var um=r(Xe);mn=n(um,"SPAN",{});var _m=r(mn);k(rt.$$.fragment,_m),_m.forEach(t),um.forEach(t),gl=p(Or),pn=n(Or,"SPAN",{});var vm=r(pn);ul=i(vm,"FlavaImageProcessor"),vm.forEach(t),Or.forEach(t),hr=p(o),q=n(o,"DIV",{class:!0});var Pa=r(q);k(st.$$.fragment,Pa),_l=p(Pa),fn=n(Pa,"P",{});var bm=r(fn);vl=i(bm,"Constructs a Flava image processor."),bm.forEach(t),bl=p(Pa),Ye=n(Pa,"DIV",{class:!0});var Dr=r(Ye);k(it.$$.fragment,Dr),kl=p(Dr),hn=n(Dr,"P",{});var km=r(hn);yl=i(km,"Preprocess an image or batch of images."),km.forEach(t),Dr.forEach(t),Pa.forEach(t),gr=p(o),be=n(o,"H2",{class:!0});var Xr=r(be);He=n(Xr,"A",{id:!0,class:!0,href:!0});var ym=r(He);gn=n(ym,"SPAN",{});var Fm=r(gn);k(lt.$$.fragment,Fm),Fm.forEach(t),ym.forEach(t),Fl=p(Xr),un=n(Xr,"SPAN",{});var Tm=r(un);Tl=i(Tm,"FlavaForPreTraining"),Tm.forEach(t),Xr.forEach(t),ur=p(o),Z=n(o,"DIV",{class:!0});var go=r(Z);k(dt.$$.fragment,go),wl=p(go),_n=n(go,"P",{});var wm=r(_n);Ml=i(wm,"The FLAVA model for pretraining which outputs losses, embeddings, logits and transformer outputs."),wm.forEach(t),xl=p(go),ct=n(go,"P",{});var Yr=r(ct);$l=i(Yr,"This model is a PyTorch "),mt=n(Yr,"A",{href:!0,rel:!0});var Mm=r(mt);Il=i(Mm,"torch.nn.Module"),Mm.forEach(t),zl=i(Yr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Yr.forEach(t),Cl=p(go),H=n(go,"DIV",{class:!0});var Ea=r(H);k(pt.$$.fragment,Ea),Pl=p(Ea),ke=n(Ea,"P",{});var Aa=r(ke);El=i(Aa,"The "),_a=n(Aa,"A",{href:!0});var xm=r(_a);Al=i(xm,"FlavaForPreTraining"),xm.forEach(t),Wl=i(Aa," forward method, overrides the "),vn=n(Aa,"CODE",{});var $m=r(vn);jl=i($m,"__call__"),$m.forEach(t),Ul=i(Aa," special method."),Aa.forEach(t),Nl=p(Ea),k(Qe.$$.fragment,Ea),Ea.forEach(t),go.forEach(t),_r=p(o),ye=n(o,"H2",{class:!0});var Hr=r(ye);Ke=n(Hr,"A",{id:!0,class:!0,href:!0});var Im=r(Ke);bn=n(Im,"SPAN",{});var zm=r(bn);k(ft.$$.fragment,zm),zm.forEach(t),Im.forEach(t),Zl=p(Hr),kn=n(Hr,"SPAN",{});var Cm=r(kn);Jl=i(Cm,"FlavaModel"),Cm.forEach(t),Hr.forEach(t),vr=p(o),U=n(o,"DIV",{class:!0});var re=r(U);k(ht.$$.fragment,re),Vl=p(re),gt=n(re,"P",{});var Qr=r(gt);Bl=i(Qr,`The bare FLAVA Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),ut=n(Qr,"A",{href:!0,rel:!0});var Pm=r(ut);Rl=i(Pm,"torch.nn.Module"),Pm.forEach(t),Gl=i(Qr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Qr.forEach(t),ql=p(re),J=n(re,"DIV",{class:!0});var uo=r(J);k(_t.$$.fragment,uo),Sl=p(uo),Fe=n(uo,"P",{});var Wa=r(Fe);Ll=i(Wa,"The "),va=n(Wa,"A",{href:!0});var Em=r(va);Ol=i(Em,"FlavaModel"),Em.forEach(t),Dl=i(Wa," forward method, overrides the "),yn=n(Wa,"CODE",{});var Am=r(yn);Xl=i(Am,"__call__"),Am.forEach(t),Yl=i(Wa," special method."),Wa.forEach(t),Hl=p(uo),k(eo.$$.fragment,uo),Ql=p(uo),k(oo.$$.fragment,uo),uo.forEach(t),Kl=p(re),Q=n(re,"DIV",{class:!0});var ja=r(Q);k(vt.$$.fragment,ja),ed=p(ja),Te=n(ja,"P",{});var Ua=r(Te);od=i(Ua,"The "),ba=n(Ua,"A",{href:!0});var Wm=r(ba);td=i(Wm,"FlavaModel"),Wm.forEach(t),ad=i(Ua," forward method, overrides the "),Fn=n(Ua,"CODE",{});var jm=r(Fn);nd=i(jm,"__call__"),jm.forEach(t),rd=i(Ua," special method."),Ua.forEach(t),sd=p(ja),k(to.$$.fragment,ja),ja.forEach(t),id=p(re),K=n(re,"DIV",{class:!0});var Na=r(K);k(bt.$$.fragment,Na),ld=p(Na),we=n(Na,"P",{});var Za=r(we);dd=i(Za,"The "),ka=n(Za,"A",{href:!0});var Um=r(ka);cd=i(Um,"FlavaModel"),Um.forEach(t),md=i(Za," forward method, overrides the "),Tn=n(Za,"CODE",{});var Nm=r(Tn);pd=i(Nm,"__call__"),Nm.forEach(t),fd=i(Za," special method."),Za.forEach(t),hd=p(Na),k(ao.$$.fragment,Na),Na.forEach(t),re.forEach(t),br=p(o),Me=n(o,"H2",{class:!0});var Kr=r(Me);no=n(Kr,"A",{id:!0,class:!0,href:!0});var Zm=r(no);wn=n(Zm,"SPAN",{});var Jm=r(wn);k(kt.$$.fragment,Jm),Jm.forEach(t),Zm.forEach(t),gd=p(Kr),Mn=n(Kr,"SPAN",{});var Vm=r(Mn);ud=i(Vm,"FlavaImageCodebook"),Vm.forEach(t),Kr.forEach(t),kr=p(o),z=n(o,"DIV",{class:!0});var G=r(z);k(yt.$$.fragment,G),_d=p(G),Ft=n(G,"P",{});var es=r(Ft);vd=i(es,`The FLAVA\u2019s image codebook model inspired from DALL-E\u2019s original encoder. Outputs raw hidden states and can be used
to generate image tokens for an image based on DALL-E\u2019s vocab. Used to generate labels for MIM. Use
`),xn=n(es,"CODE",{});var Bm=r(xn);bd=i(Bm,"get_codebook_indices"),Bm.forEach(t),kd=i(es," to get image tokens for an image."),es.forEach(t),yd=p(G),Tt=n(G,"P",{});var os=r(Tt);Fd=i(os,"This model is a PyTorch "),wt=n(os,"A",{href:!0,rel:!0});var Rm=r(wt);Td=i(Rm,"torch.nn.Module"),Rm.forEach(t),wd=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(t),Md=p(G),ya=n(G,"DIV",{class:!0});var Gm=r(ya);k(Mt.$$.fragment,Gm),Gm.forEach(t),xd=p(G),Fa=n(G,"DIV",{class:!0});var qm=r(Fa);k(xt.$$.fragment,qm),qm.forEach(t),$d=p(G),Ta=n(G,"DIV",{class:!0});var Sm=r(Ta);k($t.$$.fragment,Sm),Sm.forEach(t),G.forEach(t),yr=p(o),xe=n(o,"H2",{class:!0});var ts=r(xe);ro=n(ts,"A",{id:!0,class:!0,href:!0});var Lm=r(ro);$n=n(Lm,"SPAN",{});var Om=r($n);k(It.$$.fragment,Om),Om.forEach(t),Lm.forEach(t),Id=p(ts),In=n(ts,"SPAN",{});var Dm=r(In);zd=i(Dm,"FlavaTextModel"),Dm.forEach(t),ts.forEach(t),Fr=p(o),S=n(o,"DIV",{class:!0});var Ja=r(S);k(zt.$$.fragment,Ja),Cd=p(Ja),Ct=n(Ja,"P",{});var as=r(Ct);Pd=i(as,`The bare FLAVA Text Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Pt=n(as,"A",{href:!0,rel:!0});var Xm=r(Pt);Ed=i(Xm,"torch.nn.Module"),Xm.forEach(t),Ad=i(as,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),as.forEach(t),Wd=p(Ja),V=n(Ja,"DIV",{class:!0});var _o=r(V);k(Et.$$.fragment,_o),jd=p(_o),$e=n(_o,"P",{});var Va=r($e);Ud=i(Va,"The "),wa=n(Va,"A",{href:!0});var Ym=r(wa);Nd=i(Ym,"FlavaTextModel"),Ym.forEach(t),Zd=i(Va," forward method, overrides the "),zn=n(Va,"CODE",{});var Hm=r(zn);Jd=i(Hm,"__call__"),Hm.forEach(t),Vd=i(Va," special method."),Va.forEach(t),Bd=p(_o),k(so.$$.fragment,_o),Rd=p(_o),k(io.$$.fragment,_o),_o.forEach(t),Ja.forEach(t),Tr=p(o),Ie=n(o,"H2",{class:!0});var ns=r(Ie);lo=n(ns,"A",{id:!0,class:!0,href:!0});var Qm=r(lo);Cn=n(Qm,"SPAN",{});var Km=r(Cn);k(At.$$.fragment,Km),Km.forEach(t),Qm.forEach(t),Gd=p(ns),Pn=n(ns,"SPAN",{});var ep=r(Pn);qd=i(ep,"FlavaImageModel"),ep.forEach(t),ns.forEach(t),wr=p(o),L=n(o,"DIV",{class:!0});var Ba=r(L);k(Wt.$$.fragment,Ba),Sd=p(Ba),jt=n(Ba,"P",{});var rs=r(jt);Ld=i(rs,`The bare FLAVA Image Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ut=n(rs,"A",{href:!0,rel:!0});var op=r(Ut);Od=i(op,"torch.nn.Module"),op.forEach(t),Dd=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(t),Xd=p(Ba),B=n(Ba,"DIV",{class:!0});var vo=r(B);k(Nt.$$.fragment,vo),Yd=p(vo),ze=n(vo,"P",{});var Ra=r(ze);Hd=i(Ra,"The "),Ma=n(Ra,"A",{href:!0});var tp=r(Ma);Qd=i(tp,"FlavaImageModel"),tp.forEach(t),Kd=i(Ra," forward method, overrides the "),En=n(Ra,"CODE",{});var ap=r(En);ec=i(ap,"__call__"),ap.forEach(t),oc=i(Ra," special method."),Ra.forEach(t),tc=p(vo),k(co.$$.fragment,vo),ac=p(vo),k(mo.$$.fragment,vo),vo.forEach(t),Ba.forEach(t),Mr=p(o),Ce=n(o,"H2",{class:!0});var ss=r(Ce);po=n(ss,"A",{id:!0,class:!0,href:!0});var np=r(po);An=n(np,"SPAN",{});var rp=r(An);k(Zt.$$.fragment,rp),rp.forEach(t),np.forEach(t),nc=p(ss),Wn=n(ss,"SPAN",{});var sp=r(Wn);rc=i(sp,"FlavaMultimodalModel"),sp.forEach(t),ss.forEach(t),xr=p(o),O=n(o,"DIV",{class:!0});var Ga=r(O);k(Jt.$$.fragment,Ga),sc=p(Ga),Vt=n(Ga,"P",{});var is=r(Vt);ic=i(is,`The bare FLAVA Multimodal Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Bt=n(is,"A",{href:!0,rel:!0});var ip=r(Bt);lc=i(ip,"torch.nn.Module"),ip.forEach(t),dc=i(is,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),is.forEach(t),cc=p(Ga),R=n(Ga,"DIV",{class:!0});var bo=r(R);k(Rt.$$.fragment,bo),mc=p(bo),Pe=n(bo,"P",{});var qa=r(Pe);pc=i(qa,"The "),xa=n(qa,"A",{href:!0});var lp=r(xa);fc=i(lp,"FlavaMultimodalModel"),lp.forEach(t),hc=i(qa," forward method, overrides the "),jn=n(qa,"CODE",{});var dp=r(jn);gc=i(dp,"__call__"),dp.forEach(t),uc=i(qa," special method."),qa.forEach(t),_c=p(bo),k(fo.$$.fragment,bo),vc=p(bo),k(ho.$$.fragment,bo),bo.forEach(t),Ga.forEach(t),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(Pp)),d(g,"id","flava"),d(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"),d(g,"href","#flava"),d(_,"class","relative group"),d(Ae,"id","overview"),d(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ae,"href","#overview"),d(se,"class","relative group"),d(wo,"href","https://arxiv.org/abs/2112.04482"),d(wo,"rel","nofollow"),d(Mo,"href","https://huggingface.co/aps"),d(Mo,"rel","nofollow"),d(xo,"href","https://github.com/facebookresearch/multimodal/tree/main/examples/flava"),d(xo,"rel","nofollow"),d(je,"id","transformers.FlavaConfig"),d(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(je,"href","#transformers.FlavaConfig"),d(ie,"class","relative group"),d(Ht,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaConfig"),d(Qt,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaModel"),d(zo,"href","https://huggingface.co/facebook/flava-full"),d(zo,"rel","nofollow"),d(Kt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(ea,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(oa,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaConfig"),d(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ze,"id","transformers.FlavaTextConfig"),d(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"),d(Ze,"href","#transformers.FlavaTextConfig"),d(de,"class","relative group"),d(ta,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"),d(Uo,"href","https://huggingface.co/facebook/flava-full"),d(Uo,"rel","nofollow"),d(aa,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(na,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ve,"id","transformers.FlavaImageConfig"),d(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"),d(Ve,"href","#transformers.FlavaImageConfig"),d(me,"class","relative group"),d(ra,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel"),d(Bo,"href","https://huggingface.co/facebook/flava-full"),d(Bo,"rel","nofollow"),d(sa,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(ia,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"id","transformers.FlavaMultimodalConfig"),d(Re,"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"),d(Re,"href","#transformers.FlavaMultimodalConfig"),d(fe,"class","relative group"),d(la,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaMultimodalModel"),d(Lo,"href","https://huggingface.co/facebook/flava-full"),d(Lo,"rel","nofollow"),d(da,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(ca,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qe,"id","transformers.FlavaImageCodebookConfig"),d(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"),d(qe,"href","#transformers.FlavaImageCodebookConfig"),d(ge,"class","relative group"),d(Do,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Se,"id","transformers.FlavaProcessor"),d(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"),d(Se,"href","#transformers.FlavaProcessor"),d(ue,"class","relative group"),d(ma,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaProcessor"),d(pa,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageProcessor"),d(fa,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),d(ha,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaProcessor.decode"),d(ga,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),d(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ua,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),d(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(De,"id","transformers.FlavaFeatureExtractor"),d(De,"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"),d(De,"href","#transformers.FlavaFeatureExtractor"),d(_e,"class","relative group"),d(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xe,"id","transformers.FlavaImageProcessor"),d(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Xe,"href","#transformers.FlavaImageProcessor"),d(ve,"class","relative group"),d(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(He,"id","transformers.FlavaForPreTraining"),d(He,"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"),d(He,"href","#transformers.FlavaForPreTraining"),d(be,"class","relative group"),d(mt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(mt,"rel","nofollow"),d(_a,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaForPreTraining"),d(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ke,"id","transformers.FlavaModel"),d(Ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ke,"href","#transformers.FlavaModel"),d(ye,"class","relative group"),d(ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ut,"rel","nofollow"),d(va,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaModel"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ba,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaModel"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ka,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaModel"),d(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(no,"id","transformers.FlavaImageCodebook"),d(no,"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"),d(no,"href","#transformers.FlavaImageCodebook"),d(Me,"class","relative group"),d(wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(wt,"rel","nofollow"),d(ya,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Fa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ta,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ro,"id","transformers.FlavaTextModel"),d(ro,"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"),d(ro,"href","#transformers.FlavaTextModel"),d(xe,"class","relative group"),d(Pt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Pt,"rel","nofollow"),d(wa,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaTextModel"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(lo,"id","transformers.FlavaImageModel"),d(lo,"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"),d(lo,"href","#transformers.FlavaImageModel"),d(Ie,"class","relative group"),d(Ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ut,"rel","nofollow"),d(Ma,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaImageModel"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(po,"id","transformers.FlavaMultimodalModel"),d(po,"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"),d(po,"href","#transformers.FlavaMultimodalModel"),d(Ce,"class","relative group"),d(Bt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Bt,"rel","nofollow"),d(xa,"href","/docs/transformers/main/en/model_doc/flava#transformers.FlavaMultimodalModel"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,h){e(document.head,c),u(o,M,h),u(o,_,h),e(_,g),e(g,v),y(l,v,null),e(_,f),e(_,I),e(I,ls),u(o,On,h),u(o,se,h),e(se,Ae),e(Ae,Sa),y(To,Sa,null),e(se,ds),e(se,La),e(La,cs),u(o,Dn,h),u(o,We,h),e(We,ms),e(We,wo),e(wo,ps),e(We,fs),u(o,Xn,h),u(o,Dt,h),e(Dt,hs),u(o,Yn,h),u(o,Xt,h),e(Xt,gs),u(o,Hn,h),u(o,Yt,h),e(Yt,Oa),e(Oa,us),u(o,Qn,h),u(o,X,h),e(X,_s),e(X,Mo),e(Mo,vs),e(X,bs),e(X,xo),e(xo,ks),e(X,ys),u(o,Kn,h),u(o,ie,h),e(ie,je),e(je,Da),y($o,Da,null),e(ie,Fs),e(ie,Xa),e(Xa,Ts),u(o,er,h),u(o,P,h),y(Io,P,null),e(P,ws),e(P,Y),e(Y,Ht),e(Ht,Ms),e(Y,xs),e(Y,Qt),e(Qt,$s),e(Y,Is),e(Y,zo),e(zo,zs),e(Y,Cs),e(P,Ps),e(P,le),e(le,Es),e(le,Kt),e(Kt,As),e(le,Ws),e(le,ea),e(ea,js),e(le,Us),e(P,Ns),y(Ue,P,null),e(P,Zs),e(P,Ne),y(Co,Ne,null),e(Ne,Js),e(Ne,Po),e(Po,Vs),e(Po,oa),e(oa,Bs),e(Po,Rs),u(o,or,h),u(o,de,h),e(de,Ze),e(Ze,Ya),y(Eo,Ya,null),e(de,Gs),e(de,Ha),e(Ha,qs),u(o,tr,h),u(o,E,h),y(Ao,E,null),e(E,Ss),e(E,Wo),e(Wo,Ls),e(Wo,ta),e(ta,Os),e(Wo,Ds),e(E,Xs),e(E,jo),e(jo,Ys),e(jo,Uo),e(Uo,Hs),e(jo,Qs),e(E,Ks),e(E,ce),e(ce,ei),e(ce,aa),e(aa,oi),e(ce,ti),e(ce,na),e(na,ai),e(ce,ni),e(E,ri),y(Je,E,null),u(o,ar,h),u(o,me,h),e(me,Ve),e(Ve,Qa),y(No,Qa,null),e(me,si),e(me,Ka),e(Ka,ii),u(o,nr,h),u(o,A,h),y(Zo,A,null),e(A,li),e(A,Jo),e(Jo,di),e(Jo,ra),e(ra,ci),e(Jo,mi),e(A,pi),e(A,Vo),e(Vo,fi),e(Vo,Bo),e(Bo,hi),e(Vo,gi),e(A,ui),e(A,pe),e(pe,_i),e(pe,sa),e(sa,vi),e(pe,bi),e(pe,ia),e(ia,ki),e(pe,yi),e(A,Fi),y(Be,A,null),u(o,rr,h),u(o,fe,h),e(fe,Re),e(Re,en),y(Ro,en,null),e(fe,Ti),e(fe,on),e(on,wi),u(o,sr,h),u(o,W,h),y(Go,W,null),e(W,Mi),e(W,qo),e(qo,xi),e(qo,la),e(la,$i),e(qo,Ii),e(W,zi),e(W,So),e(So,Ci),e(So,Lo),e(Lo,Pi),e(So,Ei),e(W,Ai),e(W,he),e(he,Wi),e(he,da),e(da,ji),e(he,Ui),e(he,ca),e(ca,Ni),e(he,Zi),e(W,Ji),y(Ge,W,null),u(o,ir,h),u(o,ge,h),e(ge,qe),e(qe,tn),y(Oo,tn,null),e(ge,Vi),e(ge,an),e(an,Bi),u(o,lr,h),u(o,Do,h),y(Xo,Do,null),u(o,dr,h),u(o,ue,h),e(ue,Se),e(Se,nn),y(Yo,nn,null),e(ue,Ri),e(ue,rn),e(rn,Gi),u(o,cr,h),u(o,j,h),y(Ho,j,null),e(j,qi),e(j,sn),e(sn,Si),e(j,Li),e(j,N),e(N,ma),e(ma,Oi),e(N,Di),e(N,pa),e(pa,Xi),e(N,Yi),e(N,fa),e(fa,Hi),e(N,Qi),e(N,ln),e(ln,Ki),e(N,el),e(N,ha),e(ha,ol),e(N,tl),e(j,al),e(j,Le),y(Qo,Le,null),e(Le,nl),e(Le,Ko),e(Ko,rl),e(Ko,ga),e(ga,sl),e(Ko,il),e(j,ll),e(j,Oe),y(et,Oe,null),e(Oe,dl),e(Oe,ot),e(ot,cl),e(ot,ua),e(ua,ml),e(ot,pl),u(o,mr,h),u(o,_e,h),e(_e,De),e(De,dn),y(tt,dn,null),e(_e,fl),e(_e,cn),e(cn,hl),u(o,pr,h),u(o,at,h),y(nt,at,null),u(o,fr,h),u(o,ve,h),e(ve,Xe),e(Xe,mn),y(rt,mn,null),e(ve,gl),e(ve,pn),e(pn,ul),u(o,hr,h),u(o,q,h),y(st,q,null),e(q,_l),e(q,fn),e(fn,vl),e(q,bl),e(q,Ye),y(it,Ye,null),e(Ye,kl),e(Ye,hn),e(hn,yl),u(o,gr,h),u(o,be,h),e(be,He),e(He,gn),y(lt,gn,null),e(be,Fl),e(be,un),e(un,Tl),u(o,ur,h),u(o,Z,h),y(dt,Z,null),e(Z,wl),e(Z,_n),e(_n,Ml),e(Z,xl),e(Z,ct),e(ct,$l),e(ct,mt),e(mt,Il),e(ct,zl),e(Z,Cl),e(Z,H),y(pt,H,null),e(H,Pl),e(H,ke),e(ke,El),e(ke,_a),e(_a,Al),e(ke,Wl),e(ke,vn),e(vn,jl),e(ke,Ul),e(H,Nl),y(Qe,H,null),u(o,_r,h),u(o,ye,h),e(ye,Ke),e(Ke,bn),y(ft,bn,null),e(ye,Zl),e(ye,kn),e(kn,Jl),u(o,vr,h),u(o,U,h),y(ht,U,null),e(U,Vl),e(U,gt),e(gt,Bl),e(gt,ut),e(ut,Rl),e(gt,Gl),e(U,ql),e(U,J),y(_t,J,null),e(J,Sl),e(J,Fe),e(Fe,Ll),e(Fe,va),e(va,Ol),e(Fe,Dl),e(Fe,yn),e(yn,Xl),e(Fe,Yl),e(J,Hl),y(eo,J,null),e(J,Ql),y(oo,J,null),e(U,Kl),e(U,Q),y(vt,Q,null),e(Q,ed),e(Q,Te),e(Te,od),e(Te,ba),e(ba,td),e(Te,ad),e(Te,Fn),e(Fn,nd),e(Te,rd),e(Q,sd),y(to,Q,null),e(U,id),e(U,K),y(bt,K,null),e(K,ld),e(K,we),e(we,dd),e(we,ka),e(ka,cd),e(we,md),e(we,Tn),e(Tn,pd),e(we,fd),e(K,hd),y(ao,K,null),u(o,br,h),u(o,Me,h),e(Me,no),e(no,wn),y(kt,wn,null),e(Me,gd),e(Me,Mn),e(Mn,ud),u(o,kr,h),u(o,z,h),y(yt,z,null),e(z,_d),e(z,Ft),e(Ft,vd),e(Ft,xn),e(xn,bd),e(Ft,kd),e(z,yd),e(z,Tt),e(Tt,Fd),e(Tt,wt),e(wt,Td),e(Tt,wd),e(z,Md),e(z,ya),y(Mt,ya,null),e(z,xd),e(z,Fa),y(xt,Fa,null),e(z,$d),e(z,Ta),y($t,Ta,null),u(o,yr,h),u(o,xe,h),e(xe,ro),e(ro,$n),y(It,$n,null),e(xe,Id),e(xe,In),e(In,zd),u(o,Fr,h),u(o,S,h),y(zt,S,null),e(S,Cd),e(S,Ct),e(Ct,Pd),e(Ct,Pt),e(Pt,Ed),e(Ct,Ad),e(S,Wd),e(S,V),y(Et,V,null),e(V,jd),e(V,$e),e($e,Ud),e($e,wa),e(wa,Nd),e($e,Zd),e($e,zn),e(zn,Jd),e($e,Vd),e(V,Bd),y(so,V,null),e(V,Rd),y(io,V,null),u(o,Tr,h),u(o,Ie,h),e(Ie,lo),e(lo,Cn),y(At,Cn,null),e(Ie,Gd),e(Ie,Pn),e(Pn,qd),u(o,wr,h),u(o,L,h),y(Wt,L,null),e(L,Sd),e(L,jt),e(jt,Ld),e(jt,Ut),e(Ut,Od),e(jt,Dd),e(L,Xd),e(L,B),y(Nt,B,null),e(B,Yd),e(B,ze),e(ze,Hd),e(ze,Ma),e(Ma,Qd),e(ze,Kd),e(ze,En),e(En,ec),e(ze,oc),e(B,tc),y(co,B,null),e(B,ac),y(mo,B,null),u(o,Mr,h),u(o,Ce,h),e(Ce,po),e(po,An),y(Zt,An,null),e(Ce,nc),e(Ce,Wn),e(Wn,rc),u(o,xr,h),u(o,O,h),y(Jt,O,null),e(O,sc),e(O,Vt),e(Vt,ic),e(Vt,Bt),e(Bt,lc),e(Vt,dc),e(O,cc),e(O,R),y(Rt,R,null),e(R,mc),e(R,Pe),e(Pe,pc),e(Pe,xa),e(xa,fc),e(Pe,hc),e(Pe,jn),e(jn,gc),e(Pe,uc),e(R,_c),y(fo,R,null),e(R,vc),y(ho,R,null),$r=!0},p(o,[h]){const Gt={};h&2&&(Gt.$$scope={dirty:h,ctx:o}),Ue.$set(Gt);const Un={};h&2&&(Un.$$scope={dirty:h,ctx:o}),Je.$set(Un);const Nn={};h&2&&(Nn.$$scope={dirty:h,ctx:o}),Be.$set(Nn);const Zn={};h&2&&(Zn.$$scope={dirty:h,ctx:o}),Ge.$set(Zn);const qt={};h&2&&(qt.$$scope={dirty:h,ctx:o}),Qe.$set(qt);const Jn={};h&2&&(Jn.$$scope={dirty:h,ctx:o}),eo.$set(Jn);const Vn={};h&2&&(Vn.$$scope={dirty:h,ctx:o}),oo.$set(Vn);const Bn={};h&2&&(Bn.$$scope={dirty:h,ctx:o}),to.$set(Bn);const St={};h&2&&(St.$$scope={dirty:h,ctx:o}),ao.$set(St);const Rn={};h&2&&(Rn.$$scope={dirty:h,ctx:o}),so.$set(Rn);const Gn={};h&2&&(Gn.$$scope={dirty:h,ctx:o}),io.$set(Gn);const qn={};h&2&&(qn.$$scope={dirty:h,ctx:o}),co.$set(qn);const Sn={};h&2&&(Sn.$$scope={dirty:h,ctx:o}),mo.$set(Sn);const Ln={};h&2&&(Ln.$$scope={dirty:h,ctx:o}),fo.$set(Ln);const Ee={};h&2&&(Ee.$$scope={dirty:h,ctx:o}),ho.$set(Ee)},i(o){$r||(F(l.$$.fragment,o),F(To.$$.fragment,o),F($o.$$.fragment,o),F(Io.$$.fragment,o),F(Ue.$$.fragment,o),F(Co.$$.fragment,o),F(Eo.$$.fragment,o),F(Ao.$$.fragment,o),F(Je.$$.fragment,o),F(No.$$.fragment,o),F(Zo.$$.fragment,o),F(Be.$$.fragment,o),F(Ro.$$.fragment,o),F(Go.$$.fragment,o),F(Ge.$$.fragment,o),F(Oo.$$.fragment,o),F(Xo.$$.fragment,o),F(Yo.$$.fragment,o),F(Ho.$$.fragment,o),F(Qo.$$.fragment,o),F(et.$$.fragment,o),F(tt.$$.fragment,o),F(nt.$$.fragment,o),F(rt.$$.fragment,o),F(st.$$.fragment,o),F(it.$$.fragment,o),F(lt.$$.fragment,o),F(dt.$$.fragment,o),F(pt.$$.fragment,o),F(Qe.$$.fragment,o),F(ft.$$.fragment,o),F(ht.$$.fragment,o),F(_t.$$.fragment,o),F(eo.$$.fragment,o),F(oo.$$.fragment,o),F(vt.$$.fragment,o),F(to.$$.fragment,o),F(bt.$$.fragment,o),F(ao.$$.fragment,o),F(kt.$$.fragment,o),F(yt.$$.fragment,o),F(Mt.$$.fragment,o),F(xt.$$.fragment,o),F($t.$$.fragment,o),F(It.$$.fragment,o),F(zt.$$.fragment,o),F(Et.$$.fragment,o),F(so.$$.fragment,o),F(io.$$.fragment,o),F(At.$$.fragment,o),F(Wt.$$.fragment,o),F(Nt.$$.fragment,o),F(co.$$.fragment,o),F(mo.$$.fragment,o),F(Zt.$$.fragment,o),F(Jt.$$.fragment,o),F(Rt.$$.fragment,o),F(fo.$$.fragment,o),F(ho.$$.fragment,o),$r=!0)},o(o){T(l.$$.fragment,o),T(To.$$.fragment,o),T($o.$$.fragment,o),T(Io.$$.fragment,o),T(Ue.$$.fragment,o),T(Co.$$.fragment,o),T(Eo.$$.fragment,o),T(Ao.$$.fragment,o),T(Je.$$.fragment,o),T(No.$$.fragment,o),T(Zo.$$.fragment,o),T(Be.$$.fragment,o),T(Ro.$$.fragment,o),T(Go.$$.fragment,o),T(Ge.$$.fragment,o),T(Oo.$$.fragment,o),T(Xo.$$.fragment,o),T(Yo.$$.fragment,o),T(Ho.$$.fragment,o),T(Qo.$$.fragment,o),T(et.$$.fragment,o),T(tt.$$.fragment,o),T(nt.$$.fragment,o),T(rt.$$.fragment,o),T(st.$$.fragment,o),T(it.$$.fragment,o),T(lt.$$.fragment,o),T(dt.$$.fragment,o),T(pt.$$.fragment,o),T(Qe.$$.fragment,o),T(ft.$$.fragment,o),T(ht.$$.fragment,o),T(_t.$$.fragment,o),T(eo.$$.fragment,o),T(oo.$$.fragment,o),T(vt.$$.fragment,o),T(to.$$.fragment,o),T(bt.$$.fragment,o),T(ao.$$.fragment,o),T(kt.$$.fragment,o),T(yt.$$.fragment,o),T(Mt.$$.fragment,o),T(xt.$$.fragment,o),T($t.$$.fragment,o),T(It.$$.fragment,o),T(zt.$$.fragment,o),T(Et.$$.fragment,o),T(so.$$.fragment,o),T(io.$$.fragment,o),T(At.$$.fragment,o),T(Wt.$$.fragment,o),T(Nt.$$.fragment,o),T(co.$$.fragment,o),T(mo.$$.fragment,o),T(Zt.$$.fragment,o),T(Jt.$$.fragment,o),T(Rt.$$.fragment,o),T(fo.$$.fragment,o),T(ho.$$.fragment,o),$r=!1},d(o){t(c),o&&t(M),o&&t(_),w(l),o&&t(On),o&&t(se),w(To),o&&t(Dn),o&&t(We),o&&t(Xn),o&&t(Dt),o&&t(Yn),o&&t(Xt),o&&t(Hn),o&&t(Yt),o&&t(Qn),o&&t(X),o&&t(Kn),o&&t(ie),w($o),o&&t(er),o&&t(P),w(Io),w(Ue),w(Co),o&&t(or),o&&t(de),w(Eo),o&&t(tr),o&&t(E),w(Ao),w(Je),o&&t(ar),o&&t(me),w(No),o&&t(nr),o&&t(A),w(Zo),w(Be),o&&t(rr),o&&t(fe),w(Ro),o&&t(sr),o&&t(W),w(Go),w(Ge),o&&t(ir),o&&t(ge),w(Oo),o&&t(lr),o&&t(Do),w(Xo),o&&t(dr),o&&t(ue),w(Yo),o&&t(cr),o&&t(j),w(Ho),w(Qo),w(et),o&&t(mr),o&&t(_e),w(tt),o&&t(pr),o&&t(at),w(nt),o&&t(fr),o&&t(ve),w(rt),o&&t(hr),o&&t(q),w(st),w(it),o&&t(gr),o&&t(be),w(lt),o&&t(ur),o&&t(Z),w(dt),w(pt),w(Qe),o&&t(_r),o&&t(ye),w(ft),o&&t(vr),o&&t(U),w(ht),w(_t),w(eo),w(oo),w(vt),w(to),w(bt),w(ao),o&&t(br),o&&t(Me),w(kt),o&&t(kr),o&&t(z),w(yt),w(Mt),w(xt),w($t),o&&t(yr),o&&t(xe),w(It),o&&t(Fr),o&&t(S),w(zt),w(Et),w(so),w(io),o&&t(Tr),o&&t(Ie),w(At),o&&t(wr),o&&t(L),w(Wt),w(Nt),w(co),w(mo),o&&t(Mr),o&&t(Ce),w(Zt),o&&t(xr),o&&t(O),w(Jt),w(Rt),w(fo),w(ho)}}}const Pp={local:"flava",sections:[{local:"overview",title:"Overview"},{local:"transformers.FlavaConfig",title:"FlavaConfig"},{local:"transformers.FlavaTextConfig",title:"FlavaTextConfig"},{local:"transformers.FlavaImageConfig",title:"FlavaImageConfig"},{local:"transformers.FlavaMultimodalConfig",title:"FlavaMultimodalConfig"},{local:"transformers.FlavaImageCodebookConfig",title:"FlavaImageCodebookConfig"},{local:"transformers.FlavaProcessor",title:"FlavaProcessor"},{local:"transformers.FlavaFeatureExtractor",title:"FlavaFeatureExtractor"},{local:"transformers.FlavaImageProcessor",title:"FlavaImageProcessor"},{local:"transformers.FlavaForPreTraining",title:"FlavaForPreTraining"},{local:"transformers.FlavaModel",title:"FlavaModel"},{local:"transformers.FlavaImageCodebook",title:"FlavaImageCodebook"},{local:"transformers.FlavaTextModel",title:"FlavaTextModel"},{local:"transformers.FlavaImageModel",title:"FlavaImageModel"},{local:"transformers.FlavaMultimodalModel",title:"FlavaMultimodalModel"}],title:"FLAVA"};function Ep(x){return hp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jp extends cp{constructor(c){super();mp(this,c,Ep,Cp,pp,{})}}export{Jp as default,Pp as metadata};
